From 1f831e1a310e7fa6dd4c93c90e1cf3846595decf Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 14 Sep 2023 07:28:19 +0200 Subject: [PATCH 001/108] done --- Changelog.md | 26 +++++++- reference/OpenAPI.json | 136 ++++++++++++++++++++++++++++++++++++++--- 2 files changed, 154 insertions(+), 8 deletions(-) diff --git a/Changelog.md b/Changelog.md index 29343746c..d360c7027 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,29 @@ # Changelog +## 20230828 + +**Added schemas** +- CategoryObject +- CreateCategory +- ResponseCreateCategory +- UpdateCategoryRequest +- ResponseUpdateCategory +- ListCategories + +**Endpoints changes** +- `/v1/categories` +- GET +- Response schema was replaced with `ListCategories` +- POST +- Request parameters schema was replaced with `CreateCategory` +- Response schema was replaced with `ResponseCreateCategory` +- `/v1/categories/{categoryId}` +- GET +- Response schema was replaced with `CategoryObject` +- PUT +- Request parameters schema was replaced with `UpdateCategoryRequest` +- Response schema was replaced with `ResponseUpdateCategory` + ## 20230823 - New Endpoints ### Introduced new endpoints and related object schemas @@ -315,4 +339,4 @@ The following endpoints in the OpenAPI document found in the `paths` object are `/v1/category-object` `/v1/metadata-schema-object` `/v1/location-object` -`/v1/qualification-object` \ No newline at end of file +`/v1/qualification-object` diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index baf160ad3..19ecb825c 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39165,6 +39165,128 @@ } } }, + "CategoryObject": { + "allOf": [ + { + "type": "object", + "properties": { + "updated_at": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/ResponseCreateCategory" + } + ] + }, + "CreateCategory": { + "title": "CreateCategory", + "x-stoplight": { + "id": "wa3p2p8kef0fn" + }, + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hierarchy": { + "type": "integer" + } + }, + "required": [ + "name", + "hierarchy" + ] + }, + "ResponseCreateCategory": { + "title": "ResponseCreateCategory", + "x-stoplight": { + "id": "bzep9crox651t" + }, + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "hierarchy": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "object": { + "type": "string", + "default": "category", + "pattern": "/category/" + } + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ] + }, + "UpdateCategoryRequest": { + "$ref": "#/components/schemas/CreateCategory" + }, + "ResponseUpdateCategory": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseCreateCategory" + }, + { + "type": "object", + "properties": { + "updated_at": { + "type": "string" + } + }, + "required": [ + "updated_at" + ] + } + ] + }, + "ListCategories": { + "title": "ListCategories", + "x-stoplight": { + "id": "lxwe1mp60v02h" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "list", + "pattern": "/list/" + }, + "data_ref": { + "type": "string", + "pattern": "/data/", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CategoryObject" + } + }, + "total": { + "type": "integer" + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, "a_req_importCSV": { "type": "object", "title": "Import CSV file", @@ -79173,7 +79295,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_res_list_categories" + "$ref": "#/components/schemas/ListCategories" }, "examples": { "Example": { @@ -79252,7 +79374,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_req_create_category" + "$ref": "#/components/schemas/CreateCategory" }, "examples": { "Example": { @@ -79271,7 +79393,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_res_create_category" + "$ref": "#/components/schemas/ResponseCreateCategory" }, "examples": { "Example": { @@ -79352,7 +79474,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/CategoryObject" }, "examples": { "Example": { @@ -79432,7 +79554,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_req_update_categories_categoryId" + "$ref": "#/components/schemas/UpdateCategoryRequest" }, "examples": { "Example": { @@ -79451,7 +79573,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/ResponseUpdateCategory" }, "examples": { "Example": { @@ -80923,4 +81045,4 @@ } } } -} \ No newline at end of file +} From 1c28dc84a9d60627170186a5d9b755be3ef4dd20 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 14 Sep 2023 07:35:40 +0200 Subject: [PATCH 002/108] Update Changelog.md --- Changelog.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Changelog.md b/Changelog.md index d360c7027..489765aa2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,17 +12,17 @@ **Endpoints changes** - `/v1/categories` -- GET -- Response schema was replaced with `ListCategories` -- POST -- Request parameters schema was replaced with `CreateCategory` -- Response schema was replaced with `ResponseCreateCategory` + - GET + - Response schema was replaced with `ListCategories` (old 20_res_list_categories) + - POST + - Request parameters schema was replaced with `CreateCategory` (old 20_req_create_category) + - Response schema was replaced with `ResponseCreateCategory` (old 20_res_create_category) - `/v1/categories/{categoryId}` -- GET -- Response schema was replaced with `CategoryObject` -- PUT -- Request parameters schema was replaced with `UpdateCategoryRequest` -- Response schema was replaced with `ResponseUpdateCategory` + - GET + - Response schema was replaced with `CategoryObject` (old 20_obj_category_object) + - PUT + - Request parameters schema was replaced with `UpdateCategoryRequest` (old 20_req_update_categories_categoryId) + - Response schema was replaced with `ResponseUpdateCategory` (old 20_obj_category_object) ## 20230823 - New Endpoints From cc42e877a1072ddb99302308020a4cea85f47313 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Fri, 15 Sep 2023 13:24:37 +0200 Subject: [PATCH 003/108] Promotion Tier -> Rollback Promotion Tier (unification) Fixed filters in Examine Qualification endpoint. --- reference/OpenAPI.json | 109 ++++++++++++++++++++++++++++++++++------- 1 file changed, 91 insertions(+), 18 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index baf160ad3..3a3de598f 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -1,4 +1,4 @@ -{ + { "openapi": "3.0.0", "info": { "title": "Voucherify API", @@ -16260,7 +16260,7 @@ }, "19_obj_redemption_rollback_object_promotion_tier_stacked": { "type": "object", - "title": "Promotion Tier", + "title": "Rollback Promotion Tier", "description": "This is an object representing a promotion tier redemption rollback", "properties": { "id": { @@ -36048,6 +36048,42 @@ } } }, + "16_filter_conditions_string_qualification": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, "17_obj_async_action_object": { "title": "Async Action Object", "type": "object", @@ -39026,12 +39062,21 @@ }, "filters": { "description": "A set of fiters to return only a specific category or type of redeemable.", - "anyOf": [ + "allOf": [ + { + "$ref": "#/components/schemas/23_obj_filter_category_id" + }, + { + "$ref": "#/components/schemas/23_obj_filter_campaign_id" + }, { "$ref": "#/components/schemas/23_obj_filter_resource_type" }, { - "$ref": "#/components/schemas/23_obj_filter_category_id" + "$ref": "#/components/schemas/23_obj_filter_voucher_type" + }, + { + "$ref": "#/components/schemas/qualificationJunction" } ] } @@ -39106,32 +39151,60 @@ } } }, + "23_obj_filter_category_id": { + "description": "Filter conditions set on the resource `category_id`.", + "title": "Filter by category ID", + "type": "object", + "properties": { + "category_id": { + "$ref": "#/components/schemas/16_filter_conditions_string_qualification" + } + } + }, + "23_obj_filter_campaign_id": { + "description": "Filter conditions set on the resource `campaign_id`.", + "title": "Filter by campaign ID", + "type": "object", + "properties": { + "campaign_id": { + "$ref": "#/components/schemas/16_filter_conditions_string_qualification" + } + } + }, "23_obj_filter_resource_type": { - "description": "Filter conditions set on the resource `type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", + "description": "Filter conditions set on the resource `resource_type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", "title": "Filter by type", "type": "object", "properties": { "resource_type": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" + "$ref": "#/components/schemas/16_filter_conditions_string_qualification" } } }, - "23_obj_filter_category_id": { - "description": "Filter conditions set on the resource `category_id`.", - "title": "Filter by category ID", + "23_obj_filter_voucher_type": { + "description": "Filter conditions set on the resource `voucher_type`.", + "title": "Filter by type", "type": "object", "properties": { - "category_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" + "voucher_type": { + "$ref": "#/components/schemas/16_filter_conditions_string_qualification" } } }, + "qualificationJunction": { + "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.", + "title": "Logical Operator Between Filters", + "$ref": "#/components/schemas/Junction" + }, + "Junction": { + "enum": [ + "AND", + "OR", + "and", + "or" + ], + "type": "string" + }, "23_obj_qualification_redeemables": { "title": "Redeemables", "type": "object", @@ -80923,4 +80996,4 @@ } } } -} \ No newline at end of file +} From f34bf543b80bbf43c60d5c9818cb9bedd67e7259 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Mon, 18 Sep 2023 13:20:22 +0200 Subject: [PATCH 004/108] Added SimpleCustomerResponse object and add it to track custom event response. --- reference/OpenAPI.json | 58 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 3a3de598f..0b6d5c857 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -34868,7 +34868,8 @@ }, "customer": { "type": "object", - "description": "An empty customer object." + "description": "A simple customer object", + "$ref": "#/components/schemas/SimpleCustomerResponse" }, "referral": { "type": "null", @@ -40062,6 +40063,61 @@ "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } + }, + "SimpleCustomerResponse": { + "type": "object", + "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", + "title": "Customer Object", + "examples": [ + { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", + "source_id": "08dd9b5a", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "metadata": { + "age": 24, + "loyalty_customer": "true", + "acquisition_channel": "Facebook" + }, + "object": "customer" + } + ], + "x-tags": [ + "EVENTS API" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_CSnYd37MXmrbS19XCrghjBsv", + "required": true + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service.", + "required": true + }, + "name": { + "type": "string", + "description": "Customer's first and last name.", + "required": true + }, + "email": { + "type": "string", + "description": "Customer's email address.", + "required": true + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the customer.", + "default": "customer", + "required": true + } + } } }, "examples": { From 1ef2181dd749524be47e309476a2ac0a5d8368d5 Mon Sep 17 00:00:00 2001 From: jkaliszuk Date: Mon, 18 Sep 2023 15:38:15 +0200 Subject: [PATCH 005/108] 20230918 Changelog.md --- Changelog.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 29343746c..e5f773aa5 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,17 @@ # Changelog +## 20230918 - Endpoint bugfixes and improvements + +- Described customer object in Track custom event endpoint +- Fixed qualifications filters (missing and wrong properties) +- Fixed wrong name of rollback object in Rollback Stackable Redemptions response + +| **API** | **Endpoint** | **Slug** | +|---|---------------------------------|----------------------| +| **Events** | Track Custom Event | track-custom-event | true | +| **Qualifications** | Examine Qualification | examine-qualification | true | +| **Stackable Discounts** | Rollback Stackable Redemptions | rollback-stackable-redemptions | rollback-stacked-redemptions | true | + ## 20230823 - New Endpoints ### Introduced new endpoints and related object schemas @@ -315,4 +327,4 @@ The following endpoints in the OpenAPI document found in the `paths` object are `/v1/category-object` `/v1/metadata-schema-object` `/v1/location-object` -`/v1/qualification-object` \ No newline at end of file +`/v1/qualification-object` From 4aaf7b56777a4dbff2268cc3e92dcb7ab4a67dff Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:41:32 +0200 Subject: [PATCH 006/108] Update OpenAPI.json --- reference/OpenAPI.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 912fabfa6..0fc53e1ce 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39184,9 +39184,6 @@ }, "CreateCategory": { "title": "CreateCategory", - "x-stoplight": { - "id": "wa3p2p8kef0fn" - }, "type": "object", "properties": { "name": { @@ -39203,9 +39200,6 @@ }, "ResponseCreateCategory": { "title": "ResponseCreateCategory", - "x-stoplight": { - "id": "bzep9crox651t" - }, "type": "object", "properties": { "id": { @@ -39257,9 +39251,6 @@ }, "ListCategories": { "title": "ListCategories", - "x-stoplight": { - "id": "lxwe1mp60v02h" - }, "type": "object", "properties": { "object": { From c1587eace205034fa002f8f5f4ebf6358c7a1abe Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:44:44 +0200 Subject: [PATCH 007/108] Update OpenAPI.json --- reference/OpenAPI.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 0fc53e1ce..b315feb91 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39217,7 +39217,7 @@ "object": { "type": "string", "default": "category", - "pattern": "/category/" + "enum": ["category"] } }, "required": [ @@ -39256,12 +39256,11 @@ "object": { "type": "string", "default": "list", - "pattern": "/list/" + "enum": ["list"] }, "data_ref": { "type": "string", - "pattern": "/data/", - "default": "data" + "enum": ["data"] }, "data": { "type": "array", From cd9ea9ebab4aca8d41a41cbe283983e4fdfd1f5a Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:50:03 +0200 Subject: [PATCH 008/108] Update OpenAPI.json --- reference/OpenAPI.json | 31 ++----------------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index b315feb91..fdec8d46b 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39168,19 +39168,7 @@ } }, "CategoryObject": { - "allOf": [ - { - "type": "object", - "properties": { - "updated_at": { - "type": "string" - } - } - }, - { - "$ref": "#/components/schemas/ResponseCreateCategory" - } - ] + "$ref": "#/components/schemas/ResponseCreateCategory" }, "CreateCategory": { "title": "CreateCategory", @@ -39232,22 +39220,7 @@ "$ref": "#/components/schemas/CreateCategory" }, "ResponseUpdateCategory": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseCreateCategory" - }, - { - "type": "object", - "properties": { - "updated_at": { - "type": "string" - } - }, - "required": [ - "updated_at" - ] - } - ] + "$ref": "#/components/schemas/ResponseCreateCategory" }, "ListCategories": { "title": "ListCategories", From 4ce93b4688f8ed5de10389eeff0c98c41df3d0ae Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:56:00 +0200 Subject: [PATCH 009/108] Revert "Update OpenAPI.json" This reverts commit cd9ea9ebab4aca8d41a41cbe283983e4fdfd1f5a. --- reference/OpenAPI.json | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index fdec8d46b..b315feb91 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39168,7 +39168,19 @@ } }, "CategoryObject": { - "$ref": "#/components/schemas/ResponseCreateCategory" + "allOf": [ + { + "type": "object", + "properties": { + "updated_at": { + "type": "string" + } + } + }, + { + "$ref": "#/components/schemas/ResponseCreateCategory" + } + ] }, "CreateCategory": { "title": "CreateCategory", @@ -39220,7 +39232,22 @@ "$ref": "#/components/schemas/CreateCategory" }, "ResponseUpdateCategory": { - "$ref": "#/components/schemas/ResponseCreateCategory" + "allOf": [ + { + "$ref": "#/components/schemas/ResponseCreateCategory" + }, + { + "type": "object", + "properties": { + "updated_at": { + "type": "string" + } + }, + "required": [ + "updated_at" + ] + } + ] }, "ListCategories": { "title": "ListCategories", From e63ed855f4cced20b4ac8c48f4b0a6612a37054e Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:28:26 +0200 Subject: [PATCH 010/108] Update OpenAPI.json --- reference/OpenAPI.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index f31e9fcf7..98725effd 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -79258,7 +79258,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/20_obj_category_object" + "$ref": "#/components/schemas/CategoryObject" } } } From 5d7bf2b404945b00d4e0110fb3fd3ae16a1a99b4 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:38:12 +0200 Subject: [PATCH 011/108] Update OpenAPI.json --- reference/OpenAPI.json | 157 ++++++++++++++++++++++++++++------------- 1 file changed, 106 insertions(+), 51 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 79a3a1cef..684c62439 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39191,23 +39191,84 @@ } } }, - "CategoryObject": { - "allOf": [ - { - "type": "object", - "properties": { - "updated_at": { - "type": "string" - } + "Category": { + "title": "Category", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "hierarchy": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "object": { + "type": "string", + "default": "category", + "enum": [ + "category" + ] + }, + "updated_at": { + "type": "string" + } + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object" + ], + "x-stoplight": { + "id": "962d8abb14ade" + } + }, + "CategoriesListResponseBody": { + "title": "CategoriesListResponseBody", + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "list", + "enum": [ + "list" + ] + }, + "data_ref": { + "type": "string", + "default": "data", + "enum": [ + "data" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Category" } }, - { - "$ref": "#/components/schemas/ResponseCreateCategory" + "total": { + "type": "integer" } - ] + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ], + "x-stoplight": { + "id": "c967c76fc93e1" + } }, - "CreateCategory": { - "title": "CreateCategory", + "CategoriesCreateRequestBody": { + "title": "CategoriesCreateRequestBody", "type": "object", "properties": { "name": { @@ -39222,8 +39283,8 @@ "hierarchy" ] }, - "ResponseCreateCategory": { - "title": "ResponseCreateCategory", + "CategoriesCreateResponseBody": { + "title": "CategoriesCreateResponseBody", "type": "object", "properties": { "id": { @@ -39241,7 +39302,9 @@ "object": { "type": "string", "default": "category", - "enum": ["category"] + "enum": [ + "category" + ] } }, "required": [ @@ -39252,13 +39315,34 @@ "object" ] }, - "UpdateCategoryRequest": { - "$ref": "#/components/schemas/CreateCategory" + "CategoriesGetResponseBody": { + "title": "CategoriesGetResponseBody", + "allOf": [ + { + "$ref": "#/components/schemas/Category" + } + ] + }, + "CategoriesUpdateRequestBody": { + "title": "CategoriesUpdateRequestBody", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hierarchy": { + "type": "integer" + } + }, + "required": [ + "name", + "hierarchy" + ] }, - "ResponseUpdateCategory": { + "CategoriesUpdateResponseBody": { "allOf": [ { - "$ref": "#/components/schemas/ResponseCreateCategory" + "$ref": "#/components/schemas/Category" }, { "type": "object", @@ -39271,37 +39355,8 @@ "updated_at" ] } - ] - }, - "ListCategories": { - "title": "ListCategories", - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "list", - "enum": ["list"] - }, - "data_ref": { - "type": "string", - "enum": ["data"] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CategoryObject" - } - }, - "total": { - "type": "integer" - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] + ], + "title": "CategoriesUpdateResponseBody" }, "a_req_importCSV": { "type": "object", From 3b45d0b5d72bfc355bc7b2da637b3254d544070a Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:41:32 +0200 Subject: [PATCH 012/108] Update OpenAPI.json --- reference/OpenAPI.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 684c62439..6ce1e139b 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -79337,7 +79337,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CategoryObject" + "$ref": "#/components/schemas/Category" } } } @@ -79366,7 +79366,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ListCategories" + "$ref": "#/components/schemas/CategoriesListResponseBody" }, "examples": { "Example": { @@ -79445,7 +79445,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CreateCategory" + "$ref": "#/components/schemas/CategoriesCreateRequestBody" }, "examples": { "Example": { @@ -79464,7 +79464,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResponseCreateCategory" + "$ref": "#/components/schemas/CategoriesCreateResponseBody" }, "examples": { "Example": { @@ -79545,7 +79545,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CategoryObject" + "$ref": "#/components/schemas/CategoriesGetResponseBody" }, "examples": { "Example": { @@ -79625,7 +79625,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UpdateCategoryRequest" + "$ref": "#/components/schemas/CategoriesUpdateRequestBody" }, "examples": { "Example": { @@ -79644,7 +79644,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ResponseUpdateCategory" + "$ref": "#/components/schemas/CategoriesUpdateResponseBody" }, "examples": { "Example": { From f1ebbbd621eb358e6ee867026068076d8445de95 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 22 Sep 2023 13:48:31 +0200 Subject: [PATCH 013/108] Update OpenAPI.json --- reference/OpenAPI.json | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 6ce1e139b..c937bbecd 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39193,6 +39193,7 @@ }, "Category": { "title": "Category", + "description": "This is an object representing a category.", "type": "object", "properties": { "id": { From 7e21eede7173364d4f4da73d91bbc0c46111ac4c Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:05:23 +0200 Subject: [PATCH 014/108] Update OpenAPI.json --- reference/OpenAPI.json | 45 +++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index c937bbecd..57372f942 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39341,23 +39341,40 @@ ] }, "CategoriesUpdateResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/Category" + "title": "CategoriesUpdateResponseBody", + "type": "object", + "properties": { + "id": { + "type": "string" }, - { - "type": "object", - "properties": { - "updated_at": { - "type": "string" - } - }, - "required": [ - "updated_at" + "name": { + "type": "string" + }, + "hierarchy": { + "type": "integer" + }, + "created_at": { + "type": "string" + }, + "object": { + "type": "string", + "default": "category", + "enum": [ + "category" ] + }, + "updated_at": { + "type": "string" } - ], - "title": "CategoriesUpdateResponseBody" + }, + "required": [ + "id", + "name", + "hierarchy", + "created_at", + "object", + "updated_at" + ] }, "a_req_importCSV": { "type": "object", From bf7d524eed4948d5fa6fc70affb8f8498a94bdfa Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:47:41 +0200 Subject: [PATCH 015/108] Update OpenAPI.json --- reference/OpenAPI.json | 102 ++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 31 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 57372f942..8afa04510 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39197,26 +39197,36 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique category ID assigned by Voucherify." }, "name": { - "type": "string" + "type": "string", + "description": "Category name." }, "hierarchy": { - "type": "integer" - }, - "created_at": { - "type": "string" + "type": "integer", + "description": "Category hierarchy." }, "object": { "type": "string", "default": "category", "enum": [ "category" - ] + ], + "description": "The type of object represented by the JSON. This object stores information about the category." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" }, "updated_at": { - "type": "string" + "type": "string", + "example": "2022-08-16T10:52:08.094Z", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", + "format": "date-time" } }, "required": [ @@ -39226,27 +39236,37 @@ "created_at", "object" ], - "x-stoplight": { - "id": "962d8abb14ade" - } + "examples": [ + { + "id": "cat_0b60cfe7d0d7ddbb55", + "name": "CategoryName", + "hierarchy": 1, + "created_at": "2022-07-14T10:45:13.156Z", + "updated_at": "2022-08-16T11:03:54.727Z", + "object": "category" + } + ] }, "CategoriesListResponseBody": { "title": "CategoriesListResponseBody", "type": "object", + "description": "Response schema for **GET** `/categories`.", "properties": { "object": { "type": "string", "default": "list", "enum": [ "list" - ] + ], + "description": "The type of object represented by JSON. This object stores information about categories in a dictionary." }, "data_ref": { "type": "string", "default": "data", "enum": [ "data" - ] + ], + "description": "Identifies the name of the attribute that contains the array of category objects." }, "data": { "type": "array", @@ -39255,7 +39275,8 @@ } }, "total": { - "type": "integer" + "type": "integer", + "description": "Total number of categories." } }, "required": [ @@ -39273,10 +39294,12 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Category name." }, "hierarchy": { - "type": "integer" + "type": "integer", + "description": "Category hierarchy." } }, "required": [ @@ -39289,16 +39312,16 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique category ID assigned by Voucherify." }, "name": { - "type": "string" + "type": "string", + "description": "Category name." }, "hierarchy": { - "type": "integer" - }, - "created_at": { - "type": "string" + "type": "integer", + "description": "Category hierarchy." }, "object": { "type": "string", @@ -39306,6 +39329,12 @@ "enum": [ "category" ] + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" } }, "required": [ @@ -39329,10 +39358,12 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "Category name." }, "hierarchy": { - "type": "integer" + "type": "integer", + "description": "Category hierarchy." } }, "required": [ @@ -39345,16 +39376,16 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique category ID assigned by Voucherify." }, "name": { - "type": "string" + "type": "string", + "description": "Category name." }, "hierarchy": { - "type": "integer" - }, - "created_at": { - "type": "string" + "type": "integer", + "description": "Category hierarchy." }, "object": { "type": "string", @@ -39363,8 +39394,17 @@ "category" ] }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" + }, "updated_at": { - "type": "string" + "type": "string", + "example": "2022-08-16T10:52:08.094Z", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", + "format": "date-time" } }, "required": [ From 999ff7f0285a5d5a751e2a369dfd264afa41e16b Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:49:12 +0200 Subject: [PATCH 016/108] Update OpenAPI.json --- reference/OpenAPI.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 8afa04510..92f428431 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39346,12 +39346,7 @@ ] }, "CategoriesGetResponseBody": { - "title": "CategoriesGetResponseBody", - "allOf": [ - { - "$ref": "#/components/schemas/Category" - } - ] + "$ref": "#/components/schemas/Category" }, "CategoriesUpdateRequestBody": { "title": "CategoriesUpdateRequestBody", From b7d7f2c8828a016dc5318e9324317b139712448e Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:12:05 +0200 Subject: [PATCH 017/108] Update Changelog.md --- Changelog.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Changelog.md b/Changelog.md index 54c9b0172..d7801fd8e 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,26 +3,27 @@ ## 20230828 **Added schemas** -- CategoryObject -- CreateCategory -- ResponseCreateCategory -- UpdateCategoryRequest -- ResponseUpdateCategory -- ListCategories +- Category +- CategoriesListResponseBody +- CategoriesCreateRequestBody +- CategoriesCreateResponseBody +- CategoriesGetResponseBody +- CategoriesUpdateRequestBody +- CategoriesUpdateResponseBody **Endpoints changes** - `/v1/categories` - GET - - Response schema was replaced with `ListCategories` (old 20_res_list_categories) + - Response schema was replaced with `CategoriesListResponseBody` (old 20_res_list_categories) - POST - - Request parameters schema was replaced with `CreateCategory` (old 20_req_create_category) - - Response schema was replaced with `ResponseCreateCategory` (old 20_res_create_category) + - Request parameters schema was replaced with `CategoriesCreateRequestBody` (old 20_req_create_category) + - Response schema was replaced with `CategoriesCreateResponseBody` (old 20_res_create_category) - `/v1/categories/{categoryId}` - GET - - Response schema was replaced with `CategoryObject` (old 20_obj_category_object) + - Response schema was replaced with `CategoriesGetResponseBody` (old 20_obj_category_object) - PUT - - Request parameters schema was replaced with `UpdateCategoryRequest` (old 20_req_update_categories_categoryId) - - Response schema was replaced with `ResponseUpdateCategory` (old 20_obj_category_object) + - Request parameters schema was replaced with `CategoriesUpdateRequestBody` (old 20_req_update_categories_categoryId) + - Response schema was replaced with `CategoriesUpdateResponseBody` (old 20_obj_category_object) ## 20230823 - New Endpoints From 83e5cb6bfeda727caf54e5f41378ec7cae59a7d4 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:18:39 +0200 Subject: [PATCH 018/108] order --- docs/reference-docs/CATEGORIES-API-Create-Category.md | 2 +- docs/reference-docs/CATEGORIES-API-Delete-Category.md | 2 +- docs/reference-docs/CATEGORIES-API-Get-Category.md | 2 +- docs/reference-docs/CATEGORIES-API-List-Categories.md | 2 +- docs/reference-docs/CATEGORIES-API-Update-Category.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference-docs/CATEGORIES-API-Create-Category.md b/docs/reference-docs/CATEGORIES-API-Create-Category.md index c69abe2ff..e217d3dd8 100644 --- a/docs/reference-docs/CATEGORIES-API-Create-Category.md +++ b/docs/reference-docs/CATEGORIES-API-Create-Category.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: create-category parentDocSlug: categories-api hidden: false -order: 3 +order: 4 --- [block:html] { diff --git a/docs/reference-docs/CATEGORIES-API-Delete-Category.md b/docs/reference-docs/CATEGORIES-API-Delete-Category.md index 95eab5e11..e55ae6af3 100644 --- a/docs/reference-docs/CATEGORIES-API-Delete-Category.md +++ b/docs/reference-docs/CATEGORIES-API-Delete-Category.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: delete-category parentDocSlug: categories-api hidden: false -order: 5 +order: 6 --- [block:html] { diff --git a/docs/reference-docs/CATEGORIES-API-Get-Category.md b/docs/reference-docs/CATEGORIES-API-Get-Category.md index aa4aea600..672283671 100644 --- a/docs/reference-docs/CATEGORIES-API-Get-Category.md +++ b/docs/reference-docs/CATEGORIES-API-Get-Category.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: get-category parentDocSlug: categories-api hidden: false -order: 2 +order: 3 --- [block:html] { diff --git a/docs/reference-docs/CATEGORIES-API-List-Categories.md b/docs/reference-docs/CATEGORIES-API-List-Categories.md index d2f203b9d..1823d6f8e 100644 --- a/docs/reference-docs/CATEGORIES-API-List-Categories.md +++ b/docs/reference-docs/CATEGORIES-API-List-Categories.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: list-categories parentDocSlug: categories-api hidden: false -order: 1 +order: 2 --- [block:html] { diff --git a/docs/reference-docs/CATEGORIES-API-Update-Category.md b/docs/reference-docs/CATEGORIES-API-Update-Category.md index 345155055..f3f5f5398 100644 --- a/docs/reference-docs/CATEGORIES-API-Update-Category.md +++ b/docs/reference-docs/CATEGORIES-API-Update-Category.md @@ -5,7 +5,7 @@ categorySlug: voucherify-api slug: update-category parentDocSlug: categories-api hidden: false -order: 4 +order: 5 --- [block:html] { 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 019/108] 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 5b1f45e537c0832f2f125424d0eb13a5ea1b1e49 Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Thu, 12 Oct 2023 14:55:55 +0200 Subject: [PATCH 020/108] Add files via upload --- ...g_started_Quickstart_join_the_dashboard.png | Bin 0 -> 377374 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/assets/img/guides_getting_started_Quickstart_join_the_dashboard.png diff --git a/docs/assets/img/guides_getting_started_Quickstart_join_the_dashboard.png b/docs/assets/img/guides_getting_started_Quickstart_join_the_dashboard.png new file mode 100644 index 0000000000000000000000000000000000000000..b4d2e7b425b486254b4033e46f7148da0382d1da GIT binary patch literal 377374 zcmbTd1ymeOw>3Nv2<}NBxVr>*7~I`G!CeP;m*5)QEx5acBsdJgCAfQVhktndx!-%& z`tLidXS(R_s_Hsbb@o2Hif~1F2^2(JL;wJQA|)xR3;-Yj0RUJK{7c9c(e#WE003Fo zLPSJSN<@TM(b3M-!rBA?kPJ`KfYVeNc$1|Q9}9#>2Lh#c#}Ln`)h`LfSt$0A^wJB%%$RA zX2PZCf7NfZW;BQ11eKH5yD7~ArPu}IE>6OPWm$41bU?m_BnBA6LBHGDlv@+Ycv*u| zk0C-oVOI2%lW@a1a!w-0$ms-6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hLPi&kt$DHj99 zE2%={Ygc#ntAh-iZ3-BL7P`hZRZXN%z9H?kYO1P@_72}k6PMNbZz!E?oj04a9G=ap z%^USZU5+pB^H|zcKMq-pUsN~TZFfHz->zHa@7V<(Yi*l*YLm_o)w!|V>*!f)_GI&* zrlPJ9Z-VZOw_Egy#N)FD3m5wjxGok1F!A}_Y}x@wg@;*v9`6%t5@WcgV>e^y&x2i; z@Yp;s)o7mykUZ#X7{ypd31$Bh{s3|Hyo3@XJ;X)Z=gQR-0spgwo;t2+({US$#)W>zO7 zZBVUZh*-*446DVxy6{Nx$wHV1-{ciZ6bhL^u>3 zV~>{{jCY#9zUEuZ%5aZ4F7w&OtfJCJ_vf=j7nE=Z@o84o2j$=KS&b}La~!81q-G33 z7qzoK$7^H4;f30W__0O*l3gOwBP37r Date: Thu, 12 Oct 2023 15:52:07 +0200 Subject: [PATCH 021/108] Add files via upload --- ...des_getting_started_Quickstart_API_keys.png | Bin 0 -> 41024 bytes ...es_getting_started_Quickstart_audit_log.png | Bin 0 -> 388646 bytes ..._getting_started_Quickstart_review_logs.png | Bin 0 -> 61662 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 docs/assets/img/guides_getting_started_Quickstart_API_keys.png create mode 100644 docs/assets/img/guides_getting_started_Quickstart_audit_log.png create mode 100644 docs/assets/img/guides_getting_started_Quickstart_review_logs.png diff --git a/docs/assets/img/guides_getting_started_Quickstart_API_keys.png b/docs/assets/img/guides_getting_started_Quickstart_API_keys.png new file mode 100644 index 0000000000000000000000000000000000000000..dd7081827e5e2b9513c6f5b55ad7110884f83b53 GIT binary patch literal 41024 zcmeEuXIN9))-Ecd2sTgsHu^0g5#59tp{q zJ~9Q)k=@afQ&Iw-T9&TX*3PiUP`4rf%hliq$|s5jFfuYaR?`0wB~6weWMoI>?X>mX z^wm_wEul`l7FN(l*1TR$Pe}J6lk^e?hfdaR7T3L;9Gzj}UQ*1zt`G;uq@Veium8Hl z%|VJ;U+uwlIjF1kbx~e^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M&m9M!2 zYS{HrntOhR;|Lj1p25g{w@vi-G(F~K#xmwc?gy=wa4e*kOuH532< literal 0 HcmV?d00001 diff --git a/docs/assets/img/guides_getting_started_Quickstart_audit_log.png b/docs/assets/img/guides_getting_started_Quickstart_audit_log.png new file mode 100644 index 0000000000000000000000000000000000000000..882d969a0323e19752c07c6b626c9e92f9940ed9 GIT binary patch literal 388646 zcmbSz1ymf_wl;JiKnPAC1b2tv?%u)OCAbB5hhV`yI0X0Lt_kk$65I*y@E4i6cQWtI zTkF4<)!kKHRp(TleYSl2+ouVZl@>#I@#X~t1O$SFxUf6~1Ux?k1hfh4bKuC^2yG(> zh?jz``ZJEvK;dVIj zF@?ivbBPOLB;2lZRa5bqH@BP*2`h;=11pEWfa{AMe(Vtl+-+-@>-Wm`_E6r2U+>*q zoNx&$E# zhc{qX@F_B6*YdgSv0T-kMXrU+_|mljW`vY&g>n%kq(?K$zZBRfS%nvY7PPt4wib8h@Q%)!`+6?Y3?yG{88(~Hph>*SXZe( z`eRq$=F3w@CS&=!mqh{#)ZmCvUsd>3B*B&iy!WxuqzF>7Gg$#m?yLh?BmOhN!w4?} zXOLHQ%zAYVL&ITuN&R~dV!Rw{g` zvbop7Ozx92;gw3dLUGP;{-yYeB#07O1N{XWF`;tc3Ievw88GsK?6Tr6>Jkaqgu9Xj_LFp8=i!8qW3)jR zjC3=7haNrt#D4t6;)7}x5uQ6`5QGIX>}&oP=A56QDtx|X)s|x}QM&pCYR~&|i(ZnzQJHdMbhS=AVRhaIq0xa+_r0uq5sI}6PT2BM z8#mo|6z`?*``Fy_w~Qb6@hgS{Ew6^-XFwKwj?cM#Qon`khI#u`>q@C|IVuJODo^WQ z@4h+1ppGDi*@b=lVfC}Ok1_E`acg4jOk`Ar;4_t**s}|gW9HzuOhw-9zB*8le#EOB z;kxWx9E}hJw=ERfI#%!3ml1?(@448HkRaUEpFe+&=(W|M4l%O_S^JoIl!Acf$*Bm* z?iNHIhfc+==}6dC3x#mV?4kQ|zy~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+n+gA0%lt zOM|w0;!Q8H8H9cror#0cFL2&{y^geA8mDsykXS2j2veQ6#>O^_^Q6+DBz6vID_>~v z)YK6eg{qmH0aL5#hGB-(la&A9fxd6Ho72V<8vH;>))A&__5uu$oatPBKhT08IV%cx zm^eJCngk89we^M_U?M%9+M42Ug=fl|tFDOxfJP=uM!z%m7tv?9MxggkKG~_g&@P!k2w!C1vRq z?H7o{U;e$n^wz&N0$$u9S8bV@etRP-957X-H#c_sERV-~lG)bUDhvB?rUo%KI$9wK zswDyrgc&A$;vYs#kdK}>c=uy6u1jK>#Ib!KxK2^N=9Pk!fi|~b^0%teIvI?83CcF4 zzQej;-#R3-|99(8K{9drkE8QN{f1CH6ntJO{j|wsqGVQRLxl0^%Ez9SPIpq}>f~mz z@?<|@XI}(k3x%5BwHT?LXuq4c5chDI#`yei**y$C>LD$+9lT}2;*{HJA`rC!UiBLp z$cGrH&9yT0w!Imoh_eD6?0x~m_+GH4JoXB>JtOgv6q6rlVaFx2?8-R5DxYeFzetR- zgW`Fwzaw30w>9SfhEWJ;EzwJSz0Ixq-=s;SK?BpvmY{!bx=0dN8CLB=Yc|IEjFqCP zIVD$XDM`>JsM0izTL2dn`itiC$QFOyl634Y(in2qPZ@jT)S~8npWKDdVXr1T6W|BKudDiSV%3=-<%jrwmj1xBro66$*At0HN5M&hD zjAM(;Bb0u)Q2!fh@9jQ!Gq=r4h)GpOtQ!B|>ACyYFUZFm+g(f|VPMMk80x zS*Vw0fV4_QdB?cml*q6IQigt}vM(sfek=gA<48zXB0AQN-&7U*&n9P43WZI%avneO z#rUh8a(fwush;jF#7m;$nb@-ZA9Jcd61auCt~C~p#>clQD{>=~gPNryzI~T!ulw_V zu~M44#6XW&-m2tTRK5_ipN@UURf_rIO|({%X_~T OxK4Tad`))`|MoxE`e3*K literal 0 HcmV?d00001 diff --git a/docs/assets/img/guides_getting_started_Quickstart_review_logs.png b/docs/assets/img/guides_getting_started_Quickstart_review_logs.png new file mode 100644 index 0000000000000000000000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0)2VP4dJpWE6B#^c+xE_?Bd_RbM} zM|aRgiU7HCiqIVCyS2)?^m*ln5qZH;nnKs3t`}}rwXLBeA!IneAK8CaKf(9KVzU?e z0Ay5aRLLf%XTX`jA;;Y+)*yPqwL@T`l(*Wc;95IA!z#2S>g>&Lhw23NAy8>DYzgl5 z*StrV@jVG=+~UmIY@t9aw^F$RbPU>4JRLaF Date: Thu, 12 Oct 2023 16:04:43 +0200 Subject: [PATCH 022/108] Update Quickstart.md Updating images for starters --- docs/guides/getting_started/Quickstart.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 795526996..0f6e4bb2e 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -24,15 +24,15 @@ After you create your account, you get access to the Sandbox dashboard. Sandbox Type **BLCKFRDY** in the search bar and Voucherify will **redirect** you to the voucher page, which displays the basic information about the discount it carries. Let’s redeem the code with the API. - -![Voucherify Dashboard](https://files.readme.io/fcb7572-voucher_dashboard.png "Voucher Dashboard") + +![Voucherify Dashboard](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/5b1f45e537c0832f2f125424d0eb13a5ea1b1e49/docs/assets/img/guides_getting_started_Quickstart_join_the_dashboard.png) ## Get your API keys The Sandbox Project Dashboard is already showing your default API keys for the Sandbox project. You can also navigate to Project Settings to find the Authentication section. - -![Application Keys](https://files.readme.io/9003954-application-keys.png "Application Keys") + +![Application Keys](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_API_keys.png) ## Make a test API request @@ -184,15 +184,14 @@ Because BLCKFRDY doesn’t have any redemption limits, you can use it multiple t Every redemption can be [listed](ref:list-redemptions) with the API or in the dashboard. When you go to the voucher view, in “Recent changes”, you’ll see operations performed on the object. You can switch to the REDEMPTIONS HISTORY tab to track all redemptions. - + [block:image] { "images": [ { "image": [ - "https://files.readme.io/8bc30bc-recent_changes.png", - "recent_changes.png", + ["https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_review_logs.png], 1004 ], "sizing": "80" @@ -203,8 +202,8 @@ Every redemption can be [listed](ref:list-redemptions) with the API or in the da To monitor and filter the list of all API calls for your project, you can go to the [Audit log](https://app.voucherify.io/#/app/core/logs): - -![Audit Log](https://files.readme.io/1a4682c-audit_log.png "Audit Log") + +![Audit Log](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_audit_log.png) ## Test promo scenarios with "Hot Beans" demo store From c21dde07c1562eec9b5f5ea7ce45c9d278a1ef59 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:51:40 +0200 Subject: [PATCH 023/108] done --- Changelog.md | 26 +++ reference/OpenAPI.json | 432 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 451 insertions(+), 7 deletions(-) diff --git a/Changelog.md b/Changelog.md index 7418bcfe8..d9fd52e62 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,31 @@ # Changelog +## 20231012 + +#### New schemas +- PromotionsStacksListInCampaignResponseBody +- PromotionsStacksListResponseBody +- PromotionsStacksListRequestQuery +- PromotionsStacksGetResponseBody +- PromotionsStacksUpdateRequestBody +- PromotionsStacksUpdateResponseBody +- PromotionsStacksCreateInCampaignRequestBody +- PromotionsStacksCreateInCampaignResponseBody +- PromotionStackBase +- PromotionStack + +- GET /v1/promotions/{campaignId}/stacks + - new response schema `PromotionsStacksListInCampaignResponseBody` (old `3_res_list_promotion_stacks`) +- POST /v1/promotions/{campaignId}/stacks + - new request schema `PromotionsStacksCreateInCampaignRequestBody` (old `3_req_create_promotion_stack`) + - new response schema `PromotionsStacksCreateInCampaignResponseBody` (old `3_obj_promotion_stack_object`) +- GET /v1/promotions/{campaignId}/stacks/{stackId} + - new response schema `PromotionsStacksGetResponseBody` (old `3_obj_promotion_stack_object`) +- PUT /v1/promotions/{campaignId}/stacks/{stackId} + - new request schema `PromotionsStacksUpdateRequestBody` (old `3_req_create_promotion_stack`) + - new response schema `PromotionsStacksUpdateResponseBody` (old `3_obj_promotion_stack_object`) +- GET /v1/promotions/stacks + - new response schema `PromotionsStacksListResponseBody` (old `3_res_list_promotion_stacks`) ## 20231009 diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 470f57629..8fb5ad712 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39240,6 +39240,424 @@ } } }, + "PromotionsStacksListInCampaignResponseBody": { + "title": "Promotions Stacks List In Campaign Response Body", + "x-stoplight": { + "id": "4vg6isqaq6snd" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of promotion stack objects." + }, + "data": { + "type": "array", + "description": "Contains array of promotion stack objects.", + "items": { + "$ref": "#/components/schemas/PromotionStack" + } + }, + "total": { + "type": "integer", + "minimum": 0, + "description": "Total number of promotion stacks." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "PromotionsStacksListResponseBody": { + "title": "Promotions Stacks List Response Body", + "x-stoplight": { + "id": "xulqc9a55rqq1" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of promotion stack objects." + }, + "data": { + "type": "array", + "description": "Contains array of promotion stack objects.", + "items": { + "$ref": "#/components/schemas/PromotionStack" + } + }, + "total": { + "type": "integer", + "minimum": 0, + "description": "Total number of promotion stacks." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "PromotionsStacksListRequestQuery": { + "title": "Promotions Stacks List Request Query", + "x-stoplight": { + "id": "tlxava3tsdz67" + }, + "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", + "name", + "-name" + ], + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + }, + "created_at": { + "type": "object", + "description": "A filter on the list based on the object created_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [created_at][before]=2017-09-08T13:52:18.227Z", + "properties": { + "before": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time before the voucher was created in ISO 8601 format." + }, + "after": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time after the voucher was created in ISO 8601 format." + } + } + }, + "updated_at": { + "type": "object", + "description": "A filter on the list based on the object updated_at field. The value is a dictionary with the following options: before, after. A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16). An example: [updated_at][before]=2017-09-08T13:52:18.227Z", + "properties": { + "before": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time before the voucher was updated in ISO 8601 format." + }, + "after": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time after the voucher was updated in ISO 8601 format." + } + } + } + } + }, + "PromotionsStacksGetResponseBody": { + "$ref": "#/components/schemas/PromotionStack", + "x-stoplight": { + "id": "yo10kdxqlepqn" + }, + "title": "Promotions Stacks Get Response Body" + }, + "PromotionsStacksUpdateRequestBody": { + "title": "Promotions Stacks Update Request Body", + "x-stoplight": { + "id": "8jlymzh3ddocw" + }, + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "tiers": { + "type": "object", + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" + } + }, + "hierarchy_mode": { + "type": "string", + "enum": [ + "MANUAL" + ], + "description": "Category hierarchy." + } + } + }, + "category_id": { + "type": "string", + "description": "Promotion stack category ID." + } + } + }, + "PromotionsStacksUpdateResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/PromotionStackBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion stack ID." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." + }, + "campaign_id": { + "type": "string", + "description": "Promotion stack's parent campaign's unique ID." + }, + "object": { + "type": "string", + "enum": [ + "promotion_stack" + ], + "description": "The type of object represented by JSON. " + }, + "category_id": { + "type": [ + "string", + "null" + ], + "description": "Promotion stack category ID." + }, + "categories": { + "type": "array", + "description": "Details about the category assigned to the promotion stack.", + "items": { + "$ref": "#/components/schemas/PromotionStackBase" + } + } + }, + "required": [ + "id", + "created_at", + "updated_at", + "campaign_id", + "object", + "category_id", + "categories" + ] + } + ] + }, + "PromotionsStacksCreateInCampaignRequestBody": { + "allOf": [ + { + "$ref": "#/components/schemas/PromotionStackBase" + }, + { + "type": "object", + "properties": { + "category_id": { + "type": "string", + "description": "Promotion stack category ID." + } + } + } + ] + }, + "PromotionsStacksCreateInCampaignResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/PromotionStackBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion stack ID." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." + }, + "campaign_id": { + "type": "string", + "description": "Promotion stack's parent campaign's unique ID." + }, + "object": { + "type": "string", + "enum": [ + "promotion_stack" + ], + "description": "The type of object represented by JSON." + }, + "category_id": { + "type": [ + "string", + "null" + ], + "description": "Promotion stack category ID." + }, + "categories": { + "type": "array", + "description": "Details about the category assigned to the promotion stack.", + "items": { + "$ref": "#/components/schemas/PromotionStackBase" + } + } + }, + "required": [ + "id", + "created_at", + "campaign_id", + "object", + "category_id", + "categories" + ] + } + ] + }, + "PromotionStackBase": { + "title": "Promotion Stack Base", + "x-stoplight": { + "id": "m7vtpwtnuvjpe" + }, + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "tiers": { + "type": "object", + "required": [ + "ids" + ], + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "minItems": 1, + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" + } + }, + "hierarchy_mode": { + "type": "string", + "enum": [ + "MANUAL" + ] + } + } + } + }, + "required": [ + "name", + "tiers" + ] + }, + "PromotionStack": { + "allOf": [ + { + "$ref": "#/components/schemas/PromotionStackBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion stack ID." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." + }, + "campaign_id": { + "type": "string", + "description": "Promotion stack's parent campaign's unique ID." + }, + "object": { + "type": "string", + "enum": [ + "promotion_stack" + ], + "description": "The type of object represented by JSON. " + }, + "category_id": { + "type": [ + "string", + "null" + ], + "description": "Promotion stack category ID." + }, + "categories": { + "type": "array", + "description": "Details about the category assigned to the promotion stack.", + "items": { + "$ref": "#/components/schemas/Category" + } + } + }, + "required": [ + "id", + "created_at", + "campaign_id", + "object", + "category_id", + "categories" + ] + } + ] + }, "LoyaltiesGetEarningRuleResponseBody": { "allOf": [ { @@ -51998,7 +52416,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" + "$ref": "#/components/schemas/PromotionsStacksListResponseBody" }, "examples": { "Example": { @@ -52184,7 +52602,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" + "$ref": "#/components/schemas/PromotionsStacksListInCampaignResponseBody" }, "examples": { "Example": { @@ -52249,7 +52667,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" + "$ref": "#/components/schemas/PromotionsStacksCreateInCampaignRequestBody" }, "examples": { "Example": { @@ -52275,7 +52693,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" + "$ref": "#/components/schemas/PromotionsStacksCreateInCampaignResponseBody" }, "examples": { "Example": { @@ -52379,7 +52797,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" + "$ref": "#/components/schemas/PromotionsStacksGetResponseBody" }, "examples": { "Example": { @@ -52457,7 +52875,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" + "$ref": "#/components/schemas/PromotionsStacksUpdateRequestBody" }, "examples": { "Example": { @@ -52482,7 +52900,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" + "$ref": "#/components/schemas/PromotionsStacksUpdateResponseBody" }, "examples": { "Example": { From 6b6e60a3d562a131ffc58daabbedf82c8aa8486a Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:58:22 +0200 Subject: [PATCH 024/108] Update Changelog.md --- Changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 28ca904d6..f6b47a233 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,6 @@ # Changelog -## 20231012 +## 20231012 - Promotions Stacks #### New schemas - PromotionsStacksListInCampaignResponseBody @@ -591,4 +591,4 @@ The following endpoints in the OpenAPI document found in the `paths` object are `/v1/category-object` `/v1/metadata-schema-object` `/v1/location-object` -`/v1/qualification-object` \ No newline at end of file +`/v1/qualification-object` 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 025/108] 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 026/108] 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 027/108] 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 028/108] 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 029/108] 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 030/108] 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 031/108] 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 032/108] 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 033/108] 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 6bff49d23a1714c629f837e7f0eb084e908b1d2b Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:49:36 +0200 Subject: [PATCH 034/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 232 ++++++++++++++-------- 1 file changed, 148 insertions(+), 84 deletions(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 0f6e4bb2e..5bb7abeaf 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -76,105 +76,169 @@ Voucherify should reply with the [redemption](ref:get-redemption) details as in ```json 200 OK { - "id": "r_1utfsnmdnq9KMh4xEKjcZT3m", - "object": "redemption", - "date": "2022-02-16T07:39:21.575Z", - "customer_id": null, - "tracking_id": null, - "metadata": null, - "result": "SUCCESS", + "redemptions": [ + { + "id": "r_0dafc21888c79c80bf", + "customer_id": "cust_ANjd4MFsUPXDoHeoCQXmqgCJ", + "tracking_id": "track_9xvOJH7gshn2dlEaRSUyeQ==", + "date": "2023-10-16T10:47:11.651Z", + "order": { + "id": "ord_OdtFaTU2aw6fNCzy6XvXYs51", + "source_id": null, + "status": "PAID", + "customer_id": "cust_ANjd4MFsUPXDoHeoCQXmqgCJ", + "referrer_id": null, + "amount": 12000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "total_discount_amount": 1000, + "total_applied_discount_amount": 1000, + "total_amount": 11000, + "items": [ + { + "object": "order_item", + "source_id": "t-shirt_white", + "related_object": "product", + "quantity": 1, + "amount": 2500, + "price": 2500 + }, + { + "object": "order_item", + "source_id": "t-shirt_red", + "related_object": "product", + "quantity": 2, + "amount": 3000, + "price": 1500 + }, + { + "object": "order_item", + "source_id": "jeans_blue", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500 + } + ], + "metadata": {}, + "object": "order" + }, + "customer": { + "id": "cust_ANjd4MFsUPXDoHeoCQXmqgCJ", + "name": "Jack Jack", + "email": "maciej.krzak+Jack@voucherify.io", + "source_id": "16102023", + "metadata": { + "metadata_key": "metadata_value", + "customer_location": "geo:37.786971,-122.399677" + }, + "object": "customer" + }, + "result": "SUCCESS", + "voucher": { + "id": "v_hvY4FNDjL1LYpKDvAtc4I7uXT9DouOv8", + "code": "BLCKFRDY", + "discount": { + "type": "AMOUNT", + "amount_off": 1000 + }, + "type": "DISCOUNT_VOUCHER", + "campaign": null, + "campaign_id": null, + "is_referral_code": false, + "holder_id": "cust_iXUTMbFO3QdLFHH8WLKBLyA1", + "created_at": "2023-03-01T10:28:04.759Z", + "object": "voucher" + }, + "object": "redemption" + } + ], "order": { - "id": "ord_0r32g8iQNp0WA84fBK814RgG", + "id": "ord_OdtFaTU2aw6fNCzy6XvXYs51", "source_id": null, - "created_at": "2022-02-16T07:39:21.546Z", + "created_at": "2023-10-16T10:47:11.616Z", "updated_at": null, "status": "PAID", - "amount": 20000, + "amount": 12000, "discount_amount": 1000, "total_discount_amount": 1000, - "total_amount": 19000, + "total_amount": 11000, "applied_discount_amount": 1000, "total_applied_discount_amount": 1000, - "customer_id": null, + "items": [ + { + "object": "order_item", + "source_id": "t-shirt_white", + "related_object": "product", + "quantity": 1, + "amount": 2500, + "price": 2500, + "subtotal_amount": 2500, + "product": { + "metadata": { + "color": "white", + "any_key": "any_value", + "category": "t-shirt", + "condition": "NEW", + "manufacturing_date_time": "2021-08-13T08:00:00.000Z" + } + } + }, + { + "object": "order_item", + "source_id": "t-shirt_red", + "related_object": "product", + "quantity": 2, + "amount": 3000, + "price": 1500, + "subtotal_amount": 3000, + "product": { + "metadata": { + "color": "red", + "any_key": "any_value", + "category": "t-shirt", + "condition": "NEW", + "manufacturing_date_time": "2021-08-13T08:00:00.000Z" + } + } + }, + { + "object": "order_item", + "source_id": "jeans_blue", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500, + "product": { + "metadata": { + "color": "blue", + "any_key": "any_value", + "category": "jeans", + "condition": "NEW", + "manufacturing_date_time": "2021-08-13T08:00:00.000Z" + } + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_ANjd4MFsUPXDoHeoCQXmqgCJ", + "object": "customer" + }, + "customer_id": "cust_ANjd4MFsUPXDoHeoCQXmqgCJ", "referrer_id": null, "object": "order", "redemptions": { - "r_1utfsnmdnq9KMh4xEKjcZT3m": { - "date": "2022-02-16T07:39:21.575Z", + "r_0dafc21888c79c80bf": { + "date": "2023-10-16T10:47:11.651Z", "related_object_type": "voucher", - "related_object_id": "v_MMn7nc75rwUjdPnfl4X6NtCAK5MDNgNk" + "related_object_id": "v_hvY4FNDjL1LYpKDvAtc4I7uXT9DouOv8" } } }, - "customer": null, - "related_object_type": "voucher", - "related_object_id": "v_MMn7nc75rwUjdPnfl4X6NtCAK5MDNgNk", - "voucher": { - "id": "v_MMn7nc75rwUjdPnfl4X6NtCAK5MDNgNk", - "code": "BLCKFRDY", - "campaign": null, - "campaign_id": null, - "category": "showcase", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 1000 - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": { - "name": "Black Friday Coupon" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1/FEz2OO26+KPxsV7dn/EFfzLbdGNArC+25Y8CX1j+beNmaxFcbOTVHnHHvmHzc50VdE+D0Cimz+7ZMJC92PSvshoCDBEnu5T10TOKozvVTaZn5O1NfaR5q+3zDnWRoFhfCcg/TilTQng==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FFEz2OO26%2BKPxsV7dn%2FEFfzLbdGNArC%2B25Y8CX1j%2BbeNmaxFcbOTVHnHHvmHzc50VdE%2BD0Cimz%2B7ZMJC92PSvshoCDBEnu5T10TOKozvVTaZn5O1NfaR5q%2B3zDnWRoFhfCcg%2FTilTQng%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+Pgk0VxfAp5EbUgyoJxdy9Dcnnt4YYF64Kdk4o3GXzc3NeOvi6wFL27I2/j8bbMm8xZxETc6C0xgV9DcDUarJhpYjA4k+EhSu0dvoqrkSuGo1Pk+yFAeu7dieakoIR2xv+5B2ebqXstQ==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BPgk0VxfAp5EbUgyoJxdy9Dcnnt4YYF64Kdk4o3GXzc3NeOvi6wFL27I2%2Fj8bbMm8xZxETc6C0xgV9DcDUarJhpYjA4k%2BEhSu0dvoqrkSuGo1Pk%2ByFAeu7dieakoIR2xv%2B5B2ebqXstQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-16T06:58:29.207Z", - "updated_at": "2022-02-16T07:39:21.576Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "object": "list", - "url": "/v1/vouchers/BLCKFRDY/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/BLCKFRDY/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - } + "inapplicable_redeemables": [], + "skipped_redeemables": [] } ``` From 33d6ec8c0abfd12f6432cffd600ef4593e4c8871 Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:12:33 +0200 Subject: [PATCH 035/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 5bb7abeaf..90703b250 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -43,7 +43,7 @@ Within the Sandbox, you get 100 API calls per hour. Visit [Limits](doc:limits) t 3. Calculating and returning the discount value. 4. Marking the code as used. -**Note:** while calling the [redemption endpoint](ref:redeem-voucher) is enough to satisfy a basic promo code flow, it's useful to add [validation](ref:validate-voucher) to the flow every time the promo code or cart changes. Validation performs 1-3 points, but it doesn't mark the code as used. +**Note:** while calling the [redemption endpoint](ref:redeem-stacked-discounts) is enough to satisfy a basic promo code flow, it's useful to add [validation](ref:validate-voucher) to the flow every time the promo code or cart changes. Validation performs 1-3 points, but it doesn't mark the code as used. **Note:** Voucherify API supports the redemption of a single promo code and [Stackable discounts API](doc:manage-stackable-discounts), which lets you redeem up to 5 incentives per call. Before integrating Voucherify, choose which redemption endpoint you prefer to use. From 729e9034a446091a297acfeb0cb76c398fc126b5 Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:17:03 +0200 Subject: [PATCH 036/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 90703b250..6f6ded9ac 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -43,7 +43,7 @@ Within the Sandbox, you get 100 API calls per hour. Visit [Limits](doc:limits) t 3. Calculating and returning the discount value. 4. Marking the code as used. -**Note:** while calling the [redemption endpoint](ref:redeem-stacked-discounts) is enough to satisfy a basic promo code flow, it's useful to add [validation](ref:validate-voucher) to the flow every time the promo code or cart changes. Validation performs 1-3 points, but it doesn't mark the code as used. +**Note:** while calling the [redemption endpoint](ref:redeem-stacked-discounts) is enough to satisfy a basic promo code flow, it's useful to add [validation](ref:validate-stacked-discounts) to the flow every time the promo code or cart changes. Validation performs 1-3 points, but it doesn't mark the code as used. **Note:** Voucherify API supports the redemption of a single promo code and [Stackable discounts API](doc:manage-stackable-discounts), which lets you redeem up to 5 incentives per call. Before integrating Voucherify, choose which redemption endpoint you prefer to use. From 3f1944ef45f9ba592aff333ccb48f092c239dc79 Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:34:52 +0200 Subject: [PATCH 037/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 6f6ded9ac..168b33ce4 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -36,7 +36,7 @@ The Sandbox Project Dashboard is already showing your default API keys for the S ## Make a test API request -Within the Sandbox, you get 100 API calls per hour. Visit [Limits](doc:limits) to learn how to monitor your usage. With the first API request, we’ll [redeem](doc:redeem-voucher) our coupon. This function is essential to Voucherify workflow as it takes care of: +Within the Sandbox, you get 100 API calls per hour. Visit [Limits](doc:limits) to learn how to monitor your usage. With the first API request, we’ll [redeem](doc:redemption) our coupon. This function is essential to Voucherify workflow as it takes care of: 1. Checking if the code is recognizable with your account. 2. Validating if it satisfies the business rules. From f531805b093c8724ce0011fa83481a985f15955f Mon Sep 17 00:00:00 2001 From: MaciekVoucherify <130568368+MaciekVoucherify@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:41:48 +0200 Subject: [PATCH 038/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index 168b33ce4..c3c7fedff 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -58,7 +58,7 @@ curl -X POST \ -H "X-App-Id: ID" \ -H "X-App-Token: SECRET KEY" \ -H "Content-Type: application/json" \ --d '{"order": {"amount": 20000} }' "https://api.voucherify.io/v1/vouchers/BLCKFRDY/redemption" +-d '{"order": {"amount": 12000} }' "https://api.voucherify.io/v1/vouchers/BLCKFRDY/redemption" ``` ```javascript JavaScript const { VoucherifyServerSide } = require('@voucherify/sdk') @@ -69,7 +69,7 @@ const client = VoucherifyServerSide({ // apiUrl: 'https://.api.voucherify.io' }) -client.redemptions.redeem("BLCKFRDY", {"order" : {"amount": 20000}}).then(console.log) +client.redemptions.redeem("BLCKFRDY", {"order" : {"amount": 12000}}).then(console.log) ``` Voucherify should reply with the [redemption](ref:get-redemption) details as in the screenshot below. If Voucherify doesn’t reply with a 20x status, check the [error code](ref:errors) to find the reason. From 38772222ce4e3592229e8f46d81b222386767f40 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:04:01 +0200 Subject: [PATCH 039/108] in progress --- .../Locking-Validation-Session.md | 2 +- .../campaign_recipes/Loyalty Program.md | 2 +- .../campaign_recipes/Prepaid-Gift-Cards.md | 2 +- .../guides/campaign_recipes/Qualifications.md | 2 +- .../campaign_recipes/Referral-Program.md | 2 +- .../Stacking-Promotion-Tiers.md | 2 +- .../Transfer-Loyalty-Points.md | 2 +- .../discounts_recipes/Discount-Effects.md | 2 +- .../Free-Shipping-Discount.md | 2 +- .../Give-Items-For-Free-Unit-Discount.md | 2 +- .../Product-Specific-Discounts.md | 2 +- .../Stackable-Discounts-API.md | 2 +- .../CSV-Export-With-API.md | 2 +- .../distributions_recipes/Geofencing.md | 2 +- .../Import-Legacy-Codes.md | 2 +- .../Messaging-Automation.md | 2 +- package.json | 5 +- scripts/index.ts | 108 ++++++++++++++++++ ...-order.ts => readme-fix-reference-docs.ts} | 84 +++++++------- 19 files changed, 168 insertions(+), 61 deletions(-) create mode 100644 scripts/index.ts rename scripts/{readme-fix-docs-order.ts => readme-fix-reference-docs.ts} (76%) diff --git a/docs/guides/campaign_recipes/Locking-Validation-Session.md b/docs/guides/campaign_recipes/Locking-Validation-Session.md index 687dab4d3..40ec56eb6 100644 --- a/docs/guides/campaign_recipes/Locking-Validation-Session.md +++ b/docs/guides/campaign_recipes/Locking-Validation-Session.md @@ -1,7 +1,7 @@ --- title: Locking Validation Session excerpt: Temporary lock the voucher's usage until redemption is successful. -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: locking-validation-session type: basic hidden: false diff --git a/docs/guides/campaign_recipes/Loyalty Program.md b/docs/guides/campaign_recipes/Loyalty Program.md index c53b48cbe..264a10571 100644 --- a/docs/guides/campaign_recipes/Loyalty Program.md +++ b/docs/guides/campaign_recipes/Loyalty Program.md @@ -1,7 +1,7 @@ --- title: Loyalty Program excerpt: null -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: loyalty-program type: basic hidden: false diff --git a/docs/guides/campaign_recipes/Prepaid-Gift-Cards.md b/docs/guides/campaign_recipes/Prepaid-Gift-Cards.md index 0ebbf105f..58682b91e 100644 --- a/docs/guides/campaign_recipes/Prepaid-Gift-Cards.md +++ b/docs/guides/campaign_recipes/Prepaid-Gift-Cards.md @@ -1,7 +1,7 @@ --- title: Prepaid Gift Cards excerpt: null -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: prepaid-gift-cards type: basic hidden: false diff --git a/docs/guides/campaign_recipes/Qualifications.md b/docs/guides/campaign_recipes/Qualifications.md index 518e12f26..c40da5f11 100644 --- a/docs/guides/campaign_recipes/Qualifications.md +++ b/docs/guides/campaign_recipes/Qualifications.md @@ -1,7 +1,7 @@ --- title: Qualification - Checking eligibility excerpt: null -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: checking-eligibility type: basic hidden: false diff --git a/docs/guides/campaign_recipes/Referral-Program.md b/docs/guides/campaign_recipes/Referral-Program.md index 8fa21ede1..98c677d71 100644 --- a/docs/guides/campaign_recipes/Referral-Program.md +++ b/docs/guides/campaign_recipes/Referral-Program.md @@ -1,7 +1,7 @@ --- title: Referral Program excerpt: null -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: referral-program type: link hidden: false diff --git a/docs/guides/campaign_recipes/Stacking-Promotion-Tiers.md b/docs/guides/campaign_recipes/Stacking-Promotion-Tiers.md index b1edb1464..e19939efa 100644 --- a/docs/guides/campaign_recipes/Stacking-Promotion-Tiers.md +++ b/docs/guides/campaign_recipes/Stacking-Promotion-Tiers.md @@ -1,7 +1,7 @@ --- title: Stacking Promotion Tiers excerpt: 'In this tutorial, you will learn how to validate, redeem, and manage promotion stacks using API.' -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: stacking-promotion-tiers type: basic hidden: false diff --git a/docs/guides/campaign_recipes/Transfer-Loyalty-Points.md b/docs/guides/campaign_recipes/Transfer-Loyalty-Points.md index 937388a41..44238cbc0 100644 --- a/docs/guides/campaign_recipes/Transfer-Loyalty-Points.md +++ b/docs/guides/campaign_recipes/Transfer-Loyalty-Points.md @@ -1,7 +1,7 @@ --- title: Transfer Loyalty Points excerpt: See how to transfer points between loyalty cards. -categorySlug: campaigns-1 +categorySlug: campaigns-recipes slug: transfer-loyalty-points type: basic hidden: false diff --git a/docs/guides/discounts_recipes/Discount-Effects.md b/docs/guides/discounts_recipes/Discount-Effects.md index 6529481fd..367f4833c 100644 --- a/docs/guides/discounts_recipes/Discount-Effects.md +++ b/docs/guides/discounts_recipes/Discount-Effects.md @@ -1,7 +1,7 @@ --- title: Discount Effects excerpt: The discount effect defines how the discount will be applied to the customer's cart. In this article, we're going to show you how different effects work with discounts. -categorySlug: discounts +categorySlug: discounts-recipes slug: discount-effects type: basic hidden: false diff --git a/docs/guides/discounts_recipes/Free-Shipping-Discount.md b/docs/guides/discounts_recipes/Free-Shipping-Discount.md index df908f3a8..094080735 100644 --- a/docs/guides/discounts_recipes/Free-Shipping-Discount.md +++ b/docs/guides/discounts_recipes/Free-Shipping-Discount.md @@ -1,7 +1,7 @@ --- title: Free shipping disount excerpt: How to use free shipping discounts? -categorySlug: discounts +categorySlug: discounts-recipes slug: free-shipping-discount type: basic hidden: false diff --git a/docs/guides/discounts_recipes/Give-Items-For-Free-Unit-Discount.md b/docs/guides/discounts_recipes/Give-Items-For-Free-Unit-Discount.md index c2e9ecb11..862c5c661 100644 --- a/docs/guides/discounts_recipes/Give-Items-For-Free-Unit-Discount.md +++ b/docs/guides/discounts_recipes/Give-Items-For-Free-Unit-Discount.md @@ -1,7 +1,7 @@ --- title: Give item(s) for free - unit discount excerpt: How to add free items to customers' orders? -categorySlug: discounts +categorySlug: discounts-recipes slug: give-item-for-free-unit-discount type: basic hidden: false diff --git a/docs/guides/discounts_recipes/Product-Specific-Discounts.md b/docs/guides/discounts_recipes/Product-Specific-Discounts.md index 002893d6e..71bdcdeea 100644 --- a/docs/guides/discounts_recipes/Product-Specific-Discounts.md +++ b/docs/guides/discounts_recipes/Product-Specific-Discounts.md @@ -1,7 +1,7 @@ --- title: Product-specific discounts excerpt: A recipe for using *applicable_to* validation rule -categorySlug: discounts +categorySlug: discounts-recipes slug: discount-for-particular-product type: basic hidden: false diff --git a/docs/guides/discounts_recipes/Stackable-Discounts-API.md b/docs/guides/discounts_recipes/Stackable-Discounts-API.md index 6394c6ffd..083ce7f69 100644 --- a/docs/guides/discounts_recipes/Stackable-Discounts-API.md +++ b/docs/guides/discounts_recipes/Stackable-Discounts-API.md @@ -1,7 +1,7 @@ --- title: Stackable discounts API excerpt: -categorySlug: discounts +categorySlug: discounts-recipes slug: manage-stackable-discounts type: basic hidden: false diff --git a/docs/guides/distributions_recipes/CSV-Export-With-API.md b/docs/guides/distributions_recipes/CSV-Export-With-API.md index 4852bd75e..c96128a65 100644 --- a/docs/guides/distributions_recipes/CSV-Export-With-API.md +++ b/docs/guides/distributions_recipes/CSV-Export-With-API.md @@ -1,7 +1,7 @@ --- title: CSV export with API excerpt: null -categorySlug: distribution-1 +categorySlug: distributions-recipes slug: csv-export type: basic hidden: false diff --git a/docs/guides/distributions_recipes/Geofencing.md b/docs/guides/distributions_recipes/Geofencing.md index 13f7c5ddc..4deb1e3a6 100644 --- a/docs/guides/distributions_recipes/Geofencing.md +++ b/docs/guides/distributions_recipes/Geofencing.md @@ -1,7 +1,7 @@ --- title: Geofencing excerpt: -categorySlug: distribution-1 +categorySlug: distributions-recipes slug: geofencing type: link hidden: false diff --git a/docs/guides/distributions_recipes/Import-Legacy-Codes.md b/docs/guides/distributions_recipes/Import-Legacy-Codes.md index 07efe095d..ee3df7b3d 100644 --- a/docs/guides/distributions_recipes/Import-Legacy-Codes.md +++ b/docs/guides/distributions_recipes/Import-Legacy-Codes.md @@ -1,7 +1,7 @@ --- title: Import legacy codes excerpt: null -categorySlug: distribution-1 +categorySlug: distributions-recipes slug: import-codes type: basic hidden: false diff --git a/docs/guides/distributions_recipes/Messaging-Automation.md b/docs/guides/distributions_recipes/Messaging-Automation.md index 62ebde939..ed9f15c34 100644 --- a/docs/guides/distributions_recipes/Messaging-Automation.md +++ b/docs/guides/distributions_recipes/Messaging-Automation.md @@ -1,7 +1,7 @@ --- title: Messaging automation excerpt: How to set up an automatic promotion delivery for a dynamic customer segment? -categorySlug: distribution-1 +categorySlug: distributions-recipes slug: automatic-delivery type: basic hidden: false diff --git a/package.json b/package.json index 665b78342..b23047b4c 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,9 @@ "scripts": { "update-md-tables-in-doc": "ts-node ./scripts/update-md-tables-in-doc.ts", "build-md-tables-from-openapi": "ts-node ./scripts/build-md-tables-from-openapi.ts", - "readme-fix-docs-order": "ts-node ./scripts/readme-fix-docs-order.ts", - "remove-stoplight-tags-from-openapi": "ts-node ./scripts/remove-stoplight-tags-from-openapi.ts" + "readme-fix-reference-docs": "ts-node ./scripts/readme-fix-reference-docs.ts", + "remove-stoplight-tags-from-openapi": "ts-node ./scripts/remove-stoplight-tags-from-openapi.ts", + "all": "ts-node ./scripts/index.ts" }, "dependencies": { "dotenv": "^16.3.1", diff --git a/scripts/index.ts b/scripts/index.ts new file mode 100644 index 000000000..edf30cf11 --- /dev/null +++ b/scripts/index.ts @@ -0,0 +1,108 @@ +import * as fsPromises from "fs/promises"; +import path from "path"; +import dotenv from "dotenv"; +import minimist from "minimist"; + +dotenv.config(); +const { versionTag } = minimist(process.argv.slice(2)); + +const mainVersion = "v2018-08-01"; + +const listOfGuideCategories = [ + "Getting started", + "Development", + "Building blocks", + "Campaigns Recipes", + "Discounts Recipes", + "Distributions Recipes", + "More", +]; + +const listOfReferenceCategories = ["Introduction"]; + +const main = async () => { + if (!versionTag) { + console.log( + "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" + ); + return; + } + const version = `${mainVersion}-${versionTag}`; + //create fork + try { + const response = await fetch( + ` +https://dash.readme.com/api/v1/version`, + { + method: "POST", + headers: { + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + "content-type": "application/json", + accept: "application/json", + }, + body: JSON.stringify({ + is_beta: false, + is_stable: false, + is_hidden: true, + is_deprecated: false, + from: mainVersion, + version, + }), + } + ); + if (response.status !== 200) { + throw new Error(`Response status: ${response.status}`); + } + } catch (error) { + console.log(`Error while creating fork from ${mainVersion}`, error); + throw new Error(error); + } + const categoriesToDelete = await ( + await fetch( + `https://dash.readme.com/api/v1/categories?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).json(); + await asyncMap(categoriesToDelete, (category) => + deleteCategory(version, category.slug) + ); + // console.log(await categories.json()); + // // categories.push(...responseJSON.categories); + // // asyncMap(categories, (categoryId) => deleteCategory()); +}; + +const deleteCategory = async (version, slug) => { + await fetch(`https://dash.readme.com/api/v1/categories/${slug}`, { + method: "DELETE", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + accept: "application/json", + }, + }); +}; + +const createCategory = async (version, title) => { + const response = await fetch(`https://dash.readme.com/api/v1/categories`, { + method: "POST", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + "content-type": "application/json", + accept: "application/json", + }, + body: JSON.stringify({ title }), + }); +}; + +const asyncMap = (arr, asyncFn) => { + return Promise.all(arr.map(asyncFn)); +}; + +main(); diff --git a/scripts/readme-fix-docs-order.ts b/scripts/readme-fix-reference-docs.ts similarity index 76% rename from scripts/readme-fix-docs-order.ts rename to scripts/readme-fix-reference-docs.ts index 64e5926d3..ef6c0a1a8 100644 --- a/scripts/readme-fix-docs-order.ts +++ b/scripts/readme-fix-reference-docs.ts @@ -1,14 +1,45 @@ - -import * as fs from 'fs/promises' +import * as fsPromises from 'fs/promises' import path from 'path'; import dotenv from 'dotenv' import minimist from 'minimist'; -import { ok } from 'assert'; dotenv.config(); const { version } = minimist(process.argv.slice(2)); -const updateDoc = async ({ slug, order, pathToFile }) => { +const readmeFixReferenceDocs = async () => { + if (!version) { + console.log( + "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" + ); + return; + } + if (process.env.README_IO_AUTH?.length < 10) { + console.log("`README_IO_AUTH` was not provided in `.env` file :/"); + return; + } + const basePath = path.join(__dirname, "../docs"); + const pathsToFiles = await getFiles(basePath); + + const dataToProcess = []; + for (const pathToFile of pathsToFiles) { + const data = await fsPromises.readFile(pathToFile, { encoding: "utf8" }); + const slug = data.match(/slug: .*/)?.[0]?.split?.("slug: ")?.[1]; + const type = data.match(/type: .*/)?.[0]?.split?.("type: ")?.[1]; + const order = parseInt( + data.match(/order: .*/)?.[0]?.split?.("order: ")?.[1] + ); + if (!slug || isNaN(order)) { + throw new Error("Invalid slug or order in " + pathToFile); + } + dataToProcess.push({ slug, order, pathToFile, type }); + } + for (const chunk of chunkArray(dataToProcess, 10)) { + await asyncMap(chunk, updateDoc); + } + console.log("Done!"); +}; + +const updateDoc = async ({ slug, order, type, pathToFile }) => { const options = { method: "PUT", headers: { @@ -17,7 +48,7 @@ const updateDoc = async ({ slug, order, pathToFile }) => { "content-type": "application/json", accept: "application/json", }, - body: JSON.stringify({ order }), + body: JSON.stringify({ order, type }), }; try{ @@ -27,18 +58,18 @@ const updateDoc = async ({ slug, order, pathToFile }) => { ); const responseJSON = await response.json(); - + if (responseJSON.error) { console.log(`Error in json response from readme for ${slug}`, { responseJSON }); throw new Error(responseJSON.error); } - + if (order === responseJSON.order) { console.log(`Updated successfully ${pathToFile}!`); } else { console.log(`Not updated ${pathToFile}!`); } - + return responseJSON; }catch(error){ console.log(`Error when reqesting readme for ${slug}`, error); @@ -53,7 +84,7 @@ const chunkArray = (list, chunkSize) => const getFiles = async (path: string) => { const pathsToFiles: string[] = []; - const items = await fs.readdir(path, { + const items = await fsPromises.readdir(path, { withFileTypes: true, }); for (const item of items) { @@ -76,38 +107,5 @@ const asyncMap = (arr, asyncFn) => { }; -const readmeFixDocsOrder = async () => { - if (!version) { - console.log( - "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" - ); - return; - } - if (process.env.README_IO_AUTH?.length < 10) { - console.log("`README_IO_AUTH` was not provided in `.env` file :/"); - return; - } - const basePath = path.join(__dirname, "../docs"); - const pathsToFiles = await getFiles(basePath); - - const dataToProcess = []; - for (const pathToFile of pathsToFiles) { - const data = await fs.readFile(pathToFile, { encoding: "utf8" }); - const slug = data.match(/slug: .*/)?.[0]?.split?.("slug: ")?.[1]; - const order = parseInt( - data.match(/order: .*/)?.[0]?.split?.("order: ")?.[1] - ); - if (!slug || isNaN(order)) { - throw new Error("Invalid slug or order in " + pathToFile); - } - dataToProcess.push({ slug, order, pathToFile }); - } - for (const chunk of chunkArray(dataToProcess, 6)) { - await asyncMap(chunk, updateDoc); - } - console.log("Done!"); -}; - - -readmeFixDocsOrder() +readmeFixReferenceDocs() From 22d6fb18e223b8906c2c41ecfc800c9bdd819edc Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 16 Oct 2023 20:32:08 +0200 Subject: [PATCH 040/108] Update index.ts --- scripts/index.ts | 89 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 10 deletions(-) diff --git a/scripts/index.ts b/scripts/index.ts index edf30cf11..a22a79ffa 100644 --- a/scripts/index.ts +++ b/scripts/index.ts @@ -51,13 +51,65 @@ https://dash.readme.com/api/v1/version`, } ); if (response.status !== 200) { - throw new Error(`Response status: ${response.status}`); + throw new Error( + `Response status: ${response.status}, maybe this versionTag is already used?` + ); } + console.log(`FORK CREATED!`); } catch (error) { console.log(`Error while creating fork from ${mainVersion}`, error); throw new Error(error); } - const categoriesToDelete = await ( +}; + +const createNewVersion = + +const cleanProject = async (version) => { + const categoriesToDelete = await getAllCategories(version); + //delete all categories + await asyncMap( + categoriesToDelete, + async (category) => await deleteCategory(version, category.slug) + ); + console.log(`OLD CATEGORIES DELETED`); + //create categories + await asyncMap( + [...listOfGuideCategories, ...listOfReferenceCategories], + async (title) => await createCategory(version, title) + ); + console.log(`NEW CATEGORIES CREATED`); + const allCategories = await getAllCategories(version); + //update reference categories types + await asyncMap( + listOfReferenceCategories, + async (categoryTitle) => + await updateCategory( + version, + allCategories.find((category) => category.title === categoryTitle).slug, + { type: "reference" } + ) + ); + console.log(`REFERENCE CATEGORIES UPDATED`); + const allApiSpecifications = await getAllApiSpecifications(version); + await asyncMap(allApiSpecifications, deleteSpecification); + console.log(`API SPECIFICATIONS DELETED`); +}; + +const updateCategory = async (version, slug, data = {}) => { + await fetch(`https://dash.readme.com/api/v1/categories/${slug}`, { + method: "PUT", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + "content-type": "application/json", + accept: "application/json", + }, + body: JSON.stringify(data), + }); +}; + +const getAllCategories = async (version) => + await ( await fetch( `https://dash.readme.com/api/v1/categories?perPage=100&page=1`, { @@ -69,13 +121,6 @@ https://dash.readme.com/api/v1/version`, } ) ).json(); - await asyncMap(categoriesToDelete, (category) => - deleteCategory(version, category.slug) - ); - // console.log(await categories.json()); - // // categories.push(...responseJSON.categories); - // // asyncMap(categories, (categoryId) => deleteCategory()); -}; const deleteCategory = async (version, slug) => { await fetch(`https://dash.readme.com/api/v1/categories/${slug}`, { @@ -89,7 +134,7 @@ const deleteCategory = async (version, slug) => { }; const createCategory = async (version, title) => { - const response = await fetch(`https://dash.readme.com/api/v1/categories`, { + await fetch(`https://dash.readme.com/api/v1/categories`, { method: "POST", headers: { "x-readme-version": version, @@ -101,6 +146,30 @@ const createCategory = async (version, title) => { }); }; +const getAllApiSpecifications = async (version) => + await ( + await fetch( + `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).json(); + +const deleteSpecification = async (id) => { + await fetch(`https://dash.readme.com/api/v1/api-specification/${id}`, { + method: "DELETE", + headers: { + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + accept: "application/json", + }, + }); +}; + const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; From 8960194f456d87febd621e6d49ea5f3f6eb0d9ba Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:16:47 +0200 Subject: [PATCH 041/108] update list gift card transactions --- Changelog.md | 2 + ...VOUCHERS-API-List-Voucher-Transactions.md} | 4 +- reference/OpenAPI.json | 154564 +++++++-------- 3 files changed, 77251 insertions(+), 77319 deletions(-) rename docs/reference-docs/{VOUCHERS-API-List-Gift-Card-Transactions.md => VOUCHERS-API-List-Voucher-Transactions.md} (85%) diff --git a/Changelog.md b/Changelog.md index da4deaaf3..addb76030 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,7 @@ # Changelog +# 20231017 +- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions ## 20231012 - Product Collections diff --git a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md similarity index 85% rename from docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md rename to docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md index 0c0946408..d9c3268fd 100644 --- a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md +++ b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md @@ -1,8 +1,8 @@ --- -title: List Gift Card Transactions +title: List Voucher Transactions type: endpoint categorySlug: voucherify-api -slug: list-gift-card-transactions +slug: list-voucher-transactions parentDocSlug: vouchers-api hidden: false order: 11 diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index dae42e817..98178cc31 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3890,8 +3890,8 @@ } } }, - "1_res_vouchers_code_transactions": { - "title": "Get Gift Card Transactions Response Body", + "vouchers_list_transactions_response_body": { + "title": "Get Voucher Transactions Response Body", "type": "object", "description": "List of voucher transactions", "properties": { @@ -3909,36 +3909,58 @@ "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/1_obj_gift_card_transaction_object" + "$ref": "#/components/schemas/voucher_transaction" } }, "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" + ] + }, + "voucher_transaction": { + "title": "Voucher Transaction", + "description": "Voucher transaction object", + "oneOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction", + "x-stoplight": { + "id": "z5j73encc7u23" + } + }, + { + "$ref": "#/components/schemas/LoyaltyCardTransaction", + "x-stoplight": { + "id": "57gaoie3qn3il" + } + } + ] }, - "1_obj_gift_card_transaction_object": { - "title": "Gift Card Transaction Object", + "gift_card_transaction": { + "title": "Gift Card Transaction", "description": "Gift card transaction object", - "anyOf": [ + "allOf": [ { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_redemption" + "$ref": "#/components/schemas/gift_card_transaction_identity" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_refund" + "$ref": "#/components/schemas/gift_card_transaction_base" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_addition" + "$ref": "#/components/schemas/gift_card_transaction_response_data" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_removal" + "$ref": "#/components/schemas/gift_card_transaction_details" } ] }, - "1_obj_gift_card_transaction_object_redemption": { - "title": "Redemption", - "description": "When credits are used to pay for an order.", + "gift_card_transaction_identity": { "type": "object", "properties": { "id": { @@ -3947,169 +3969,110 @@ "example": "vtx_0c9dccc4d5813e71bd" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "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`." - }, + } + }, + "required": [ + "id", + "source_id" + ], + "title": "Gift Card Transaction Base" + }, + "gift_card_transaction_base": { + "type": "object", + "properties": { "voucher_id": { "type": "string", "description": "Unique voucher ID.", "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" }, "campaign_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" }, - "source": { - "type": "string", - "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`.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_REDEMPTION", - "enum": [ - "CREDITS_REDEMPTION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being used up by the redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - } - } - }, "related_transaction_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "This field is `null` in the case of gift voucher transactions." }, + "reason": { + "type": [ + "string", + "null" + ], + "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." + } + }, + "required": [ + "voucher_id", + "campaign_id", + "related_transaction_id", + "reason" + ], + "title": "Gift Card Transaction Base" + }, + "gift_card_transaction_response_data": { + "type": "object", + "title": "Gift Card Transaction Response Data", + "properties": { "created_at": { "type": "string", "format": "date-time", "example": "2022-02-25T13:32:08.734Z", "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } - } + }, + "required": [ + "created_at" + ] }, - "1_obj_gift_card_transaction_object_refund": { - "title": "Refund", - "description": "When funds are credited back to a card through a redemption rollback.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a redemption rollback, this value is `null`." + "gift_card_transaction_details": { + "title": "Gift Card Transaction Details", + "anyOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_redemption_details" }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + { + "$ref": "#/components/schemas/gift_card_transaction_refund_details" }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + { + "$ref": "#/components/schemas/gift_card_transaction_addition_details" }, + { + "$ref": "#/components/schemas/gift_card_transaction_removal_details" + } + ], + "type": "object" + }, + "gift_card_transaction_redemption_details": { + "title": "Redemption", + "description": "When credits are used to pay for an order.", + "type": "object", + "properties": { "source": { "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", + "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`.", "enum": [ "voucherify-web-ui", "API" ] }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption rollback, this value is `null`." - }, "type": { "type": "string", "description": "Type of transaction.", - "default": "CREDITS_REFUND", + "default": "CREDITS_REDEMPTION", "enum": [ - "CREDITS_REFUND" + "CREDITS_REDEMPTION" ] }, "details": { @@ -4131,7 +4094,7 @@ }, "amount": { "type": "integer", - "description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "description": "The amount being used up by the redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "object": { "type": "string", @@ -4140,7 +4103,7 @@ }, "balance": { "type": "integer", - "description": "The credit balance on the gift card after the amount is added back to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "related_object": { "type": "object", @@ -4185,2342 +4148,1369 @@ "example": "r_0c94ed583fcafc31c1" } } - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID.", - "example": "rr_0c94edbb8d0bef5d9e" + } + } + } + }, + "gift_card_transaction_refund_details": { + "title": "Refund", + "description": "When funds are credited back to a card through a redemption rollback.", + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_REFUND", + "enum": [ + "CREDITS_REFUND" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" + }, + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is added back to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." + } + } + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" + } + } + }, + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID.", + "example": "rr_0c94edbb8d0bef5d9e" + } } } } } }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_gift_card_transaction_object_addition": { - "title": "Addition", - "description": "When funds are deposited to a gift card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_ADDITION", - "enum": [ - "CREDITS_ADDITION" - ] - }, - "details": { + "gift_card_transaction_addition_details": { + "title": "Addition", + "description": "When funds are deposited to a gift card.", "type": "object", - "description": "Contains the detailed information about the transaction.", "properties": { - "balance": { + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_ADDITION", + "enum": [ + "CREDITS_ADDITION" + ] + }, + "details": { "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", + "description": "Contains the detailed information about the transaction.", "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { "type": "object", - "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { - "id": { + "type": { "type": "string", - "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" }, - "type": { + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } } } } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_gift_card_transaction_object_removal": { - "title": "Removal", - "description": "When funds are removed from a gift card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_REMOVAL", - "enum": [ - "CREDITS_REMOVAL" - ] - }, - "details": { + "gift_card_transaction_removal_details": { + "title": "Removal", + "description": "When funds are removed from a gift card.", "type": "object", - "description": "Contains the detailed information about the transaction.", "properties": { - "balance": { + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_REMOVAL", + "enum": [ + "CREDITS_REMOVAL" + ] + }, + "details": { "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", + "description": "Contains the detailed information about the transaction.", "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { "type": "object", - "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { - "id": { + "type": { "type": "string", - "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" }, - "type": { + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } } } } } } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_req_create_gift_card_transactions_export": { - "type": "object", - "title": "Create Gift Card Transactions Export Request Body", - "description": "Request body schema for **POST** `/vouchers/transactions/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/1_obj_export_gift_card_transactions", - "description": "Contains the parameters that define the data to be exported." - } - } - }, - "1_obj_export_gift_card_transactions": { - "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "items": { - "type": "string" - } - } - } - }, - "1_obj_export_transactions_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "default": "API" - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "default": "voucher_transactions" - }, - "parameters": { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - "result": { - "type": "object", - "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](ref:download-export) method." - } - } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" - } - } - }, - "1_req_vouchers_import": { - "title": "Import Vouchers Request Body", - "type": "array", - "description": "Request body schema for **POST** `/vouchers/import`.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_vouchers_import_gift_voucher" }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_voucher" - } - ] - } - }, - "1_obj_vouchers_import_gift_voucher": { - "title": "Import Gift Voucher", - "type": "object", - "description": "Object model for gift voucher object being imported.", - "properties": { - "code": { - "type": "string", - "description": "Value representing the imported code." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "type": { - "type": "string", - "description": "Represents the voucher type. ", - "default": "GIFT_VOUCHER" - }, - "gift": { - "type": "object", - "properties": { - "amount": { - "type": "string", - "description": "Total gift card income. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "1_req_create_gift_card_transactions_export": { + "type": "object", + "title": "Create Gift Card Transactions Export Request Body", + "description": "Request body schema for **POST** `/vouchers/transactions/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/1_obj_export_gift_card_transactions", + "description": "Contains the parameters that define the data to be exported." + } } }, - "required": [ - "amount" - ] - }, - "start_date": { - "type": "string", - "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2020-12-28T12:49:16.272Z" - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2053-12-28T12:49:16.272Z" - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", - "example": 10 + "1_obj_export_gift_card_transactions": { + "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", + "title": "Export Transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "items": { + "type": "string" + } + } } - } - }, - "additional_info": { - "type": "string", - "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." - } - }, - "required": [ - "code" - ] - }, - "1_obj_vouchers_import_discount_voucher": { - "title": "Import Discount Voucher", - "type": "object", - "description": "Object model for discount voucher object being imported.", - "properties": { - "code": { - "type": "string", - "description": "Value representing the imported code." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "type": { - "type": "string", - "description": "Represents the voucher type.", - "default": "DISCOUNT_VOUCHER" - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_shipping" + }, + "1_obj_export_transactions_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "default": "API" + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "default": "voucher_transactions" + }, + "parameters": { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + "result": { + "type": "object", + "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](ref:download-export) method." + } + } + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } } - ] - }, - "start_date": { - "type": "string", - "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2020-12-28T12:49:16.272Z" - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2053-12-28T12:49:16.272Z" - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", - "example": 10 + }, + "1_req_vouchers_import": { + "title": "Import Vouchers Request Body", + "type": "array", + "description": "Request body schema for **POST** `/vouchers/import`.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_vouchers_import_gift_voucher" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_voucher" + } + ] } - } - }, - "additional_info": { - "type": "string", - "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." - } - }, - "required": [ - "code" - ] - }, - "1_req_vouchers_importCSV": { - "type": "object", - "title": "Import Vouchers by CSV Request Body", - "description": "Request body schema for `vouchers/importCSV`.", - "format": "binary", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "The property name 'file' will be used for the file path." - } - } - }, - "1_res_vouchers_qualification": { - "title": "Vouchers Qualification Response Body", - "type": "object", - "description": "Response body schema for vouchers/qualification", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. Default is `list`." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of qualified vouchers." - }, - "data": { - "type": "array", - "description": "Array of qualified vouchers.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "1_obj_vouchers_import_gift_voucher": { + "title": "Import Gift Voucher", + "type": "object", + "description": "Object model for gift voucher object being imported.", + "properties": { + "code": { + "type": "string", + "description": "Value representing the imported code." }, - { - "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_applicable_to" + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." }, - { - "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_inapplicable_to" + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "type": { + "type": "string", + "description": "Represents the voucher type. ", + "default": "GIFT_VOUCHER" + }, + "gift": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "Total gift card income. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + } + }, + "required": [ + "amount" + ] + }, + "start_date": { + "type": "string", + "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2020-12-28T12:49:16.272Z" + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2053-12-28T12:49:16.272Z" + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", + "example": 10 + } + } + }, + "additional_info": { + "type": "string", + "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." } + }, + "required": [ + "code" ] - } - }, - "total": { - "type": "integer", - "example": 37, - "description": "Total valid and active vouchers matching the qualification criteria in given context. " - }, - "id": { - "type": "string", - "example": "qfl_nAMVLoxIqSLh9O6YmfoAXRPG", - "description": "Unique qualification ID." - }, - "created_at": { - "type": "string", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", - "format": "date-time" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - } - } - }, - "1_res_obj_vouchers_qualification_applicable_to": { - "title": "ApplicableToObject", - "type": "object", - "description": "", - "properties": { - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - } - } - }, - "1_res_obj_vouchers_qualification_inapplicable_to": { - "title": "InapplicableToObject", - "type": "object", - "properties": { - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - } - } - }, - "1_req_vouchers_bulk_async": { - "title": "Vouchers Bulk Async Request Body", - "type": "array", - "description": "Array of objects each containing the code to be updated and the metadata object containing the key/value pairs to be updated.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." }, - "metadata": { + "1_obj_vouchers_import_discount_voucher": { + "title": "Import Discount Voucher", "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." - } - } - } - }, - "1_req_vouchers_qualification": { - "title": "Vouchers Qualification Request Body", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "order": { - "type": "object", - "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", - "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" - }, - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "amount": { - "type": "integer", - "minimum": 0, - "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the total order amount or the amount of each item individually in the request body to check against vouchers requiring specific total order amount validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_ \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity.", - "items": { + "description": "Object model for discount voucher object being imported.", + "properties": { + "code": { + "type": "string", + "description": "Value representing the imported code." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "type": { + "type": "string", + "description": "Represents the voucher type.", + "default": "DISCOUNT_VOUCHER" + }, + "discount": { "anyOf": [ { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_amount" }, { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_percentage" }, { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_product_id" + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_fixed" }, { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_source_id" + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_shipping" } ] + }, + "start_date": { + "type": "string", + "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2020-12-28T12:49:16.272Z" + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2053-12-28T12:49:16.272Z" + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", + "example": 10 + } + } + }, + "additional_info": { + "type": "string", + "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." } }, - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": "object" - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + "required": [ + "code" + ] + }, + "1_req_vouchers_importCSV": { + "type": "object", + "title": "Import Vouchers by CSV Request Body", + "description": "Request body schema for `vouchers/importCSV`.", + "format": "binary", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "The property name 'file' will be used for the file path." + } } - } - }, - "reward": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "assignment_id": { - "type": "string" - }, - "id": { - "type": "string" + }, + "1_res_vouchers_qualification": { + "title": "Vouchers Qualification Response Body", + "type": "object", + "description": "Response body schema for vouchers/qualification", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. Default is `list`." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of qualified vouchers." + }, + "data": { + "type": "array", + "description": "Array of qualified vouchers.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + { + "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_applicable_to" + }, + { + "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_inapplicable_to" + } + ] + } + }, + "total": { + "type": "integer", + "example": 37, + "description": "Total valid and active vouchers matching the qualification criteria in given context. " + }, + "id": { + "type": "string", + "example": "qfl_nAMVLoxIqSLh9O6YmfoAXRPG", + "description": "Unique qualification ID." + }, + "created_at": { + "type": "string", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", + "format": "date-time" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + } } - } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "1_req_obj_vouchers_qualification_customer": { - "title": "Customer Object", - "type": "object", - "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": "string", - "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", - "example": "firstname.lastname@mycompany.com" - }, - "name": { - "type": "string", - "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", - "example": "FirstName LastName" - }, - "email": { - "type": "string", - "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", - "example": "firstname.lastname@mycompany.com" - }, - "phone": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]", - "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." - }, - "address": { - "type": "object", - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", - "properties": { - "city": { - "type": "string", - "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", - "example": "New York" - }, - "country": { - "type": "string", - "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", - "example": "United States of America" - }, - "postal_code": { - "type": "string", - "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", - "example": "10001" - }, - "state": { - "type": "string", - "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", - "example": "NY" + }, + "1_res_obj_vouchers_qualification_applicable_to": { + "title": "ApplicableToObject", + "type": "object", + "description": "", + "properties": { + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + } } - } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "birthdate": { - "type": "string", - "example": "2022-01-01", - "format": "date", - "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied." - } - } - }, - "1_req_obj_vouchers_qualification_product": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } - } - }, - "1_req_obj_vouchers_qualification_product_using_product_id": { - "title": "Product Item using product_id", - "type": "object", - "description": "Schema model for a product item sent using the `product_id`. \n\nYou can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. \nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. Even if this price is explicitly provided, it will not override the `price` when running qualifications against _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select/create a product collection filtered by a Price_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } - } - }, - "1_req_obj_vouchers_qualification_product_using_source_id": { - "title": "Product Item using source_id", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } - }, - "required": [ - "source_id", - "related_object" - ] - }, - "1_req_obj_vouchers_qualification_product-copy-2-use-for-other-objects-as-reference": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If product does not exist, it will be created with the use of `source_id`." - } - } - } - } - }, - "1_req_obj_vouchers_qualification_sku": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "sku_id": { - "type": "string", - "example": "sku_0a41e31c7b41c28358", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "amount": { - "type": "integer", - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "related_object": { - "type": "string", - "enum": [ - "product", - "sku" - ], - "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "1_res_obj_vouchers_qualification_inapplicable_to": { + "title": "InapplicableToObject", + "type": "object", + "properties": { + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + } } - } - }, - "sku": { - "type": "object", - "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique SKU identifier from your inventory system.", - "example": "sku_1234" - }, - "sku": { - "type": "string", - "description": "SKU name.", - "example": "iPhone 12" - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { + }, + "1_req_vouchers_bulk_async": { + "title": "Vouchers Bulk Async Request Body", + "type": "array", + "description": "Array of objects each containing the code to be updated and the metadata object containing the key/value pairs to be updated.", + "items": { "type": "object", - "description": "A set of custom key/value pairs that you can attach to a SKU." - } - } - } - } - }, - "1_req_obj_vouchers_qualification_sku-copy-2_forfuturereference": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "sku_id": { - "type": [ - "string", - "null" - ], - "example": "sku_0a41e31c7b41c28358", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", - "example": 10000 - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If the product does not exist, it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique SKU identifier from your inventory system.", - "example": "sku_1234" - }, - "sku": { - "type": [ - "string", - "null" - ], - "description": "SKU name.", - "example": "iPhone 12" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of custom key/value pairs that you can attach to a SKU." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist, it will be created with the use of `source_id`. If a SKU does not exist, it's required to set `product_id` that it belongs to." - } - } - } - } - }, - "1_req_obj_vouchers_qualification_sku-copy": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce, a database or a 3rd-party service." - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ] - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]" - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - }, - "1_req_vouchers_qualification_copy_for_reverting_changes": { - "title": "Vouchers Qualification Request Body", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", - "example": "firstname.lastname@mycompany.com" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", - "example": "FirstName LastName" - }, - "email": { - "type": [ - "string", - "null" - ], - "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", - "example": "firstname.lastname@mycompany.com" - }, - "phone": { - "type": [ - "string", - "null" - ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]", - "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", "properties": { - "city": { - "type": [ - "string", - "null" - ], - "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", - "example": "New York" - }, - "country": { - "type": [ - "string", - "null" - ], - "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", - "example": "United States of America" - }, - "postal_code": { - "type": [ - "string", - "null" - ], - "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", - "example": "10001" + "code": { + "type": "string", + "description": "Unique voucher code." }, - "state": { - "type": [ - "string", - "null" - ], - "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", - "example": "NY" + "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." } } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "format": "date", - "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied, i.e. `YYYY-MM-DD`." } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", - "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the amount in the request body to check against vouchers requiring specific order amount validation rules to be satisfied. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity. Read more about the [order item object] (hyperlink the Order Item Object).\n", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" + }, + "1_req_vouchers_qualification": { + "title": "Vouchers Qualification Request Body", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "order": { + "type": "object", + "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", + "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "amount": { + "type": "integer", + "minimum": 0, + "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the total order amount or the amount of each item individually in the request body to check against vouchers requiring specific total order amount validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_ \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" + }, + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" + }, + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_product_id" + }, + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_source_id" + } + ] + } + }, + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": "object" + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - ] + } + }, + "reward": { + "type": "object", + "properties": { + "points": { + "type": "integer" + }, + "assignment_id": { + "type": "string" + }, + "id": { + "type": "string" + } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "1_req_obj_vouchers_qualification_product-copy": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ] - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ] + }, + "1_req_obj_vouchers_qualification_customer": { + "title": "Customer Object", + "type": "object", + "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": "string", + "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", + "example": "firstname.lastname@mycompany.com" + }, + "name": { + "type": "string", + "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", + "example": "FirstName LastName" + }, + "email": { + "type": "string", + "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", + "example": "firstname.lastname@mycompany.com" + }, + "phone": { + "type": "string", + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]", + "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." + }, + "address": { + "type": "object", + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", + "properties": { + "city": { + "type": "string", + "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", + "example": "New York" + }, + "country": { + "type": "string", + "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", + "example": "United States of America" + }, + "postal_code": { + "type": "string", + "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", + "example": "10001" + }, + "state": { + "type": "string", + "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", + "example": "NY" + } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "birthdate": { + "type": "string", + "example": "2022-01-01", + "format": "date", + "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied." + } } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + }, + "1_req_obj_vouchers_qualification_product": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + } } - } - } - } - }, - "1_req_vouchers_qualification-prepforcampaignqualification": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name" - }, - "email": { - "type": [ - "string", - "null" - ] - }, - "phone": { - "type": [ - "string", - "null" - ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]" - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ] - }, - "country": { - "type": [ - "string", - "null" - ] - }, - "postal_code": { - "type": [ - "string", - "null" - ] - }, - "state": { - "type": [ - "string", - "null" - ] + }, + "1_req_obj_vouchers_qualification_product_using_product_id": { + "title": "Product Item using product_id", + "type": "object", + "description": "Schema model for a product item sent using the `product_id`. \n\nYou can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. \nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. Even if this price is explicitly provided, it will not override the `price` when running qualifications against _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select/create a product collection filtered by a Price_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } } } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate, i.e. `YYYY-MM-DD`.", - "format": "date" } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ - "string", - "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "1_req_obj_vouchers_qualification_product_using_source_id": { + "title": "Product Item using source_id", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + } }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { + "required": [ + "source_id", + "related_object" + ] + }, + "1_req_obj_vouchers_qualification_product-copy-2-use-for-other-objects-as-reference": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { "type": [ "object", "null" ], + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, "source_id": { "type": [ "string", "null" ], - "description": "Product/SKU reference ID" + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" }, - "product_id": { + "name": { "type": [ "string", "null" - ] + ], + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" }, - "sku_id": { + "price": { "type": [ - "string", + "integer", "null" - ] + ], + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 }, - "related_object": { + "metadata": { "type": [ - "string", + "object", "null" ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." }, - "amount": { + "override": { "type": [ - "integer", + "boolean", "null" ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + "description": "The override is used to store the product in the system. If product does not exist, it will be created with the use of `source_id`." + } + } + } + } + }, + "1_req_obj_vouchers_qualification_sku": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "sku_id": { + "type": "string", + "example": "sku_0a41e31c7b41c28358", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "amount": { + "type": "integer", + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "related_object": { + "type": "string", + "enum": [ + "product", + "sku" + ], + "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" }, - "discount_amount": { + "name": { + "type": "string", + "description": "Product name.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "sku": { + "type": "object", + "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique SKU identifier from your inventory system.", + "example": "sku_1234" + }, + "sku": { + "type": "string", + "description": "SKU name.", + "example": "iPhone 12" + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a SKU." + } + } + } + } + }, + "1_req_obj_vouchers_qualification_sku-copy-2_forfuturereference": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "sku_id": { + "type": [ + "string", + "null" + ], + "example": "sku_0a41e31c7b41c28358", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", + "example": 10000 + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ], + "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { "type": [ - "integer", + "string", "null" ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" }, - "quantity": { + "name": { "type": [ - "integer", + "string", "null" - ] + ], + "description": "Product name.", + "example": "Phone" }, - "discount_quantity": { + "price": { "type": [ "integer", "null" ], - "description": "number of items being discounted\t" + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used to store the product in the system. If the product does not exist, it will be created with the use of `source_id`." + } + } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique SKU identifier from your inventory system.", + "example": "sku_1234" + }, + "sku": { + "type": [ + "string", + "null" + ], + "description": "SKU name.", + "example": "iPhone 12" }, "price": { "type": [ "integer", "null" ], - "description": "Unit price of an item" + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 }, - "product": { + "metadata": { "type": [ "object", "null" ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." - } - } + "description": "A set of custom key/value pairs that you can attach to a SKU." }, - "sku": { + "override": { "type": [ - "object", + "boolean", "null" ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } + "description": "The override is used once the product should be stored in system. If sku does not exist, it will be created with the use of `source_id`. If a SKU does not exist, it's required to set `product_id` that it belongs to." } } } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ] - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - } - } - }, - "1_req_vouchers_qualification-copy": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name" - }, - "description": { - "type": [ - "string", - "null" - ], - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.\t" - }, - "email": { - "type": [ - "string", - "null" - ] - }, - "phone": { - "type": [ - "string", - "null" - ] - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ] - }, - "country": { - "type": [ - "string", - "null" - ] - }, - "line_1": { - "type": [ - "string", - "null" - ] - }, - "line_2": { - "type": [ - "string", - "null" - ] - }, - "postal_code": { - "type": [ - "string", - "null" - ] - }, - "state": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "email_unsubscribed": { - "type": [ - "boolean", - "null" - ] - }, - "birthday": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate.", - "format": "date", - "example": "2022-03-07" - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate", - "example": "2022-03-07", - "format": "date" - }, - "customer_landing_page": { - "type": [ - "object", - "null" - ], - "properties": { - "custom_event": { - "type": [ - "object", - "null" - ] - }, - "consents": { - "type": [ - "object", - "null" - ] - }, - "publication_id": { - "type": [ - "string", - "null" - ] - }, - "voucher_code": { - "type": [ - "string", - "null" - ] - } - } - }, - "created_at": { - "type": "string" } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ - "string", - "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { + }, + "1_req_obj_vouchers_qualification_sku-copy": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce, a database or a 3rd-party service." + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ] + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]" + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart." + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "sku": { "type": [ "object", "null" ], + "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", "properties": { "id": { "type": [ @@ -6532,56608 +5522,43533 @@ "type": [ "string", "null" - ], - "description": "Product/SKU reference ID" + ] }, - "product_id": { + "sku": { "type": [ "string", "null" ] }, - "sku_id": { + "price": { "type": [ - "string", + "integer", "null" ] }, - "related_object": { + "metadata": { "type": [ - "string", + "object", "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" + ] }, - "amount": { + "override": { "type": [ - "integer", + "boolean", "null" ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + "description": "The override is used once the product should be stored in system. If sku does not exist it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } + } + } + }, + "1_req_vouchers_qualification_copy_for_reverting_changes": { + "title": "Vouchers Qualification Request Body", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" }, - "discount_amount": { + "source_id": { "type": [ - "integer", + "string", "null" ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", + "example": "firstname.lastname@mycompany.com" }, - "quantity": { + "name": { "type": [ - "integer", + "string", "null" - ] + ], + "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", + "example": "FirstName LastName" }, - "discount_quantity": { + "email": { "type": [ - "integer", + "string", "null" ], - "description": "number of items being discounted\t" + "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", + "example": "firstname.lastname@mycompany.com" }, - "price": { + "phone": { "type": [ - "integer", + "string", "null" ], - "description": "Unit price of an item" + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]", + "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." }, - "product": { + "address": { "type": [ "object", "null" ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", "properties": { - "id": { + "city": { "type": [ "string", "null" - ] + ], + "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", + "example": "New York" }, - "source_id": { + "country": { "type": [ "string", "null" - ] + ], + "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", + "example": "United States of America" }, - "name": { + "postal_code": { "type": [ "string", "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] + ], + "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", + "example": "10001" }, - "override": { + "state": { "type": [ - "boolean", + "string", "null" ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." + "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", + "example": "NY" } } }, - "sku": { + "metadata": { "type": [ "object", "null" ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "format": "date", + "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied, i.e. `YYYY-MM-DD`." + } + } + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", + "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the amount in the request body to check against vouchers requiring specific order amount validation rules to be satisfied. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity. Read more about the [order item object] (hyperlink the Order Item Object).\n", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" + }, + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" + } + ] } + }, + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] } } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ] } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - }, - "gift": { - "type": [ - "object", - "null" - ], - "properties": { - "credits": { - "type": [ - "number", - "null" - ] - } - } - }, - "session": { - "type": [ - "object", - "null" - ], - "properties": { - "key": { - "type": [ - "string", - "null" - ], - "description": "Unique session identifier assigned by the Voucherify API." - }, - "type": { - "type": [ - "string", - "null" - ], - "enum": [ - "COUNT_PER_CUSTOMER", - "ORDER", - "LOCK" - ], - "description": "The type of session. Required to establish a new session. \n\n`LOCK`: Locks the following parameters within the session:\n\n- redemption quantity by 1\n- redemption gift credits specified with the requests\n- redemption loyalty points specified with the request" - }, - "ttl": { - "type": [ - "number", - "null" - ], - "description": "Value for the period of time that the session is active. Units for this parameter are defined by `session.ttl_unit`." - }, - "ttl_unit": { - "type": [ - "string", - "null" - ], - "enum": [ - "DAYS", - "HOURS", - "MICROSECONDS", - "MILLISECONDS", - "MINUTES", - "NANOSECONDS", - "SECONDS" - ], - "description": "Defines the type of unit in which the session time is counted." - } - } - }, - "tracking_id": { - "type": [ - "string", - "null" - ], - "maxLength": 2500, - "example": "track_fxEMFisanb7t4l96X8WKcemyGNPnHpGM3KTfUsqZGCOx/p57/J2+Yw==", - "description": "A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation. This is a hashed customer source ID." - } - } - }, - "1_req_obj_vouchers_qualification_order": { - "title": "OrderObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "1_req_obj_vouchers_qualification_reward": { - "title": "RewardObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "0_obj_metadata": { - "title": "MetadataObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "res_empty_json": { - "type": "object", - "description": "Schema model for an empty json.", - "title": "Empty JSON", - "examples": [ - {} - ] - }, - "2_obj_campaign_object": { - "type": "object", - "title": "Campaign Object", - "description": "This is an object representing a campaign.", - "x-tags": [ - "CAMPAIGNS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM", - "GIFT_VOUCHERS", - "DISCOUNT_COUPONS", - "PROMOTION", - "REFERRAL_PROGRAM", - "LUCKY_DRAW" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "category": { - "type": "string", - "description": "Unique category name." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - }, - "referral_program": { - "type": "object", - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "How a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." + }, + "1_req_obj_vouchers_qualification_product-copy": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "Product/SKU reference ID" + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "sku_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ] + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart." + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related product. These details will be used for validation and redemption processes on top of details already stored in the system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "integer", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ] + } } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "description": "Type of resource represented by the source of the reward." - } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." } - }, - "type": { - "type": "string", - "description": "Type of reward.", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ] - }, - "amount": { - "type": "string", - "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } } } - } - }, - "promotion": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] - } - } - }, - "2_loyalty_tiers_expiration_balance": { - "title": "Balance", - "type": "object", - "description": "Defines the Balance expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "BALANCE" - ], - "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." - } - } - }, - "expiration_date": { - "description": "Defines the conditions for the expiration date of a tier.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_balance_drop" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_custom" - } - ] - } - } - }, - "2_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { - "title": "Balance Drop", - "type": "object", - "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", - "properties": { - "type": { - "type": "string", - "enum": [ - "BALANCE_DROP" - ], - "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." - } - } - }, - "2_loyalty_tiers_expiration_balance_expiration_date_custom": { - "title": "Custom", - "type": "object", - "description": "Defines the custom conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." - }, - "extend": { - "type": "string", - "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." - }, - "rounding": { - "description": "Defines the rounding mechanism for tier expiration.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_default_options" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_custom" - } - ] - } - } - }, - "2_loyalty_tiers_expiration_expiration_date_rounding_default_options": { - "title": "Calendar Periods", - "type": "object", - "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", - "properties": { - "type": { - "type": "string", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ], - "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." - }, - "strategy": { - "type": "string", - "description": "Which portion of the given period should the rounding be applied to.", - "enum": [ - "END" - ] - } - } - }, - "2_loyalty_tiers_expiration_expiration_date_rounding_custom": { - "title": "Specific Month", - "type": "object", - "description": "Defines the custom rounding mechanism for tier expiration.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "This mechanism describes a custom rounding for the expiration date." - }, - "strategy": { - "type": "string", - "description": "Which portion of the given period should the rounding be applied to.", - "enum": [ - "END" - ] - }, - "unit": { - "type": "string", - "description": "Defines the type of unit of time in which the rounding period is counted.", - "enum": [ - "MONTH" - ] - }, - "value": { - "type": "integer", - "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" - } - } - }, - "2_loyalty_tiers_expiration_points_in_period": { - "title": "Points in Period", - "type": "object", - "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "POINTS_IN_PERIOD" - ], - "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." - }, - "qualification_period": { - "type": "string", - "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
- January - March
- April - June
- July - September
- October - December |\n| **Calendar Half-year** | Points collected in the half-year
- January - June
- July - December |\n| **Calendar Year** | Points collected in one calendar year
January - December |", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ] - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE", - "NEXT_PERIOD" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." - } - } - }, - "expiration_date": { - "type": "object", - "description": "Defines the conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "END_OF_PERIOD", - "END_OF_NEXT_PERIOD" - ], - "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." - }, - "extend": { - "type": "string", - "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." - } - } - } - } - }, - "2_req_create_campaign": { - "title": "Create Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns`.", - "oneOf": [ - { - "$ref": "#/components/schemas/2_req_create_campaign_discount_voucher" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_loyalty" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_gift" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_promotion" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_referral" - } - ] - }, - "2_req_create_campaign_discount_voucher": { - "type": "object", - "title": "Discount Campaign", - "description": "Request body schema for creating a discount voucher campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "DISCOUNT_COUPONS", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - } - } - }, - "2_req_create_campaign_loyalty": { - "type": "object", - "title": "Loyalty Campaign", - "description": "Request body schema for creating a loyalty campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "LOYALTY_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } - } - }, - "2_req_create_campaign_gift": { - "type": "object", - "title": "Gift Card campaign", - "description": "Request body schema for creating a gift card campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "GIFT_VOUCHERS", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - } - } - }, - "2_req_create_campaign_referral": { - "type": "object", - "title": "Referral Campaign", - "description": "Request body schema for creating a referral campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "REFERRAL_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "referral_program": { - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "type": "object", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "Define how a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." + }, + "1_req_vouchers_qualification-prepforcampaignqualification": { + "title": "RequestBodyVouchersQualification", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details.", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "First and Last Name" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]" + }, + "address": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address.", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "postal_code": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate, i.e. `YYYY-MM-DD`.", + "format": "date" + } } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "enum": [ - "CAMPAIGN" + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions.", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order that will be linked to redemption in this request." + }, + "status": { + "type": [ + "string", + "null" + ], + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "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." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", + "items": { + "type": [ + "object", + "null" ], - "description": "Type of resource represented by the source of the reward." + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "Product/SKU reference ID" + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "sku_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ], + "description": "Allowed values: `product`, `sku`" + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "quantity": { + "type": [ + "integer", + "null" + ] + }, + "discount_quantity": { + "type": [ + "integer", + "null" + ], + "description": "number of items being discounted\t" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "null", + "integer" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." + } + } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } + } + } } + }, + "customer": { + "type": [ + "object", + "null" + ], + "description": "The customer used for the order." + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ] + } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ], - "description": "Type of reward." - }, - "amount": { - "type": "string", - "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." } } - } - } - } - }, - "2_req_create_campaign_promotion": { - "type": "object", - "title": "Promotion", - "description": "Request body schema for creating a promotions campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "PROMOTION", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "promotion": { - "type": "object", - "description": "Define the promotion tiers within the campaign.", - "properties": { - "tiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" - } - } - } - } - } - }, - "2_req_update_campaign": { - "type": "object", - "title": "Update Campaign Request Body", - "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", - "properties": { - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter or the `category` parameter.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id` parameter." - } - } - }, - "2_req_add_vouchers_to_campaign": { - "type": "object", - "title": "Add Vouchers to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers`.", - "properties": { - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher.", - "example": "cat_0b688929a2476386a7" - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - } - } - }, - "2_req_add_vouchers_with_specific_code_to_campaign": { - "type": "object", - "title": "Add Vouchers with Specific Code to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers/{code}`.", - "properties": { - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher.", - "example": "cat_0b688929a2476386a7" - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - } - } - }, - "2_req_import_vouchers_to_campaign": { - "type": "array", - "title": "Import Vouchers to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/import`.", - "items": { - "$ref": "#/components/schemas/2_obj_import_vouchers_to_campaign_object" - } - }, - "2_obj_import_vouchers_to_campaign_object": { - "type": "object", - "title": "Import Vouchers to Campaign", - "description": "Import Vouchers to Campaign", - "properties": { - "code": { - "type": "string", - "description": "Unique custom voucher code." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - }, - "loyalty_card": { - "type": "object", - "description": " Assign an initial points balance for a loyalty card. Context: `LOYALTY_PROGRAM`.", - "properties": { - "points": { - "type": "integer", - "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card." - } - } - }, - "gift": { - "type": "object", - "description": "Assign an initial cash balance for a gift card. Context: `GIFT_VOUCHERS`.", - "properties": { - "amount": { - "type": "integer", - "description": "The cash balance to assign to the gift card. This is the current gift card balance." - } - } - } - }, - "required": [ - "code" - ] - }, - "2_req_examine_qualification": { - "type": "object", - "title": "Examine Qualification Request Body", - "description": "Request body schema for **POST** `/campaigns/qualification`.", - "examples": [], - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - } - } - }, - "2_res_examine_qualification": { - "type": "object", - "title": "Examine Qualification Response Body", - "description": "Response body schema for **POST** `/campaigns/qualification`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of campaign objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of campaign objects.", - "items": { - "$ref": "#/components/schemas/2_obj_campaign_object_campaigns_qualification" - } - }, - "total": { - "type": "integer", - "description": "Total valid and active campaigns matching the qualification criteria in given context." - }, - "id": { - "type": "string", - "description": "Unique qualification ID.", - "example": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU" - }, - "created_at": { - "type": "string", - "format": "datetime", - "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", - "example": "2023-04-04T13:13:03.119Z" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - } - } - }, - "2_obj_campaign_object_campaigns_qualification": { - "type": "object", - "title": "Campaign Object", - "description": "This is an object representing a campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "GIFT_VOUCHERS", - "DISCOUNT_COUPONS", - "REFERRAL_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "category": { - "type": "string", - "description": "Unique category name." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "validation_rules_assignments": { - "type": "object", - "description": "Stores information about validation rules assigned to the campaign.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented is by default `list`.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of validation rule assignments.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.", - "items": { - "type": "object", + }, + "1_req_vouchers_qualification-copy": { + "title": "RequestBodyVouchersQualification", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details.", "properties": { "id": { "type": "string", - "example": "asgm_N7t39epaQR2SkQcW", - "description": "Assigned by the Voucherify API, identifies the validation rule assignment." + "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" }, - "rule_id": { - "type": "string", - "example": "val_ssbxf1L9aKri", - "description": "Assigned by the Voucherify API, identifies the validation rule." + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." }, - "related_object_id": { - "type": "string", - "example": "camp_AaP9MC1Y0GpBII84UTIuasvb", - "description": "ID of the object from which the rule originates." + "name": { + "type": [ + "string", + "null" + ], + "description": "First and Last Name" }, - "related_object_type": { - "type": "string", - "example": "campaign", - "description": "Which object does the rule originate from: the `voucher` itself or inherited from its parent `campaign`." + "description": { + "type": [ + "string", + "null" + ], + "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.\t" }, - "created_at": { - "type": "string", - "example": "2022-02-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "format": "date-time" + "email": { + "type": [ + "string", + "null" + ] }, - "object": { - "type": "string", - "default": "validation_rules_assignment", - "description": "The type of resource represented by the object. Default is `validation_rules_assignment`." + "phone": { + "type": [ + "string", + "null" + ] }, - "rule": { - "type": "object", - "description": "Describes the details of the rule." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of validation rules assigned to the campaign." - } - } - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - }, - "referral_program": { - "type": "object", - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "How a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "description": "Type of reward.", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ] - }, - "amount": { - "type": "string", - "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "address": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address.", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "line_1": { + "type": [ + "string", + "null" + ] + }, + "line_2": { + "type": [ + "string", + "null" + ] + }, + "postal_code": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." + }, + "email_unsubscribed": { + "type": [ + "boolean", + "null" + ] + }, + "birthday": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate.", + "format": "date", + "example": "2022-03-07" + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate", + "example": "2022-03-07", + "format": "date" + }, + "customer_landing_page": { + "type": [ + "object", + "null" + ], + "properties": { + "custom_event": { + "type": [ + "object", + "null" + ] + }, + "consents": { + "type": [ + "object", + "null" + ] + }, + "publication_id": { + "type": [ + "string", + "null" + ] + }, + "voucher_code": { + "type": [ + "string", + "null" + ] + } + } + }, + "created_at": { + "type": "string" + } + } + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions.", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order that will be linked to redemption in this request." + }, + "status": { + "type": [ + "string", + "null" + ], + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "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." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", + "items": { + "type": [ + "object", + "null" + ], + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "Product/SKU reference ID" + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "sku_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ], + "description": "Allowed values: `product`, `sku`" + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "quantity": { + "type": [ + "integer", + "null" + ] + }, + "discount_quantity": { + "type": [ + "integer", + "null" + ], + "description": "number of items being discounted\t" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "null", + "integer" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." + } + } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } + } + } + } + }, + "customer": { + "type": [ + "object", + "null" + ], + "description": "The customer used for the order." + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ] + } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." + }, + "gift": { + "type": [ + "object", + "null" + ], + "properties": { + "credits": { + "type": [ + "number", + "null" + ] + } + } + }, + "session": { + "type": [ + "object", + "null" + ], + "properties": { + "key": { + "type": [ + "string", + "null" + ], + "description": "Unique session identifier assigned by the Voucherify API." + }, + "type": { + "type": [ + "string", + "null" + ], + "enum": [ + "COUNT_PER_CUSTOMER", + "ORDER", + "LOCK" + ], + "description": "The type of session. Required to establish a new session. \n\n`LOCK`: Locks the following parameters within the session:\n\n- redemption quantity by 1\n- redemption gift credits specified with the requests\n- redemption loyalty points specified with the request" + }, + "ttl": { + "type": [ + "number", + "null" + ], + "description": "Value for the period of time that the session is active. Units for this parameter are defined by `session.ttl_unit`." + }, + "ttl_unit": { + "type": [ + "string", + "null" + ], + "enum": [ + "DAYS", + "HOURS", + "MICROSECONDS", + "MILLISECONDS", + "MINUTES", + "NANOSECONDS", + "SECONDS" + ], + "description": "Defines the type of unit in which the session time is counted." + } } + }, + "tracking_id": { + "type": [ + "string", + "null" + ], + "maxLength": 2500, + "example": "track_fxEMFisanb7t4l96X8WKcemyGNPnHpGM3KTfUsqZGCOx/p57/J2+Yw==", + "description": "A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation. This is a hashed customer source ID." } } - } - } - } - }, - "2_res_list_campaigns": { - "type": "object", - "description": "Schema model for **GET** `/campaigns`.", - "title": "List Campaigns Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of campaign objects.", - "default": "campaigns" - }, - "campaigns": { - "type": "array", - "description": "Contains array of campaign objects.", - "items": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of campaigns." - } - } - }, - "2_obj_campaign_object_voucher_object_DISCOUNT": { - "type": "object", - "description": "Schema model for a discount voucher.", - "title": "Discount Voucher", - "properties": { - "type": { - "type": "string", - "default": "DISCOUNT_VOUCHER", - "description": "Type of voucher." - }, - "discount": { - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ], - "description": "Defines the voucher discount type and details." - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." - } - } - }, - "2_obj_campaign_object_voucher_object_GIFT_CARD": { - "type": "object", - "description": "Schema model for a gift card.", - "title": "Gift Card", - "properties": { - "type": { - "type": "string", - "default": "GIFT_VOUCHER", - "description": "Type of voucher." - }, - "gift": { - "description": "Defines the gift card details.", - "type": "object", - "properties": { - "amount": { - "type": "integer", - "description": "Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "description": "Defines how the credits are applied to the customer's order.", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ] - } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + }, + "1_req_obj_vouchers_qualification_order": { + "title": "OrderObject", + "type": "object", + "properties": { + "id": { + "type": "string" + } } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." - } - } - }, - "2_obj_campaign_object_voucher_object_LOYALTY_CARD": { - "type": "object", - "description": "Schema model for a loyalty card.", - "title": "Loyalty Card", - "properties": { - "type": { - "type": "string", - "default": "LOYALTY_CARD", - "description": "Type of voucher." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." - } + }, + "1_req_obj_vouchers_qualification_reward": { + "title": "RewardObject", + "type": "object", + "properties": { + "id": { + "type": "string" } } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + }, + "0_obj_metadata": { + "title": "MetadataObject", + "type": "object", + "properties": { + "id": { + "type": "string" + } } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." - } - } - }, - "2_req_campaign_object_voucher_object_LOYALTY_CARD": { - "type": "object", - "description": "Schema model for a loyalty card.", - "title": "Loyalty Card", - "properties": { - "type": { - "type": "string", - "default": "LOYALTY_CARD", - "description": "Type of voucher." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." + }, + "res_empty_json": { + "type": "object", + "description": "Schema model for an empty json.", + "title": "Empty JSON", + "examples": [ + {} + ] + }, + "2_obj_campaign_object": { + "type": "object", + "title": "Campaign Object", + "description": "This is an object representing a campaign.", + "x-tags": [ + "CAMPAIGNS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM", + "GIFT_VOUCHERS", + "DISCOUNT_COUPONS", + "PROMOTION", + "REFERRAL_PROGRAM", + "LUCKY_DRAW" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + } + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } } - } - } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - } - } - }, - "3_obj_promotion_tier_object": { - "type": "object", - "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.", - "title": "Promotion Tier Object", - "x-tags": [ - "PROMOTIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "description": "Unique promotion tier ID." - }, - "created_at": { - "type": "string", - "example": "2021-12-15T11:34:01.333Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-02-09T09:20:05.603Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion tier was updated in ISO 8601 format." - }, - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website." - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" } - ], - "description": "The type of discount that will be applied to a customer's order." + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "category": { + "type": "string", + "description": "Unique category name." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + }, + "referral_program": { + "type": "object", + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "How a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." + } + } + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "description": "Type of resource represented by the source of the reward." + } + } + }, + "type": { + "type": "string", + "description": "Type of reward.", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ] + }, + "amount": { + "type": "string", + "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + } + } + } + } + }, + "promotion": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" + } + ] + } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "campaign": { - "type": "object", - "description": "Contains details about promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-22T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + }, + "2_loyalty_tiers_expiration_balance": { + "title": "Balance", + "type": "object", + "description": "Defines the Balance expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "BALANCE" + ], + "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." + } } + }, + "expiration_date": { + "description": "Defines the conditions for the expiration date of a tier.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_balance_drop" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_custom" + } + ] } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + } + }, + "2_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { + "title": "Balance Drop", + "type": "object", + "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", + "properties": { + "type": { + "type": "string", + "enum": [ + "BALANCE_DROP" + ], + "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." } - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](ref:disable-campaign) endpoint. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "category_id": { - "type": "string", - "example": "cat_0b688929a2476386a6", - "description": "Unique category ID that this campaign belongs to." - }, - "object": { - "type": "string", - "description": "The type of object represented by the campaign object. This object stores information about the campaign.", - "default": "campaign" } - } - }, - "campaign_id": { - "type": "string", - "description": "Promotion tier's parent campaign's unique ID." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + }, + "2_loyalty_tiers_expiration_balance_expiration_date_custom": { + "title": "Custom", + "type": "object", + "description": "Defines the custom conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." + }, + "extend": { + "type": "string", + "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." + }, + "rounding": { + "description": "Defines the rounding mechanism for tier expiration.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_default_options" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_custom" + } + ] + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "summary": { - "type": "object", - "description": "Contains statistics about promotion tier redemptions and orders.", - "properties": { - "redemptions": { - "type": "object", - "description": "Contains statistics about promotion tier redemptions.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Number of times the promotion tier was redeemed." - } + }, + "2_loyalty_tiers_expiration_expiration_date_rounding_default_options": { + "title": "Calendar Periods", + "type": "object", + "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", + "properties": { + "type": { + "type": "string", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ], + "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." + }, + "strategy": { + "type": "string", + "description": "Which portion of the given period should the rounding be applied to.", + "enum": [ + "END" + ] } - }, - "orders": { - "type": "object", - "description": "Contains statistics about orders related to the promotion tier.", - "properties": { - "total_amount": { - "type": "integer", - "description": "Sum of order totals." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of total discount applied using the promotion tier." - } + } + }, + "2_loyalty_tiers_expiration_expiration_date_rounding_custom": { + "title": "Specific Month", + "type": "object", + "description": "Defines the custom rounding mechanism for tier expiration.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "This mechanism describes a custom rounding for the expiration date." + }, + "strategy": { + "type": "string", + "description": "Which portion of the given period should the rounding be applied to.", + "enum": [ + "END" + ] + }, + "unit": { + "type": "string", + "description": "Defines the type of unit of time in which the rounding period is counted.", + "enum": [ + "MONTH" + ] + }, + "value": { + "type": "integer", + "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" } } - } - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "validation_rule_assignments": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" - }, - "category_id": { - "type": "string", - "description": "Promotion tier category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion tier." - } - } - }, - "3_req_add_promotion_tier_to_campaign": { - "type": "object", - "description": "Request body schema for creating a promotion tier within a campaign in **POST** `/promotions/{campaignId}/tiers`.", - "title": "Add Promotion Tier to Campaign Request Body", - "properties": { - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.\t" - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + }, + "2_loyalty_tiers_expiration_points_in_period": { + "title": "Points in Period", + "type": "object", + "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "POINTS_IN_PERIOD" + ], + "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." + }, + "qualification_period": { + "type": "string", + "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
- January - March
- April - June
- July - September
- October - December |\n| **Calendar Half-year** | Points collected in the half-year
- January - June
- July - December |\n| **Calendar Year** | Points collected in one calendar year
January - December |", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ] + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE", + "NEXT_PERIOD" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." + } } - ], - "description": "The type of discount that will be applied to a customer's order." + }, + "expiration_date": { + "type": "object", + "description": "Defines the conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "END_OF_PERIOD", + "END_OF_NEXT_PERIOD" + ], + "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." + }, + "extend": { + "type": "string", + "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." + } + } + } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + }, + "2_req_create_campaign": { + "title": "Create Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns`.", + "oneOf": [ + { + "$ref": "#/components/schemas/2_req_create_campaign_discount_voucher" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_loyalty" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_gift" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_promotion" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_referral" + } + ] + }, + "2_req_create_campaign_discount_voucher": { + "type": "object", + "title": "Discount Campaign", + "description": "Request body schema for creating a discount voucher campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "DISCOUNT_COUPONS", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "validation_rules": { - "type": "array", - "description": "Array containing the ID of the validation rule associated with the promotion tier.", - "items": { - "type": "string" - } - }, - "category": { - "type": "string", - "description": "Assign category to the promotion tier." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" - } - } - }, - "3_req_update_promotion_tier": { - "type": "object", - "description": "Request body schema for updating a promotion tier within a campaign in **POST** `/promotions/tiers/{promotionTierId}`.", - "title": "Update Promotion Tier Request Body", - "properties": { - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.\t" - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + }, + "2_req_create_campaign_loyalty": { + "type": "object", + "title": "Loyalty Campaign", + "description": "Request body schema for creating a loyalty campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "LOYALTY_PROGRAM", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } } - ], - "description": "The type of discount that will be applied to a customer's order." + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + }, + "2_req_create_campaign_gift": { + "type": "object", + "title": "Gift Card campaign", + "description": "Request body schema for creating a gift card campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "GIFT_VOUCHERS", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. If you update a hierarchy of a promotion tier, then the remaining promotion tier hierarchies will be recalculated." - }, - "category": { - "type": "string", - "description": "Assign a new or update the promotion tier's category." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" - } - } - }, - "3_res_list_promotion_tiers": { - "type": "object", - "description": "Promotion Tiers", - "title": "Promotion Tiers", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "tiers", - "description": "Identifies the name of the attribute that contains the array of promotion tier objects." - }, - "tiers": { - "type": "array", - "description": "Contains array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of promotion tiers." - } - } - }, - "3_res_list_promotion_stacks": { - "type": "object", - "description": "Promotion Stacks", - "title": "Promotion Stacks", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of promotion stack objects." - }, - "data": { - "type": "array", - "description": "Contains array of promotion stack objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of promotion stacks." - } - } - }, - "3_obj_promotion_stack_object": { - "type": "object", - "title": "Promotion Stack Object", - "description": "Model schema for a promotion stack.", - "properties": { - "id": { - "type": "string", - "example": "stack_p0WhtyyDU95crobleMpRabhH", - "description": "Unique promotion stack ID." - }, - "name": { - "type": "string", - "description": "Promotion stack name." - }, - "created_at": { - "type": "string", - "example": "2022-09-22T13:03:25.740Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-09-23T07:59:44.172Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." - }, - "campaign_id": { - "type": "string", - "example": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "description": "Promotion stack's parent campaign's unique ID." - }, - "object": { - "type": "string", - "default": "promotion_stack", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "tiers": { - "type": "object", - "description": "Contains the tier configuration.", - "properties": { - "ids": { - "type": "array", - "description": "Contains the list of tiers in a pre-defined sequence.", - "items": { - "type": "string" + }, + "2_req_create_campaign_referral": { + "type": "object", + "title": "Referral Campaign", + "description": "Request body schema for creating a referral campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "REFERRAL_PROGRAM", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + } + ] + }, + "referral_program": { + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "type": "object", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "Define how a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." + } + } + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Type of resource represented by the source of the reward." + } + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ], + "description": "Type of reward." + }, + "amount": { + "type": "string", + "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + } + } + } + } } - }, - "hierarchy_mode": { - "type": "string", - "default": "MANUAL" } - } - }, - "category_id": { - "type": "string", - "description": "Promotion stack category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion stack." - } - } - }, - "3_req_create_promotion_stack": { - "type": "object", - "title": "Create Promotion Stack Request Body", - "description": "Model schema for a creating a promotion stack using **POST** `/promotions/{campaignId}/stacks`.", - "properties": { - "name": { - "type": "string", - "description": "Promotion stack name." - }, - "tiers": { - "type": "object", - "description": "Contains the tier configuration.", - "properties": { - "ids": { - "type": "array", - "description": "Contains the list of tiers in a pre-defined sequence.", - "items": { - "type": "string" + }, + "2_req_create_campaign_promotion": { + "type": "object", + "title": "Promotion", + "description": "Request body schema for creating a promotions campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "PROMOTION", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "promotion": { + "type": "object", + "description": "Define the promotion tiers within the campaign.", + "properties": { + "tiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" + } + } + } } - }, - "hierarchy_mode": { - "type": "string", - "example": "MANUAL" } - } - }, - "category": { - "type": "string", - "description": "Assign a category." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion stack using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" - } - } - }, - "3_res_list_promotion_tiers_from_campaign": { - "type": "object", - "description": "Promotion Tiers", - "title": "Promotion Tiers", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "tiers", - "description": "Identifies the name of the attribute that contains the array of promotion tier objects." - }, - "tiers": { - "type": "array", - "description": "Contains array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of promotion tiers." - }, - "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." - } - } - }, - "4_obj_reward_object": { - "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": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_MATERIAL" - } - ], - "description": "Defines how the reward is generated." - }, - "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.\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." - } - } - }, - "4_obj_reward_object_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" - } - ] - } - } - }, - "4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS": { - "title": "Discount Coupons", - "type": "object", - "description": "These are parameters representing a discount coupon, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "type": { - "type": "string", - "description": "Campaign type.", - "default": "DISCOUNT_COUPONS" - } - } - }, - "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { - "title": "Gift Vouchers", - "type": "object", - "description": "These are parameters representing a gift voucher, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "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", - "description": "Campaign type.", - "default": "GIFT_VOUCHERS" - } - } - }, - "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { - "title": "Points on loyalty card", - "type": "object", - "description": "These are parameters representing points on a loyalty card, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "balance": { - "type": "integer", - "description": "The incremental points to be added to the current balance on the loyalty card." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "default": "LOYALTY_PROGRAM" - } - } - }, - "4_obj_reward_object_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`.", - "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." - } - } - } - } - }, - "4_obj_reward_object_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" - } - } - } - } - }, - "4_req_create_reward": { - "title": "Create Reward Request Body", - "description": "Request body schema for **POST** `/rewards`.", - "anyOf": [ - { - "$ref": "#/components/schemas/4_req_create_reward_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_req_create_reward_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_create_reward_COIN" - } - ] - }, - "4_req_create_reward-copy": { - "title": "Create Reward Request Body", - "type": "object", - "description": "Request body schema for **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "CAMPAIGN", - "COIN", - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "2_req_update_campaign": { + "type": "object", + "title": "Update Campaign Request Body", + "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", + "properties": { + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter or the `category` parameter.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id` parameter." + } } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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." + }, + "2_req_add_vouchers_to_campaign": { + "type": "object", + "title": "Add Vouchers to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers`.", + "properties": { + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher.", + "example": "cat_0b688929a2476386a7" + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + } } - } - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_create_reward_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Request body schema for creating a digital reward using **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "CAMPAIGN" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_create_reward_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Request body schema for creating a pay with points reward using **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "COIN" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_create_reward_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Request body schema to create a material reward using\n **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - "stock": { - "type": "integer", - "description": "The number of units of the product that you want to share as a reward." - }, - "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." + }, + "2_req_add_vouchers_with_specific_code_to_campaign": { + "type": "object", + "title": "Add Vouchers with Specific Code to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers/{code}`.", + "properties": { + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher.", + "example": "cat_0b688929a2476386a7" + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + } } - } - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_update_reward": { - "title": "Update Reward Request Body", - "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", - "anyOf": [ - { - "$ref": "#/components/schemas/4_req_update_reward_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_req_update_reward_COIN" - }, - { - "$ref": "#/components/schemas/4_req_update_reward_MATERIAL" - } - ] - }, - "4_req_update_reward-copy": { - "title": "Update Reward Request Body", - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "2_req_import_vouchers_to_campaign": { + "type": "array", + "title": "Import Vouchers to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/import`.", + "items": { + "$ref": "#/components/schemas/2_obj_import_vouchers_to_campaign_object" } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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." + }, + "2_obj_import_vouchers_to_campaign_object": { + "type": "object", + "title": "Import Vouchers to Campaign", + "description": "Import Vouchers to Campaign", + "properties": { + "code": { + "type": "string", + "description": "Unique custom voucher code." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "loyalty_card": { + "type": "object", + "description": " Assign an initial points balance for a loyalty card. Context: `LOYALTY_PROGRAM`.", + "properties": { + "points": { + "type": "integer", + "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card." + } + } + }, + "gift": { + "type": "object", + "description": "Assign an initial cash balance for a gift card. Context: `GIFT_VOUCHERS`.", + "properties": { + "amount": { + "type": "integer", + "description": "The cash balance to assign to the gift card. This is the current gift card balance." + } + } + } }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a material reward." + "required": [ + "code" + ] + }, + "2_req_examine_qualification": { + "type": "object", + "title": "Examine Qualification Request Body", + "description": "Request body schema for **POST** `/campaigns/qualification`.", + "examples": [], + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + } } - } - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_update_reward_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Request body schema for updating a digital reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_update_reward_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Request body schema for updating a pay with points reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_update_reward_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Request body schema for updating a material reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - "stock": { - "type": "integer", - "description": "The number of units of the product that you want to share as a reward." - }, - "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." + }, + "2_res_examine_qualification": { + "type": "object", + "title": "Examine Qualification Response Body", + "description": "Response body schema for **POST** `/campaigns/qualification`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of campaign objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of campaign objects.", + "items": { + "$ref": "#/components/schemas/2_obj_campaign_object_campaigns_qualification" + } + }, + "total": { + "type": "integer", + "description": "Total valid and active campaigns matching the qualification criteria in given context." + }, + "id": { + "type": "string", + "description": "Unique qualification ID.", + "example": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU" + }, + "created_at": { + "type": "string", + "format": "datetime", + "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", + "example": "2023-04-04T13:13:03.119Z" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + } } - } - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM": { - "title": "Points on loyalty card", - "type": "object", - "description": "Configure a reward that adds points to a loyalty card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the loyalty cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "balance": { - "type": "integer", - "description": "The incremental points to be added to the current balance on the loyalty card." - } - } - }, - "4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS": { - "title": "Gift Vouchers", - "type": "object", - "description": "Configure a reward that adds cash to a gift card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the gift cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "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." - } - } - }, - "4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS": { - "title": "Discount Coupons", - "type": "object", - "description": "Configure a reward that provides a discount coupon. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the vouchers that will be the source of the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - } - } - }, - "4_req_reward_parameters_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Configure 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_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS" - } - ] - } - } - }, - "4_req_reward_parameters_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Configure parameters representing products as a (MATERIAL) reward.", - "properties": { - "product": { - "type": "object", - "description": "Define the product given as a reward.", - "properties": { - "id": { - "type": "string", - "example": "prod_0b7d7dfb05cbe5c616", - "description": "Unique product ID, assigned by Voucherify, given as a reward." - }, - "sku_id": { - "type": [ - "string", - "null" - ], - "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", - "example": "sku_0b7d7dfb090be5c619" + }, + "2_obj_campaign_object_campaigns_qualification": { + "type": "object", + "title": "Campaign Object", + "description": "This is an object representing a campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "GIFT_VOUCHERS", + "DISCOUNT_COUPONS", + "REFERRAL_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + } + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "category": { + "type": "string", + "description": "Unique category name." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "validation_rules_assignments": { + "type": "object", + "description": "Stores information about validation rules assigned to the campaign.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented is by default `list`.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of validation rule assignments.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "asgm_N7t39epaQR2SkQcW", + "description": "Assigned by the Voucherify API, identifies the validation rule assignment." + }, + "rule_id": { + "type": "string", + "example": "val_ssbxf1L9aKri", + "description": "Assigned by the Voucherify API, identifies the validation rule." + }, + "related_object_id": { + "type": "string", + "example": "camp_AaP9MC1Y0GpBII84UTIuasvb", + "description": "ID of the object from which the rule originates." + }, + "related_object_type": { + "type": "string", + "example": "campaign", + "description": "Which object does the rule originate from: the `voucher` itself or inherited from its parent `campaign`." + }, + "created_at": { + "type": "string", + "example": "2022-02-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "validation_rules_assignment", + "description": "The type of resource represented by the object. Default is `validation_rules_assignment`." + }, + "rule": { + "type": "object", + "description": "Describes the details of the rule." + } + } + } + }, + "total": { + "type": "integer", + "description": "Total number of validation rules assigned to the campaign." + } + } + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + }, + "referral_program": { + "type": "object", + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "How a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." + } + } + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "description": "Type of resource represented by the source of the reward." + } + } + }, + "type": { + "type": "string", + "description": "Type of reward.", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ] + }, + "amount": { + "type": "string", + "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + } + } + } + } + } } - } - } - } - }, - "4_req_reward_parameters_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Configure parameters representing a Pay with Points (COIN) reward. ", - "properties": { - "coin": { - "type": "object", - "description": "Define the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.", - "properties": { - "exchange_ratio": { - "type": [ - "string", - "integer" - ], - "description": "The cash equivalent of the points defined in the `points_ratio` property." - }, - "points_ratio": { - "type": [ - "string", - "integer" - ], - "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." + }, + "2_res_list_campaigns": { + "type": "object", + "description": "Schema model for **GET** `/campaigns`.", + "title": "List Campaigns Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of campaign objects.", + "default": "campaigns" + }, + "campaigns": { + "type": "array", + "description": "Contains array of campaign objects.", + "items": { + "$ref": "#/components/schemas/2_obj_campaign_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of campaigns." + } } - } - } - } - }, - "4_res_list_rewards": { - "type": "object", - "description": "Response body schema for **GET** `/rewards`.", - "title": "List Rewards Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about rewards in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of rewards.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of reward objects.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of rewards." - } - } - }, - "4_obj_reward_assignment_object": { - "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", - "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." + }, + "2_obj_campaign_object_voucher_object_DISCOUNT": { + "type": "object", + "description": "Schema model for a discount voucher.", + "title": "Discount Voucher", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher." + }, + "discount": { + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ], + "description": "Defines the voucher discount type and details." + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." } } - } - }, - "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", - "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." - } - } - }, - "4_res_list_reward_assignments": { - "type": "object", - "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", - "title": "List Reward Assignments Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about reward assignments in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of reward assignments.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of reward assignments." - } - } - }, - "4_req_update_reward_assignment": { - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", - "title": "Update Reward Assignment Request Body", - "properties": { - "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": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." + }, + "2_obj_campaign_object_voucher_object_GIFT_CARD": { + "type": "object", + "description": "Schema model for a gift card.", + "title": "Gift Card", + "properties": { + "type": { + "type": "string", + "default": "GIFT_VOUCHER", + "description": "Type of voucher." + }, + "gift": { + "description": "Defines the gift card details.", + "type": "object", + "properties": { + "amount": { + "type": "integer", + "description": "Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "description": "Defines how the credits are applied to the customer's order.", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ] + } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." } } - } - } - } - }, - "4_req_create_reward_assignment": { - "type": "object", - "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" - ], - "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." + }, + "2_obj_campaign_object_voucher_object_LOYALTY_CARD": { + "type": "object", + "description": "Schema model for a loyalty card.", + "title": "Loyalty Card", + "properties": { + "type": { + "type": "string", + "default": "LOYALTY_CARD", + "description": "Type of voucher." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." + } + } + } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." } } - } - } - }, - "required": [ - "campaign", - "parameters" - ] - }, - "5_obj_publication_object": { - "title": "Publication Object", - "type": "object", - "description": "This is an object representing a publication. ", - "x-tags": [ - "PUBLICATIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", - "description": "Unique publication ID, assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "publication", - "description": "The type of object represented by the JSON. This object stores information about the publication." - }, - "created_at": { - "type": "string", - "example": "2022-09-23T09:57:00.434Z", - "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", - "format": "date-time" - }, - "customer_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of the customer receiving the publication." - }, - "tracking_id": { - "type": "string", - "description": "Customer's `source_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Status of the publication attempt." - }, - "customer": { - "type": "object", - "description": "Contains information about the customer to whom the publication was directed.", - "properties": { - "id": { - "type": "string", - "description": "Unique customer ID, assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's name." - }, - "email": { - "type": "string", - "description": "Customer's email." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "object": { - "type": "string", - "default": "customer", - "description": "The type of object represented by the JSON. This object stores information about the customer." + }, + "2_req_campaign_object_voucher_object_LOYALTY_CARD": { + "type": "object", + "description": "Schema model for a loyalty card.", + "title": "Loyalty Card", + "properties": { + "type": { + "type": "string", + "default": "LOYALTY_CARD", + "description": "Type of voucher." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." + } + } + } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + } } - } - }, - "voucher": { - "description": "Contains information about the voucher being published.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_obj_publication_object_discount" - }, - { - "$ref": "#/components/schemas/5_obj_publication_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/5_obj_publication_object_gift_card" + }, + "3_obj_promotion_tier_object": { + "type": "object", + "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.", + "title": "Promotion Tier Object", + "x-tags": [ + "PROMOTIONS API" + ], + "properties": { + "id": { + "type": "string", + "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "description": "Unique promotion tier ID." + }, + "created_at": { + "type": "string", + "example": "2021-12-15T11:34:01.333Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion tier was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-02-09T09:20:05.603Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion tier was updated in ISO 8601 format." + }, + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website." + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ], + "description": "The type of discount that will be applied to a customer's order." + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "campaign": { + "type": "object", + "description": "Contains details about promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-22T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](ref:disable-campaign) endpoint. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "category_id": { + "type": "string", + "example": "cat_0b688929a2476386a6", + "description": "Unique category ID that this campaign belongs to." + }, + "object": { + "type": "string", + "description": "The type of object represented by the campaign object. This object stores information about the campaign.", + "default": "campaign" + } + } + }, + "campaign_id": { + "type": "string", + "description": "Promotion tier's parent campaign's unique ID." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "summary": { + "type": "object", + "description": "Contains statistics about promotion tier redemptions and orders.", + "properties": { + "redemptions": { + "type": "object", + "description": "Contains statistics about promotion tier redemptions.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Number of times the promotion tier was redeemed." + } + } + }, + "orders": { + "type": "object", + "description": "Contains statistics about orders related to the promotion tier.", + "properties": { + "total_amount": { + "type": "integer", + "description": "Sum of order totals." + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of total discount applied using the promotion tier." + } + } + } + } + }, + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + }, + "validation_rule_assignments": { + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + }, + "category_id": { + "type": "string", + "description": "Promotion tier category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion tier." + } } - ] - }, - "vouchers_id": { - "type": "array", - "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", - "items": { - "type": "string", - "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" - } - } - } - }, - "5_req_create_publication_standalone_voucher": { - "title": "Standalone Voucher", - "type": "object", - "description": "Create publication for standalone voucher.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "3_req_add_promotion_tier_to_campaign": { + "type": "object", + "description": "Request body schema for creating a promotion tier within a campaign in **POST** `/promotions/{campaignId}/tiers`.", + "title": "Add Promotion Tier to Campaign Request Body", + "properties": { + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.\t" + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ], + "description": "The type of discount that will be applied to a customer's order." + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "validation_rules": { + "type": "array", + "description": "Array containing the ID of the validation rule associated with the promotion tier.", + "items": { + "type": "string" + } + }, + "category": { + "type": "string", + "description": "Assign category to the promotion tier." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "5_req_create_publication_from_campaign": { - "title": "Voucher from Campaign", - "description": "Create a publication for a voucher from a campaign.", - "oneOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_auto_update" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_one_specific_voucher" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_multiple_vouchers" - } - ] - }, - "5_req_create_publication_from_campaign_auto_update": { - "title": "Voucher from Auto-Update Campaign", - "type": "object", - "description": "Create a publication for a voucher from an auto-update campaign. It will choose the next available voucher.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "3_req_update_promotion_tier": { + "type": "object", + "description": "Request body schema for updating a promotion tier within a campaign in **POST** `/promotions/tiers/{promotionTierId}`.", + "title": "Update Promotion Tier Request Body", + "properties": { + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.\t" + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ], + "description": "The type of discount that will be applied to a customer's order." + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. If you update a hierarchy of a promotion tier, then the remaining promotion tier hierarchies will be recalculated." + }, + "category": { + "type": "string", + "description": "Assign a new or update the promotion tier's category." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } } - ] - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "5_req_create_publication_from_campaign_one_specific_voucher": { - "title": "Voucher from Campaign", - "type": "object", - "description": "Create a publication for a specific voucher code from a campaign.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "3_res_list_promotion_tiers": { + "type": "object", + "description": "Promotion Tiers", + "title": "Promotion Tiers", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "tiers", + "description": "Identifies the name of the attribute that contains the array of promotion tier objects." + }, + "tiers": { + "type": "array", + "description": "Contains array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion tiers." + } } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "5_req_create_publication_from_campaign_multiple_vouchers": { - "title": "Vouchers from Campaign", - "type": "object", - "description": "Create a publication of multiple vouchers from a campaign.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "3_res_list_promotion_stacks": { + "type": "object", + "description": "Promotion Stacks", + "title": "Promotion Stacks", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of promotion stack objects." + }, + "data": { + "type": "array", + "description": "Contains array of promotion stack objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion stacks." + } } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "object", - "description": "Contains name of source campaign and number of vouchers to be published.", - "properties": { - "name": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "count": { - "type": "string", - "description": "Number of vouchers to be published to customer." + }, + "3_obj_promotion_stack_object": { + "type": "object", + "title": "Promotion Stack Object", + "description": "Model schema for a promotion stack.", + "properties": { + "id": { + "type": "string", + "example": "stack_p0WhtyyDU95crobleMpRabhH", + "description": "Unique promotion stack ID." + }, + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "created_at": { + "type": "string", + "example": "2022-09-22T13:03:25.740Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-09-23T07:59:44.172Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." + }, + "campaign_id": { + "type": "string", + "example": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "description": "Promotion stack's parent campaign's unique ID." + }, + "object": { + "type": "string", + "default": "promotion_stack", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + }, + "tiers": { + "type": "object", + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" + } + }, + "hierarchy_mode": { + "type": "string", + "default": "MANUAL" + } + } + }, + "category_id": { + "type": "string", + "description": "Promotion stack category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion stack." + } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "5_req_create_publication": { - "title": "Create Publication Request Body", - "description": "Request body schema for publishing a voucher.", - "oneOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_standalone_voucher" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign" - } - ] - }, - "5_res_create_publication": { - "title": "Create Publication Response Body", - "type": "object", - "description": "Response schema model for publishing a voucher to a specific customer.", - "properties": { - "id": { - "type": "string", - "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", - "description": "Unique publication ID, assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "publication", - "description": "The type of object represented by the JSON. This object stores information about the `publication`." - }, - "created_at": { - "type": "string", - "example": "2022-09-23T09:57:00.434Z", - "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", - "format": "date-time" - }, - "customer_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of the customer receiving the publication." - }, - "tracking_id": { - "type": "string", - "description": "Customer's `source_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Status of the publication attempt." - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique customer ID, assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's name." - }, - "email": { - "type": "string", - "description": "Customer's email." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "object": { - "type": "string", - "default": "customer", - "description": "The type of object represented by the JSON. This object stores information about the `customer`." + }, + "3_req_create_promotion_stack": { + "type": "object", + "title": "Create Promotion Stack Request Body", + "description": "Model schema for a creating a promotion stack using **POST** `/promotions/{campaignId}/stacks`.", + "properties": { + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "tiers": { + "type": "object", + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" + } + }, + "hierarchy_mode": { + "type": "string", + "example": "MANUAL" + } + } + }, + "category": { + "type": "string", + "description": "Assign a category." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion stack using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } } - } - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "vouchers_id": { - "type": "array", - "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", - "items": { - "type": "string", - "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" - } - } - } - }, - "5_req_create_publication_campaign_id": { - "title": "Campaign ID", - "type": "object", - "description": "Campaign's unique ID assigned by Voucherify.", - "properties": { - "id": { - "type": "string", - "example": "camp_7AZCZeF1VvD6EHC5anAMtvcK", - "description": "Unique campaign ID, assigned by Voucherify." - } - } - }, - "5_req_create_publication_campaign_name": { - "title": "Campaign's name", - "type": "object", - "description": "Campaign's name.", - "properties": { - "name": { - "type": "string", - "example": "Summer Campaign", - "description": "Campaign's name." - } - } - }, - "5_req_create_publication_campaign": { - "title": "Campaign's name or ID", - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. " - }, - "5_res_create_publication_customer_id": { - "title": "Customer ID", - "type": "object", - "description": "Customer's unique ID assigned by Voucherify.", - "properties": { - "id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID, assigned by Voucherify." - } - } - }, - "5_res_create_publication_customer_source_id": { - "title": "Customer's Source ID", - "type": "object", - "description": "The merchant’s customer ID.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - } - } - }, - "5_req_create_publication_customer": { - "title": "Source ID or Unique Customer ID", - "type": "string", - "description": "Customer's unique ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`, or the merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "5_obj_publication_object_discount": { - "title": "Discount Voucher", - "type": "object", - "description": "This is an object representing a publication of a discount voucher. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + }, + "3_res_list_promotion_tiers_from_campaign": { + "type": "object", + "description": "Promotion Tiers", + "title": "Promotion Tiers", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "tiers", + "description": "Identifies the name of the attribute that contains the array of promotion tier objects." + }, + "tiers": { + "type": "array", + "description": "Contains array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion tiers." + }, + "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." + } } - ] - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_obj_publication_object_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "This is an object representing a publication of a loyalty card. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "loyalty_card": { - "type": "object", - "description": "Contains information about the loyalty card being published.", - "properties": { - "points": { - "type": "integer", - "description": "The incremental points to be added to the loyalty card as the initial balance on the card." - }, - "balance": { - "type": "integer", - "description": "The points balance after the incremental points are added to the loyalty card." + }, + "4_obj_reward_object": { + "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": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_MATERIAL" + } + ], + "description": "Defines how the reward is generated." + }, + "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.\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." + } } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_obj_publication_object_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "This is an object representing a publication of a gift card. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "gift": { - "type": "object", - "description": "Contains information about the gift card being published.", - "properties": { - "amount": { - "type": "integer", - "description": "The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "How the credits are applied to the customer's order." + }, + "4_obj_reward_object_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" + } + ] + } } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_res_list_publications": { - "type": "object", - "description": "Response body schema for listing publications using **GET** `/publications`.", - "title": "List Publications Response Body", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about publications in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "publications", - "description": "Identifies the name of the attribute that contains the array of publications." - }, - "publications": { - "type": "array", - "description": "Contains array of publication objects.", - "items": { - "$ref": "#/components/schemas/5_obj_publication_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of publications." - } - } - }, - "6_obj_validation_object": { - "title": "Validation Object", - "description": "This is an object representing a validation.", - "x-tags": [ - "VALIDATIONS API" - ], - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - }, - { - "$ref": "#/components/schemas/6_res_validate_promotion_object" - } - ] - }, - "6_req_validate_voucher": { - "title": "Validate Voucher Request Body", - "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_loyalty_card" - } - ] - }, - "6_req_validate_voucher_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } - } - }, - "6_req_rollback_redemption_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption rollback in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } - } - }, - "6_req_validate_voucher_customer_id_string": { - "type": "string", - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "6_req_validate_voucher_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer that validates a voucher. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } - } - }, - "6_req_rollback_redemption_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer that redeemed a resource. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } - } - }, - "6_req_validate_voucher_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." - } - } - }, - "6_req_validate_voucher_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption of this request." - } - } - }, - "6_req_rollback_redemption_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption rollback of this request." - }, - "status": { - "type": "string", - "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", - "enum": [ - "CREATED", - "PAID", - "FULFILLED" - ] - } - } - }, - "6_req_rollback_redemption_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption rollback of this request." - }, - "status": { - "type": "string", - "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", - "enum": [ - "CREATED", - "PAID", - "FULFILLED" - ] - } - } - }, - "6_req_validate_voucher_discount_code": { - "title": "Discount Code", - "type": "object", - "description": "Request schema model for validating a discount code voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_discount_code" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS": { + "title": "Discount Coupons", + "type": "object", + "description": "These are parameters representing a discount coupon, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "type": { + "type": "string", + "description": "Campaign type.", + "default": "DISCOUNT_COUPONS" + } } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { + "title": "Gift Vouchers", + "type": "object", + "description": "These are parameters representing a gift voucher, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "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", + "description": "Campaign type.", + "default": "GIFT_VOUCHERS" + } } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "6_req_validate_voucher_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Request schema model for validating a gift card voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_gift_card" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { + "title": "Points on loyalty card", + "type": "object", + "description": "These are parameters representing points on a loyalty card, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "balance": { + "type": "integer", + "description": "The incremental points to be added to the current balance on the loyalty card." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "default": "LOYALTY_PROGRAM" + } } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "4_obj_reward_object_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`.", + "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." + } + } + } } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "4_obj_reward_object_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" + } + } + } } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "6_req_validate_voucher_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Request schema model for validating a loyalty card voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." + }, + "4_req_create_reward": { + "title": "Create Reward Request Body", + "description": "Request body schema for **POST** `/rewards`.", + "anyOf": [ + { + "$ref": "#/components/schemas/4_req_create_reward_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_req_create_reward_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_create_reward_COIN" + } + ] + }, + "4_req_create_reward-copy": { + "title": "Create Reward Request Body", + "type": "object", + "description": "Request body schema for **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN", + "COIN", + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + } + ], + "description": "Defines how the reward is generated." + }, + "stock": { + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." + }, + "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": "string", + "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." + } } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "4_req_create_reward_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Request body schema for creating a digital reward using **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "metadata": { + "type": "string", + "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": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "4_req_create_reward_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Request body schema for creating a pay with points reward using **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "COIN" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + "metadata": { + "type": "string", + "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": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "6_req_validate_voucher_unpublished_discount_code": { - "title": "Unpublished Discount Code", - "type": "object", - "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "type": "string" - } - } - }, - "6_req_session_lock_discount_code": { - "title": "Discount Code Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_req_session_lock_gift_card": { - "title": "Gift Card Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_req_session_lock_loyalty_card": { - "title": "Loyalty Card Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_res_session_lock_discount_voucher": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. ", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_res_session_lock_gift_card": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_res_session_lock_loyalty_card": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "6_res_validate_voucher_false": { - "type": "object", - "title": "Not Valid", - "description": "Response schema for a voucher that is not valid.", - "examples": [ - { - "valid": false, - "reason": "voucher is disabled", - "error": { - "message": "Voucher has been disabled and is not active anymore." }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "code": "WFf5XAUc", - "metadata": {} - }, - { - "valid": false, - "reason": "Customer must be a holder of a loyalty card.", - "error": { - "message": "You are not the right person." + "4_req_create_reward_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Request body schema to create a material reward using\n **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + "stock": { + "type": "integer", + "description": "The number of units of the product that you want to share as a reward." + }, + "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": "string", + "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." + } + } }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "code": "3TCjkel8", - "metadata": {} - }, - { - "valid": false, - "reason": "loyalty card points exceeded", - "error": { - "message": "You need more loyalty points to be able to redeem a reward." + "4_req_update_reward": { + "title": "Update Reward Request Body", + "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", + "anyOf": [ + { + "$ref": "#/components/schemas/4_req_update_reward_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_req_update_reward_COIN" + }, + { + "$ref": "#/components/schemas/4_req_update_reward_MATERIAL" + } + ] }, - "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", - "code": "pfeDMTsj", - "metadata": {} - }, - { - "valid": false, - "reason": "order does not match validation rules", - "error": { - "code": 400, - "key": "order_rules_violated", - "message": "order does not match validation rules", - "details": "Loyalty Card cannot be redeemed because of violated validation rules: val_RU9fm8GiQaRT", - "request_id": "v-0bcbde194f1305ad88" - }, - "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", - "code": "pfeDMTsj", - "metadata": {} - } - ], - "properties": { - "valid": { - "type": "boolean", - "default": false, - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "reason": { - "type": "string", - "description": "System generated cause for the voucher being invalid in the context of the provided parameters." - }, - "error": { - "type": "object", - "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", - "properties": { - "message": { - "type": "string", - "description": "Customized error message." + "4_req_update_reward-copy": { + "title": "Update Reward Request Body", + "type": "object", + "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + } + ], + "description": "Defines how the reward is generated." + }, + "stock": { + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." + }, + "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": "string", + "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." + } } - } - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "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." - } - } - }, - "6_res_validate_voucher_discount_amount": { - "title": "Amount Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Defines the type of voucher." - }, - "effect": { - "type": "string", - "description": "Defines how the discount is applied to the customer's order.", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ] - }, - "amount_off": { - "type": "integer", - "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. " - } - } - }, - "6_res_validate_voucher_discount_percent": { - "title": "Percent Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "PERCENT", - "description": "Defines the type of voucher." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "percent_off": { - "type": "integer", - "description": "The percent discount that the customer will receive." - }, - "amount_limit": { - "type": "integer", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount was calculated using a formula." - } - } - }, - "6_res_validate_voucher_discount_fixed": { - "title": "Fixed Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value. A fixed discounts sets a fixed total on cart or item(s) and then calculates the discount to apply.", - "properties": { - "type": { - "type": "string", - "default": "FIXED", - "description": "Type of discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order. \n \n| **Effect** | **Definition** |\n|---|---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. |\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is calculated during the redemption and it's a difference between the initial item price and the fixed amount. |" - }, - "fixed_amount": { - "type": "integer", - "description": "Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value." - } - } - }, - "6_res_validate_voucher_discount_unit": { - "title": "Unit Discount, single item", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "oneOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku" - } - ] - }, - "6_res_validate_voucher_discount_unit_product": { - "title": "Unit Discount, Product", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "prod_0a9f9ab4ab019a42d5", - "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." - }, - "product": { - "type": "object", - "description": "Contains information about the product.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID, assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product's source ID." - }, - "name": { - "type": "string", - "description": "Product name." + }, + "4_req_update_reward_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Request body schema for updating a digital reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "metadata": { + "type": "string", + "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." + } } - } - } - } - }, - "6_res_validate_voucher_discount_unit_sku": { - "title": "Unit Discount, SKU", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." - }, - "sku": { - "type": "object", - "description": "Contains information about the SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "Unique SKU ID, assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product variant's source ID." - }, - "sku": { - "type": "string", - "description": "Product varient's name." + }, + "4_req_update_reward_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Request body schema for updating a pay with points reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + "metadata": { + "type": "string", + "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." + } } - } - }, - "product": { - "type": "object", - "description": "Contains information about the parent product.", - "properties": { - "id": { - "type": "string", - "description": "Unique parent product ID, assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "Source ID of parent product." - }, - "name": { - "type": "string", - "description": "Name of parent product." + }, + "4_req_update_reward_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Request body schema for updating a material reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + "stock": { + "type": "integer", + "description": "The number of units of the product that you want to share as a reward." + }, + "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": "string", + "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." + } } - } - } - } - }, - "6_res_validate_voucher_discount_unit_multiple": { - "title": "Unit Discount, multiple items", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "default": "ADD_MANY_ITEMS", - "description": "Defines how the discount is applied to the customer's order." - }, - "units": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku_multiple" + }, + "4_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM": { + "title": "Points on loyalty card", + "type": "object", + "description": "Configure a reward that adds points to a loyalty card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the loyalty cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "balance": { + "type": "integer", + "description": "The incremental points to be added to the current balance on the loyalty card." + } } - ] - } - } - }, - "6_res_validate_voucher_discount_unit_product_multiple": { - "title": "Product Item", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "prod_0a9f9ab4ab019a42d5", - "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." - }, - "product": { - "type": "object", - "description": "Contains information about the product.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID, assigned by Voucherify.", - "example": "prod_0a9f9ab4ab019a42d5" - }, - "source_id": { - "type": "string", - "description": "Product's source ID." - }, - "name": { - "type": "string", - "description": "Product name." - } - } - } - } - }, - "6_res_validate_voucher_discount_unit_sku_multiple": { - "title": "SKU Item", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." - }, - "sku": { - "type": "object", - "description": "Contains information about the SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "Unique SKU ID, assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product variant's source ID." - }, - "sku": { - "type": "string", - "description": "Product varient's name." - } - } - }, - "product": { - "type": "object", - "description": "Contains information about the parent product.", - "properties": { - "id": { - "type": "string", - "description": "Unique parent product ID, assigned by Voucherify.", - "example": "prod_0b7d7dfb05cbe5c616" - }, - "source_id": { - "type": "string", - "description": "Source ID of parent product." - }, - "name": { - "type": "string", - "description": "Name of parent product." + }, + "4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS": { + "title": "Gift Vouchers", + "type": "object", + "description": "Configure a reward that adds cash to a gift card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the gift cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "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." + } } - } - } - } - }, - "6_res_validate_voucher_discount_shipping": { - "title": "Shipping Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "description": "Defines how the unit is added to the customer's order.", - "default": "ADD_MISSING_ITEMS" - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount.", - "default": 1 - }, - "unit_type": { - "type": "string", - "description": "The shipping \"product\" deemed as free.", - "default": "prod_5h1pp1ng" - }, - "product": { - "type": "object", - "description": "Contains information about the shipping \"product\".", - "properties": { - "id": { - "type": "string", - "description": "Unique shipping \"product\" ID, assigned by Voucherify.", - "default": "prod_5h1pp1ng" - }, - "source_id": { - "type": "string", - "description": "\"Product's\" source ID.", - "default": "5h1pp1ng" - }, - "name": { - "type": "string", - "description": "\"Product\" name.", - "default": "Shipping" + }, + "4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS": { + "title": "Discount Coupons", + "type": "object", + "description": "Configure a reward that provides a discount coupon. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the vouchers that will be the source of the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + } } - } - } - } - }, - "6_res_validate_voucher": { - "title": "Valid", - "description": "Response schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" - } - ] - }, - "6_res_validate_voucher_discount_code": { - "type": "object", - "title": "Valid - Discount Code", - "description": "Response schema model for validating a discount code using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + }, + "4_req_reward_parameters_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Configure 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_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS" + } + ] + } } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_discount_voucher" - } - } - }, - "6_res_validate_voucher_gift_card": { - "type": "object", - "title": "Valid - Gift Card", - "description": "Response schema model for validating a gift card using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "gift": { - "type": "object", - "description": "Contains current gift card balance information.", - "properties": { - "amount": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "description": "Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the credits are applied to the customer's order." + }, + "4_req_reward_parameters_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Configure parameters representing products as a (MATERIAL) reward.", + "properties": { + "product": { + "type": "object", + "description": "Define the product given as a reward.", + "properties": { + "id": { + "type": "string", + "example": "prod_0b7d7dfb05cbe5c616", + "description": "Unique product ID, assigned by Voucherify, given as a reward." + }, + "sku_id": { + "type": [ + "string", + "null" + ], + "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", + "example": "sku_0b7d7dfb090be5c619" + } + } + } } - } - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_gift_card" - } - } - }, - "6_res_validate_voucher_loyalty_card": { - "type": "object", - "title": "Valid - Loyalty Card", - "description": "Response schema model for validating a loyalty card using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "loyalty": { - "type": "object", - "description": "Contains the cost of reward in points.", - "properties": { - "points_cost": { - "type": "integer", - "description": "Number of points that wlil be deducted from loyaty card for the associated reward." + }, + "4_req_reward_parameters_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Configure parameters representing a Pay with Points (COIN) reward. ", + "properties": { + "coin": { + "type": "object", + "description": "Define the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.", + "properties": { + "exchange_ratio": { + "type": [ + "string", + "integer" + ], + "description": "The cash equivalent of the points defined in the `points_ratio` property." + }, + "points_ratio": { + "type": [ + "string", + "integer" + ], + "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." + } + } + } } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that is being validated.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify.", - "example": "rew_Crmu3hu2FKZWZIML59AeAs1n" - }, - "assignment_id": { - "type": "string", - "example": "rewa_xZr6Ks0j5AHeMRVdELmpI9sc", - "description": "Unique reward assignment ID assigned by Voucherify." - }, - "points": { - "type": "integer", - "description": "Number of points applied to the reward." + }, + "4_res_list_rewards": { + "type": "object", + "description": "Response body schema for **GET** `/rewards`.", + "title": "List Rewards Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about rewards in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of rewards.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of reward objects.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of rewards." + } } - } - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_loyalty_card" - } - } - }, - "6_res_applicable_to_object": { - "title": "Included Items", - "type": "object", - "description": "Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.", - "properties": { - "data": { - "type": "array", - "description": "Contains array of items to which the discount can apply.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_product_collection" + }, + "4_obj_reward_assignment_object": { + "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." }, - { - "$ref": "#/components/schemas/6_res_product_collection_unit" + "reward_id": { + "type": "string", + "description": "Associated reward ID.", + "example": "rew_C7wS9eHFDN4CIbXI5PpLSkGY" }, - { - "$ref": "#/components/schemas/6_res_product_collection_fixed_amount" + "related_object_id": { + "type": "string", + "description": "Related object ID to which the reward was assigned.", + "example": "camp_wciTvaOfYmAa3EmIIW3QpXXZ" }, - { - "$ref": "#/components/schemas/6_res_product" + "related_object_type": { + "type": "string", + "description": "Related object type to which the reward was assigned.", + "example": "campaign" }, - { - "$ref": "#/components/schemas/6_res_product_unit" + "parameters": { + "description": "Defines the cost of the reward.", + "type": "object", + "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." + } + } + } + } }, - { - "$ref": "#/components/schemas/6_res_product_fixed_amount" + "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" }, - { - "$ref": "#/components/schemas/6_res_sku" + "updated_at": { + "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" }, - { - "$ref": "#/components/schemas/6_res_sku_unit" + "object": { + "type": "string", + "default": "reward_assignment", + "description": "The type of object represented by the JSON. This object stores information about the reward assignment." + } + } + }, + "4_res_list_reward_assignments": { + "type": "object", + "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", + "title": "List Reward Assignments Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about reward assignments in a dictionary.", + "default": "list" }, - { - "$ref": "#/components/schemas/6_res_sku_unit_fixed_amount" + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of reward assignments.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of reward assignments." + } + } + }, + "4_req_update_reward_assignment": { + "type": "object", + "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", + "title": "Update Reward Assignment Request Body", + "properties": { + "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": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." + } + } + } + } + } + } + }, + "4_req_create_reward_assignment": { + "type": "object", + "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" + ], + "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" ] - } - }, - "total": { - "type": "integer", - "description": "Total number of objects defining included products, SKUs, or product collections." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of included objects." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary." - } - } - }, - "6_res_inapplicable_to_object": { - "title": "Excluded Items", - "type": "object", - "description": "Contains list of items that **do not** qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These **CANNOT** be discounted.", - "properties": { - "data": { - "description": "Contains array of items to which the discount cannot apply.", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_product_collection_excluded" + }, + "5_obj_publication_object": { + "title": "Publication Object", + "type": "object", + "description": "This is an object representing a publication. ", + "x-tags": [ + "PUBLICATIONS API" + ], + "properties": { + "id": { + "type": "string", + "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", + "description": "Unique publication ID, assigned by Voucherify." }, - { - "$ref": "#/components/schemas/6_res_product_excluded" + "object": { + "type": "string", + "default": "publication", + "description": "The type of object represented by the JSON. This object stores information about the publication." }, - { - "$ref": "#/components/schemas/6_res_sku_excluded" + "created_at": { + "type": "string", + "example": "2022-09-23T09:57:00.434Z", + "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", + "format": "date-time" + }, + "customer_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of the customer receiving the publication." + }, + "tracking_id": { + "type": "string", + "description": "Customer's `source_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Status of the publication attempt." + }, + "customer": { + "type": "object", + "description": "Contains information about the customer to whom the publication was directed.", + "properties": { + "id": { + "type": "string", + "description": "Unique customer ID, assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's name." + }, + "email": { + "type": "string", + "description": "Customer's email." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "object": { + "type": "string", + "default": "customer", + "description": "The type of object represented by the JSON. This object stores information about the customer." + } + } + }, + "voucher": { + "description": "Contains information about the voucher being published.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_obj_publication_object_discount" + }, + { + "$ref": "#/components/schemas/5_obj_publication_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/5_obj_publication_object_gift_card" + } + ] + }, + "vouchers_id": { + "type": "array", + "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", + "items": { + "type": "string", + "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" + } + } + } + }, + "5_req_create_publication_standalone_voucher": { + "title": "Standalone Voucher", + "type": "object", + "description": "Create publication for standalone voucher.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ] + }, + "voucher": { + "description": "Code of voucher being published.", + "type": "string" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign": { + "title": "Voucher from Campaign", + "description": "Create a publication for a voucher from a campaign.", + "oneOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_auto_update" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_one_specific_voucher" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_multiple_vouchers" } ] - } - }, - "total": { - "type": "integer", - "description": "Total number of objects defining excluded products, SKUs, or product collections." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of excluded objects." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary." - } - } - }, - "6_res_product_collection": { - "title": "Product Collection", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product_collection_unit": { - "title": "Product Collection for Unit Discount", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." - }, - "aggregated_quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." - } - } - }, - "6_res_product_collection_fixed_amount": { - "title": "Product Collection for Fixed Amount Discount", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "price": { - "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." - }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "\"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product_collection_excluded": { - "title": "Product Collection", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_sku": { - "title": "SKU", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "product_id": { - "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." - }, - "product_source_id": { - "type": "string", - "description": "Parent product's source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_sku_unit": { - "title": "SKU for Unit Discount", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "product_id": { - "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." - }, - "product_source_id": { - "type": "string", - "description": "Parent product's source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." - }, - "aggregated_quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." - } - } - }, - "6_res_sku_unit_fixed_amount": { - "title": "SKU for Amount Discount", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "product_id": { - "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." - }, - "product_source_id": { - "type": "string", - "description": "Parent product's source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "price": { - "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." - }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_sku_excluded": { - "title": "SKU", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product": { - "title": "Product", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product_unit": { - "title": "Product for Unit Discount", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." - }, - "aggregated_quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." - } - } - }, - "6_res_product_fixed_amount": { - "title": "Product for Fixed Amount Discount", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "price": { - "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." - }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product_excluded": { - "title": "Product", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This product stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_obj_order_object": { - "title": "Order object", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "oneOf": [ - { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" - }, - { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_items" - } - ] - }, - "6_obj_order_object_apply_to_order": { - "type": "object", - "title": "Order object - Effect: Apply to order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "status": { - "type": "string", - "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the order-level discount applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "This field sums up all order-level discounts applied to the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + }, + "5_req_create_publication_from_campaign_auto_update": { + "title": "Voucher from Auto-Update Campaign", "type": "object", + "description": "Create a publication for a voucher from an auto-update campaign. It will choose the next available voucher.", "properties": { - "object": { + "source_id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " }, - "product_id": { + "channel": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] }, - "sku_id": { + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ] + }, + "campaign": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign_one_specific_voucher": { + "title": "Voucher from Campaign", + "type": "object", + "description": "Create a publication for a specific voucher code from a campaign.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ] }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "voucher": { + "description": "Code of voucher being published.", + "type": "string" }, - "product": { + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "metadata": { "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign_multiple_vouchers": { + "title": "Vouchers from Campaign", + "type": "object", + "description": "Create a publication of multiple vouchers from a campaign.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ] + }, + "voucher": { + "description": "Code of voucher being published.", + "type": "string" + }, + "campaign": { + "type": "object", + "description": "Contains name of source campaign and number of vouchers to be published.", + "properties": { "name": { "type": "string", - "example": "Brewing System", - "description": "Product name." + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "count": { + "type": "string", + "description": "Number of vouchers to be published to customer." } } }, - "sku": { + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication": { + "title": "Create Publication Request Body", + "description": "Request body schema for publishing a voucher.", + "oneOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_standalone_voucher" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign" + } + ] + }, + "5_res_create_publication": { + "title": "Create Publication Response Body", + "type": "object", + "description": "Response schema model for publishing a voucher to a specific customer.", + "properties": { + "id": { + "type": "string", + "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", + "description": "Unique publication ID, assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "publication", + "description": "The type of object represented by the JSON. This object stores information about the `publication`." + }, + "created_at": { + "type": "string", + "example": "2022-09-23T09:57:00.434Z", + "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", + "format": "date-time" + }, + "customer_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of the customer receiving the publication." + }, + "tracking_id": { + "type": "string", + "description": "Customer's `source_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Status of the publication attempt." + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", "type": "object", - "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Unique customer ID, assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" }, - "source_id": { + "name": { "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "description": "Customer's name." }, - "sku": { + "email": { "type": "string", - "description": "SKU name." + "description": "Customer's email." }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "object": { + "type": "string", + "default": "customer", + "description": "The type of object represented by the JSON. This object stores information about the `customer`." } } + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "vouchers_id": { + "type": "array", + "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", + "items": { + "type": "string", + "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" + } } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." + }, + "5_req_create_publication_campaign_id": { + "title": "Campaign ID", + "type": "object", + "description": "Campaign's unique ID assigned by Voucherify.", + "properties": { + "id": { + "type": "string", + "example": "camp_7AZCZeF1VvD6EHC5anAMtvcK", + "description": "Unique campaign ID, assigned by Voucherify." + } } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." + }, + "5_req_create_publication_campaign_name": { + "title": "Campaign's name", + "type": "object", + "description": "Campaign's name.", + "properties": { + "name": { + "type": "string", + "example": "Summer Campaign", + "description": "Campaign's name." + } } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "6_obj_order_object_apply_to_items": { - "type": "object", - "title": "Order object - Effect: Apply to items", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "status": { - "type": "string", - "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Product-specifc discounts applied to all the items." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Product-specific discounts applied in the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + }, + "5_req_create_publication_campaign": { + "title": "Campaign's name or ID", + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. " + }, + "5_res_create_publication_customer_id": { + "title": "Customer ID", "type": "object", + "description": "Customer's unique ID assigned by Voucherify.", "properties": { - "object": { + "id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID, assigned by Voucherify." + } + } + }, + "5_res_create_publication_customer_source_id": { + "title": "Customer's Source ID", + "type": "object", + "description": "The merchant’s customer ID.", + "properties": { + "source_id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + } + } + }, + "5_req_create_publication_customer": { + "title": "Source ID or Unique Customer ID", + "type": "string", + "description": "Customer's unique ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`, or the merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "5_obj_publication_object_discount": { + "title": "Discount Voucher", + "type": "object", + "description": "This is an object representing a publication of a discount voucher. ", + "properties": { + "code": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Voucher code." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ] }, - "applied_discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." + } + } + }, + "5_obj_publication_object_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "This is an object representing a publication of a loyalty card. ", + "properties": { + "code": { + "type": "string", + "description": "Voucher code." }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." }, - "product": { + "loyalty_card": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "Contains information about the loyalty card being published.", "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." + "points": { + "type": "integer", + "description": "The incremental points to be added to the loyalty card as the initial balance on the card." }, - "price": { + "balance": { "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "The points balance after the incremental points are added to the loyalty card." } } }, - "sku": { + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." + } + } + }, + "5_obj_publication_object_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "This is an object representing a publication of a gift card. ", + "properties": { + "code": { + "type": "string", + "description": "Voucher code." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." + }, + "gift": { "type": "object", - "description": "This object stores more information about the related SKU.", + "description": "Contains information about the gift card being published.", "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "amount": { + "type": "integer", + "description": "The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, - "sku": { + "effect": { "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "How the credits are applied to the customer's order." } } + }, + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." + }, + "5_res_list_publications": { + "type": "object", + "description": "Response body schema for listing publications using **GET** `/publications`.", + "title": "List Publications Response Body", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about publications in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "publications", + "description": "Identifies the name of the attribute that contains the array of publications." + }, + "publications": { + "type": "array", + "description": "Contains array of publication objects.", + "items": { + "$ref": "#/components/schemas/5_obj_publication_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of publications." + } } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." + }, + "6_obj_validation_object": { + "title": "Validation Object", + "description": "This is an object representing a validation.", + "x-tags": [ + "VALIDATIONS API" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + }, + { + "$ref": "#/components/schemas/6_res_validate_promotion_object" + } + ] + }, + "6_req_validate_voucher": { + "title": "Validate Voucher Request Body", + "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_loyalty_card" + } + ] + }, + "6_req_validate_voucher_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "6_query_validate_voucher_client_side_orders_order_item": { - "type": "object", - "title": "Order Item", - "description": "This object represents an order line item.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "related_object": { - "type": "string", - "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." - }, - "product_id": { - "type": "string", - "description": "A unique product ID assigned by Voucherify.", - "example": "prod_0a7e62db1fca8322a2" - }, - "sku_id": { - "type": "string", - "description": "A unique SKU ID assigned by Voucherify.", - "example": "sku_0a41e31c7b41c28358" - }, - "quantity": { - "type": "string", - "description": "The quantity of the particular item in the cart." - }, - "price": { - "type": "string", - "description": "The unit price of the item." - }, - "amount": { - "type": "string", - "description": "The total amount of the order item (`price` * `quantity`)." - } - } - }, - "6_req_validate_promotion": { - "title": "Validate Promotion Request Body", - "type": "object", - "description": "Request schema model for validating a promotion using **POST** `/promotions/validation`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "6_req_rollback_redemption_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption rollback in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "6_req_validate_voucher_customer_id_string": { + "type": "string", + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "6_req_validate_voucher_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer that validates a voucher. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { + }, + "6_req_rollback_redemption_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { "type": "string", - "enum": [ - "category" - ], - "example": "category" + "description": "A unique identifier of a customer that redeemed a resource. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." } } - } - } - } - }, - "6_res_validate_promotion": { - "title": "Validate Promotion Response Body", - "type": "object", - "description": "Response schema model for validating a promotion using **POST** `/promotions/validation`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "promotions": { - "type": "array", - "description": "Contains an array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/6_res_validate_promotion_object" - } - } - } - }, - "6_res_validate_promotion_object": { - "title": "Validate Promotion", - "type": "object", - "description": "Validate Promotion", - "properties": { - "valid": { - "type": "string", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "id": { - "type": "string", - "example": "promo_4TqHr24boFISDrcOHSlfAxwm", - "description": "Unique promotion tier ID." - }, - "name": { - "type": "string", - "description": "Custom promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 45% off items" - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + }, + "6_req_validate_voucher_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." + } } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." - }, - "campaign": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "description": "Unique promotion tier ID." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "example": "2022-11-01T00:00:00.000Z", - "format": "date-time" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z", - "format": "date-time" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by the campaign object. This object stores information about the campaign." + }, + "6_req_validate_voucher_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption of this request." + } } - } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "discount_amount": { - "type": "integer", - "description": "The calculated discount amount based on the discount type and effect." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The effective discount amount that would be applied to the order." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "category_id": { - "type": "string", - "description": "Promotion tier category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion tier." - } - } - }, - "6_req_validate_promotion_tier": { - "title": "Validate Promotion Tier Request Body", - "type": "object", - "description": "Request schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "6_req_rollback_redemption_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption rollback of this request." + }, + "status": { + "type": "string", + "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", + "enum": [ + "CREATED", + "PAID", + "FULFILLED" + ] + } } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "6_req_rollback_redemption_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption rollback of this request." + }, + "status": { + "type": "string", + "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", + "enum": [ + "CREATED", + "PAID", + "FULFILLED" + ] + } } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "6_res_validate_promotion_tier": { - "title": "Validate Promotion Tier Response Body", - "description": "Response schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_true" - }, - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_false" - } - ] - }, - "6_res_validate_promotion_tier_true": { - "title": "Promotion Tier Valid", - "type": "object", - "description": "Response schema model for valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "properties": { - "valid": { - "type": "string", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "id": { - "type": "string", - "example": "promo_4TqHr24boFISDrcOHSlfAxwm", - "description": "Unique promotion tier ID." - }, - "name": { - "type": "string", - "description": "Custom promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 45% off items" - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." - }, - "campaign": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "description": "Unique promotion tier ID." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "example": "2022-11-01T00:00:00.000Z", - "format": "date-time" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z", - "format": "date-time" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by the campaign object. This object stores information about the campaign." - } - } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "discount_amount": { - "type": "integer", - "description": "The calculated discount amount based on the discount type and effect." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The effective discount amount that would be applied to the order." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - } - } - }, - "6_res_validate_promotion_tier_false": { - "type": "object", - "description": "Response schema model for a non-valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "title": "Promotion Tier Not Valid", - "properties": { - "valid": { - "type": "boolean", - "description": "Response schema for a voucher that is not valid." - }, - "reason": { - "type": "string", - "description": "System generated cause for the voucher being invalid in the context of the provided parameters." - }, - "error": { - "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_false_custom_message" - }, - { - "$ref": "#/components/schemas/e_error_no_translation" - } - ] - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "id": { - "type": "string", - "example": "promo_ByIIAHC1Mz9ouJsitzAWsush", - "description": "Promotion tier ID." - }, - "name": { - "type": "string", - "description": "Custom promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 25% off" - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z" - }, - "campaign": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "format": "date-time", - "example": "2022-11-01T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "object": { - "type": "string", - "description": "The type of object represented by the campaign object. This object stores information about the campaign.", - "default": "campaign" - } - } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the promotion tier.", - "default": "promotion_tier" - } - } - }, - "6_res_validate_promotion_tier_false_custom_message": { - "type": "object", - "description": "Custom Error Message", - "title": "Custom Message", - "properties": { - "message": { - "type": "string", - "description": "Customized error message." - } - } - }, - "19_req_session_lock": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** and **loyalty points** specified within the request.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "19_res_session_lock": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "19_obj_order_object_rollback_stacked": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "6_req_validate_voucher_discount_code": { + "title": "Discount Code", "type": "object", + "description": "Request schema model for validating a discount code voucher using **POST** `/vouchers/{code}/validate`.", "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "session": { + "$ref": "#/components/schemas/6_req_session_lock_discount_code" }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_req_validate_voucher_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Request schema model for validating a gift card voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_gift_card" }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." }, - "product": { + "metadata": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_req_validate_voucher_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Request schema model for validating a loyalty card voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", "properties": { "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." }, - "price": { + "points": { "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." } } }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" }, - "sku": { - "type": "string", - "description": "SKU name." + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" } - } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption and redemption rollback.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption rollback of incentives.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "rollback_id": { - "type": "string", - "description": "Unique ID of the redemption rollback.", - "example": "rr_0c63c84eb78ee0a6c0" - }, - "rollback_date": { - "type": "string", - "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", - "example": "2023-01-31T14:18:37.150Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the redemption is a `redemption` because this rollback is in the context of a stacked redemption.", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the parent redemption.", - "example": "r_0ba186c4824e4881e1" - }, - "stacked": { - "type": "array", - "description": "Lists the stacked redemption IDs in the initial redemption request.", - "items": { - "type": "string" - } - }, - "rollback_stacked": { - "type": "array", - "description": "Lists the rollback redemption IDs of the particular child redemptions.", - "items": { - "type": "string" - } - } + }, + "6_req_validate_voucher_unpublished_discount_code": { + "title": "Unpublished Discount Code", + "type": "object", + "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "type": "string" } } - } - } - } - }, - "19_obj_order_object_rollback_stacked_per_redemption_apply_to_order": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "6_req_session_lock_discount_code": { + "title": "Discount Code Session Lock", "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", "properties": { - "object": { + "type": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1.", + "enum": [ + "LOCK" + ] }, - "product_id": { + "key": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" }, - "sku_id": { + "ttl_unit": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] }, - "price": { + "ttl": { "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_obj_order_object_rollback_stacked_per_redemption_apply_to_items": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order.`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "6_req_session_lock_gift_card": { + "title": "Gift Card Session Lock", "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", "properties": { - "object": { + "type": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", + "enum": [ + "LOCK" + ] }, - "product_id": { + "key": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" }, - "sku_id": { + "ttl_unit": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] }, - "quantity": { + "ttl": { "type": "integer", - "description": "Quantity of the item in the cart." + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_req_session_lock_loyalty_card": { + "title": "Loyalty Card Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", + "enum": [ + "LOCK" + ] }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] }, - "subtotal_amount": { + "ttl": { "type": "integer", - "description": "Final order item amount after the removing an item-level discount." + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_req_redeemables_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Redeem a gift card.", - "properties": { - "id": { - "type": "string", - "description": "Unique gift card code." - }, - "object": { - "type": "string", - "description": "Type of object, i.e. `voucher`.", - "default": "voucher" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfill the order. The value of credits cannot be higher than the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "6_res_session_lock_discount_voucher": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. ", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } } - } - } - }, - "required": [ - "object", - "id" - ] - }, - "19_req_redeemables_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Redeem a loyalty card.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty card code." - }, - "object": { - "type": "string", - "description": "Type of object, i.e. `voucher`.", - "default": "voucher" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", - "example": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order using a **pay with points** reward. The number of points cannot be higher than the current balance on the loyalty card." + }, + "6_res_session_lock_gift_card": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } } - } - } - }, - "required": [ - "object", - "id", - "reward" - ] - }, - "19_req_redeemables_discount_referral_promotion_tier_promotion_stack": { - "title": "Discount code, referral code, promotion tier, promotion stack", - "type": "object", - "description": "Redeem a discount code, referral code, promotion tier, or promotion stack.", - "properties": { - "object": { - "type": "string", - "description": "Redeemable object type.", - "enum": [ - "voucher", - "promotion_tier", - "promotion_stack" - ], - "default": "voucher" - }, - "id": { - "type": "string", - "description": "Redeemable code or unique ID such as: \n- discount code, referral code: `DiscountCode100`, `v_6ZPI2BLMtpc6zz8pQVjQgxJH3D4ac3ZT` \n- promotion tier: `promo_Mwy9XpA0TLctSGriM5kum0qp` \n- promotion stack: `stack_KxSD0GahLUg9ULB6TseGfUHJ` " - } - }, - "required": [ - "object", - "id" - ] - }, - "19_req_redemptions": { - "title": "Redeem Stackable Discounts Request Body", - "type": "object", - "description": "This data model represents the request body for redeeming multiple incentives.", - "properties": { - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", - "items": { + }, + "6_res_session_lock_loyalty_card": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", + "default": "LOCK" + }, + "key": { "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", "enum": [ - "order", - "redemption", - "redeemable", - "category" + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." } } - } - }, - "redeemables": { - "type": "array", - "minItems": 1, - "maxItems": 5, - "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", - "items": { - "anyOf": [ + }, + "6_res_validate_voucher_false": { + "type": "object", + "title": "Not Valid", + "description": "Response schema for a voucher that is not valid.", + "examples": [ + { + "valid": false, + "reason": "voucher is disabled", + "error": { + "message": "Voucher has been disabled and is not active anymore." + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "code": "WFf5XAUc", + "metadata": {} + }, { - "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" + "valid": false, + "reason": "Customer must be a holder of a loyalty card.", + "error": { + "message": "You are not the right person." + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "code": "3TCjkel8", + "metadata": {} }, { - "$ref": "#/components/schemas/19_req_redeemables_gift_card" + "valid": false, + "reason": "loyalty card points exceeded", + "error": { + "message": "You need more loyalty points to be able to redeem a reward." + }, + "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", + "code": "pfeDMTsj", + "metadata": {} }, { - "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" + "valid": false, + "reason": "order does not match validation rules", + "error": { + "code": 400, + "key": "order_rules_violated", + "message": "order does not match validation rules", + "details": "Loyalty Card cannot be redeemed because of violated validation rules: val_RU9fm8GiQaRT", + "request_id": "v-0bcbde194f1305ad88" + }, + "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", + "code": "pfeDMTsj", + "metadata": {} + } + ], + "properties": { + "valid": { + "type": "boolean", + "default": false, + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "reason": { + "type": "string", + "description": "System generated cause for the voucher being invalid in the context of the provided parameters." + }, + "error": { + "type": "object", + "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", + "properties": { + "message": { + "type": "string", + "description": "Customized error message." + } + } + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "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." } - ] - } - }, - "session": { - "$ref": "#/components/schemas/19_req_session_lock" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." - } - }, - "required": [ - "redeemables" - ] - }, - "19_req_validations": { - "title": "Validate Stackable Discounts Request Body", - "type": "object", - "description": "This data model represents the request body for the `/validations` endpoint.", - "properties": { - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata not included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "items": { + }, + "6_res_validate_voucher_discount_amount": { + "title": "Amount Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Defines the type of voucher." + }, + "effect": { "type": "string", + "description": "Defines how the discount is applied to the customer's order.", "enum": [ - "order", - "redemption", - "redeemable", - "category" + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" ] + }, + "amount_off": { + "type": "integer", + "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. " } } - } - }, - "redeemables": { - "type": "array", - "minItems": 1, - "maxItems": 5, - "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" + }, + "6_res_validate_voucher_discount_percent": { + "title": "Percent Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Defines the type of voucher." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "percent_off": { + "type": "integer", + "description": "The percent discount that the customer will receive." + }, + "amount_limit": { + "type": "integer", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount was calculated using a formula." + } + } + }, + "6_res_validate_voucher_discount_fixed": { + "title": "Fixed Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value. A fixed discounts sets a fixed total on cart or item(s) and then calculates the discount to apply.", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Type of discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order. \n \n| **Effect** | **Definition** |\n|---|---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. |\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is calculated during the redemption and it's a difference between the initial item price and the fixed amount. |" }, + "fixed_amount": { + "type": "integer", + "description": "Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value." + } + } + }, + "6_res_validate_voucher_discount_unit": { + "title": "Unit Discount, single item", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "oneOf": [ { - "$ref": "#/components/schemas/19_req_redeemables_gift_card" + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product" }, { - "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku" } ] - } - }, - "session": { - "$ref": "#/components/schemas/19_req_session_lock" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." - } - }, - "required": [ - "redeemables" - ] - }, - "19_res_validations": { - "title": "Validate Stackable Discounts Response Body", - "description": "Response body schema for POST `/validations`.", - "oneOf": [ - { - "$ref": "#/components/schemas/19_res_validations-true" - }, - { - "$ref": "#/components/schemas/19_res_validations-false" - } - ] - }, - "19_res_validations-false": { - "type": "object", - "title": "False", - "description": "Response body schema for POST `/validations`.", - "properties": { - "valid": { - "type": "boolean", - "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", - "default": false - }, - "redeemables": { - "type": "array", - "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", - "items": { + }, + "6_res_validate_voucher_discount_unit_product": { + "title": "Unit Discount, Product", "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", "properties": { - "status": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { "type": "string", "enum": [ - "APPLICABLE", - "INAPPLICABLE", - "SKIPPED" + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules. `SKIPPED` indicates that the validation stopped once it identified at least one unapplicable redeemable and did not continue to validate the given redeemable." + "description": "Defines how the unit is added to the customer's order." }, - "id": { + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { "type": "string", - "description": "Redeemable ID, i.e. the voucher code." + "example": "prod_0a9f9ab4ab019a42d5", + "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." }, - "object": { + "product": { + "type": "object", + "description": "Contains information about the product.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID, assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product's source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + } + } + }, + "6_res_validate_voucher_discount_unit_sku": { + "title": "Unit Discount, SKU", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { "type": "string", - "description": "Redeemable's object type.", "enum": [ - "voucher", - "promotion_tier", - "promotion_stack" - ] + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." }, - "result": { + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." + }, + "sku": { "type": "object", - "description": "Provides details for an inapplicable redeemable.", + "description": "Contains information about the SKU.", "properties": { - "error": { - "$ref": "#/components/schemas/e_error" + "id": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "Unique SKU ID, assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product variant's source ID." + }, + "sku": { + "type": "string", + "description": "Product varient's name." } } }, - "metadata": { + "product": { "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "description": "Contains information about the parent product.", + "properties": { + "id": { + "type": "string", + "description": "Unique parent product ID, assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "Source ID of parent product." + }, + "name": { + "type": "string", + "description": "Name of parent product." + } + } } } - } - }, - "tracking_id": { - "type": "string", - "example": "track_VAVo1/z+G2GI2LPw==", - "description": "Hashed customer source ID." - } - } - }, - "19_res_validations_redeemables_discount_voucher": { - "type": "object", - "description": "Response schema model for validating a discount code.", - "title": "Discount Voucher", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the voucher code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_validation_res_per_redeemable" - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_voucher_code" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_gift_card": { - "type": "object", - "description": "Response schema model for validating a gift card.", - "title": "Gift Card", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the gift card code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_gift_card" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_loyalty_card": { - "type": "object", - "description": "Response schema model for validating a loyalty card.", - "title": "Loyalty Card", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the loyalty card code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_loyalty_card" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_promotion_tier": { - "type": "object", - "description": "Response schema model for validating a promotion tier.", - "title": "Promotion Tier", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the promotion tier ID." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "promotion_tier" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_tier" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_promotion_stack": { - "type": "object", - "description": "Response schema model for validating a promotion stack.", - "title": "Promotion Stack", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the promotion stack ID." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "promotion_stack" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_stack" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations-true": { - "type": "object", - "title": "True", - "description": "Response body schema for POST `/validations`.", - "properties": { - "valid": { - "type": "boolean", - "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", - "default": true - }, - "redeemables": { - "type": "array", - "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_res_validations_redeemables_discount_voucher" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_gift_card" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_loyalty_card" + }, + "6_res_validate_voucher_discount_unit_multiple": { + "title": "Unit Discount, multiple items", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_tier" + "effect": { + "type": "string", + "default": "ADD_MANY_ITEMS", + "description": "Defines how the discount is applied to the customer's order." }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_stack" + "units": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku_multiple" + } + ] } - ] - } - }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_validation_res" - }, - "tracking_id": { - "type": "string", - "example": "track_VAVo1/z+G2GI2LPw==", - "description": "Hashed customer source ID." - }, - "session": { - "$ref": "#/components/schemas/19_res_session_lock" - } - } - }, - "19_obj_validations-true_result_voucher_code": { - "type": "object", - "title": "Coupon Code", - "description": "This is a `result` object representing the results for a coupon code.", - "properties": { - "discount": { - "description": "Discount details about the type of discount to be applied for the redeemable.", - "oneOf": [ - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount_dynamic" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage_dynamic" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_order" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_items" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_shipping" - } - ] - } - } - }, - "19_obj_voucher_object_discount_amount": { - "title": "Static Amount", - "type": "object", - "description": "Amount discount type based on a static value.", - "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Applies an amount discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "amount_off": { - "type": "integer", - "example": 100, - "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", - "enum": [ - false - ] - } - } - }, - "19_obj_voucher_object_discount_amount_dynamic": { - "title": "Dynamic Amount", - "type": "object", - "description": "Amount discount type based on a formula.", - "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Applies an amount discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", - "enum": [ - true - ] - } - } - }, - "19_obj_voucher_object_discount_percentage": { - "title": "Percentage", - "type": "object", - "description": "Percentage discount type applied to an order (static or dynamic) or a percentage discount type applied to items (static).", - "properties": { - "type": { - "type": "string", - "default": "PERCENT", - "description": "Applies a percentage discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "percent_off": { - "type": "integer", - "description": "Percent taken off the subtotal amount. In case of the percent being calculated by the formula and applied to the order level, i.e. the `is_dynamic` parameter is `true`, this value becomes a dynamically calculated value that varies based on the formula.", - "minimum": 0, - "maximum": 100 - }, - "amount_limit": { - "type": "string", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", - "enum": [ - false, - true - ] - } - } - }, - "19_obj_voucher_object_discount_percentage_dynamic": { - "title": "Dynamic Percentage for Items", - "type": "object", - "description": "Percentage discount type applied to items and based on a formula (dynamic).", - "properties": { - "type": { - "type": "string", - "default": "PERCENT", - "description": "Applies a percentage discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "amount_limit": { - "type": "string", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", - "enum": [ - true - ] - } - } - }, - "19_obj_voucher_object_discount_fixed_order": { - "title": "Fixed Order Amount", - "description": "Fixed discount type for an order.", - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "FIXED", - "description": "Sets a fixed total on the cart and then calculates the discount to apply." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER" - ], - "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |" - }, - "fixed_amount": { - "type": "integer", - "description": "Set a fixed valued for an order total. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.", - "example": 1000 - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the fixed amount is based on a formula that dynamically calculates the fixed amount.", - "enum": [ - false, - true - ] - } - } - }, - "19_obj_voucher_object_discount_fixed_items": { - "title": "New Prices for Items", - "description": "Fixed discount type for item(s).", - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "FIXED", - "description": "Sets a new item price and then calculates the discount to apply." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ITEMS" - ], - "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |" - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag defaults to false because each item price could be defined separately and either based on a formula that dynamically calculates the discount or based on a fixed set price.", - "enum": [ - false - ] - } - } - }, - "19_obj_voucher_object_discount_unit_one": { - "title": "Unit, single item", - "type": "object", - "description": "Single item type.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Applies a full value discount to item(s)." - }, - "effect": { - "type": "string", - "enum": [ - "ADD_NEW_ITEMS", - "ADD_MISSING_ITEMS" - ], - "default": "ADD_MISSING_ITEMS", - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "number", - "description": "Number of units to be granted a full value discount. ", - "example": 1, - "format": "float" - }, - "unit_type": { - "type": "string", - "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `sku_0a3efc90375d1217e2` or `prod_s3C0nDpr0DuC7`.", - "example": "prod_f1r5Tpr0DuC7" - }, - "sku": { - "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_0a3efc90375d1217e2", - "description": "Unique SKU ID assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "SKU source ID." - }, - "sku": { - "type": "string", - "description": "SKU name." } - } - }, - "product": { - "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", - "properties": { - "id": { - "type": "string", - "example": "prod_0bc3bd76a61082e6b3", - "description": "Unique (parent) product ID assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product source ID." - }, - "name": { - "type": "string", - "description": "Product name." + }, + "6_res_validate_voucher_discount_unit_product_multiple": { + "title": "Product Item", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "effect": { + "type": "string", + "enum": [ + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "prod_0a9f9ab4ab019a42d5", + "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." + }, + "product": { + "type": "object", + "description": "Contains information about the product.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID, assigned by Voucherify.", + "example": "prod_0a9f9ab4ab019a42d5" + }, + "source_id": { + "type": "string", + "description": "Product's source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + } } - } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of items is based on a formula.", - "enum": [ - false, - true - ] - } - } - }, - "19_obj_voucher_object_discount_unit_multiple": { - "title": "Unit, multiple items", - "type": "object", - "description": "Multiple item types.", - "properties": { - "type": { - "type": "string", - "description": "Applies a full value discount to item(s).", - "default": "UNIT" - }, - "effect": { - "type": "string", - "default": "ADD_MANY_ITEMS", - "description": "Defines the effect for adding multiple item types." - }, - "units": { - "type": "array", - "description": "Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.", - "items": { + }, + "6_res_validate_voucher_discount_unit_sku_multiple": { + "title": "SKU Item", "type": "object", - "description": "Object defining a unit discount.", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", "properties": { "effect": { "type": "string", "enum": [ - "ADD_NEW_ITEMS", - "ADD_MISSING_ITEMS" + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" ], "description": "Defines how the unit is added to the customer's order." }, "unit_off": { "type": "integer", - "description": "Number of units to be granted a full value discount. In case of the unit being calculated by a formula, this value is the result of the dynamic calculation.", - "example": 1 + "description": "Number of units to be granted a full value discount." }, "unit_type": { "type": "string", - "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `prod_0bc3bd76a61082e6b3` or `sku_0a3efc90701d121820`.", - "example": "prod_f1r5Tpr0DuC7" + "example": "sku_0bae3b28f610fd0da1", + "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." }, "sku": { "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", + "description": "Contains information about the SKU.", "properties": { "id": { "type": "string", - "example": "sku_0a3efc90375d1217e2", - "description": "Unique SKU ID assigned by Voucherify." + "example": "sku_0bae3b28f610fd0da1", + "description": "Unique SKU ID, assigned by Voucherify." }, "source_id": { "type": "string", - "description": "SKU source ID." + "description": "Product variant's source ID." }, "sku": { "type": "string", - "description": "SKU name." + "description": "Product varient's name." } } }, "product": { "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", + "description": "Contains information about the parent product.", "properties": { "id": { "type": "string", - "example": "prod_0bc3bd76a61082e6b3", - "description": "Unique (parent) product ID assigned by Voucherify." + "description": "Unique parent product ID, assigned by Voucherify.", + "example": "prod_0b7d7dfb05cbe5c616" }, "source_id": { "type": "string", - "description": "Product source ID." + "description": "Source ID of parent product." }, "name": { "type": "string", - "description": "Product name." + "description": "Name of parent product." } } } } - } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of items is based on a formula." - } - } - }, - "19_obj_voucher_object_discount_shipping": { - "title": "Shipping", - "description": "Shipping discount type.", - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Applies a full value discount to item(s)." - }, - "effect": { - "type": "string", - "description": "Defines how the unit is added to the customer's order.", - "default": "ADD_MISSING_ITEMS" - }, - "unit_off": { - "type": "number", - "format": "float", - "description": "Subtracts 1 shipping item from the subtotal.", - "default": 1 - }, - "unit_type": { - "type": "string", - "description": "The shipping product deemed as free.", - "default": "prod_5h1pp1ng" - }, - "product": { - "type": "object", - "description": "Defines the product details of the shipping product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h1pp1ng", - "description": "Unique product ID assigned by Voucherify, i.e. `prod_5h1pp1ng`.", - "default": "prod_5h1pp1ng" - }, - "source_id": { - "type": "string", - "description": "Product source ID.", - "default": "5h1pp1ng", - "example": "5h1pp1ng" - }, - "name": { - "type": "string", - "description": "Product name.", - "example": "Shipping", - "default": "Shipping" - } - } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of shipping items is based on a formula.", - "default": false, - "enum": [ - false - ] - } - } - }, - "19_obj_validations-true_result_gift_card": { - "type": "object", - "title": "Gift Card", - "description": "This is a `result` object representing the results for a gift card.", - "properties": { - "gift": { - "description": "Stores the amount of gift card credits to be applied in the redemption.", - "type": "object", - "properties": { - "credits": { - "type": "integer", - "description": "Total number of gift card credits to be applied in the redemption expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } - } - }, - "19_obj_validations-true_result_loyalty_card": { - "type": "object", - "title": "Loyalty Card", - "description": "This is a `result` object representing the results for a loyalty card.", - "properties": { - "loyalty_card": { - "description": "Stores the amount of loyalty card points to be applied in the redemption.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Total number of loyalty points to be applied in the redemption." - } - } - } - } - }, - "19_obj_validations-true_result_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is a `result` object representing the results for a promotion tier.", - "properties": { - "discount": { - "description": "Discount details about the type of discount to be applied for the redeemable.", - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ] - } - } - }, - "19_obj_validations-true_result_promotion_stack": { - "type": "object", - "title": "Promotion Stack", - "description": "This is a `result` object representing the results for a promotion stack.", - "properties": { - "loyalty_card": { - "description": "Stores the amount of loyalty card points to be applied in the redemption.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Total number of loyalty points to be applied in the redemption." - } - } - } - } - }, - "19_obj_order_object_validation_res": { - "type": "object", - "title": "Order", - "description": "Contains the combined effect of all redeemables taken into account on the order object properties.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items showing the effects of particular discounts on the item-level.", - "items": { + }, + "6_res_validate_voucher_discount_shipping": { + "title": "Shipping Discount", "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { + "type": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "default": "UNIT", + "description": "Discount type." }, - "sku_id": { + "effect": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "Defines how the unit is added to the customer's order.", + "default": "ADD_MISSING_ITEMS" }, - "price": { + "unit_off": { "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Number of units to be granted a full value discount.", + "default": 1 }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" + "unit_type": { + "type": "string", + "description": "The shipping \"product\" deemed as free.", + "default": "prod_5h1pp1ng" }, "product": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "Contains information about the shipping \"product\".", "properties": { "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "Unique shipping \"product\" ID, assigned by Voucherify.", + "default": "prod_5h1pp1ng" }, "source_id": { "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + "description": "\"Product's\" source ID.", + "default": "5h1pp1ng" }, "name": { "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "\"Product\" name.", + "default": "Shipping" } } + } + } + }, + "6_res_validate_voucher": { + "title": "Valid", + "description": "Response schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + { + "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" + } + ] + }, + "6_res_validate_voucher_discount_code": { + "type": "object", + "title": "Valid - Discount Code", + "description": "Response schema model for validating a discount code using **POST** `/vouchers/{code}/validate`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" }, - "sku": { - "type": "string", - "description": "SKU name." + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" } - } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "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." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." + }, + "session": { + "$ref": "#/components/schemas/6_res_session_lock_discount_voucher" } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer_id": { - "type": "null" - }, - "referrer_id": { - "type": "null" - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_obj_order_object_validation_res_per_redeemable": { - "type": "object", - "title": "Order", - "description": "Contains the effect of each redeemable on the order and specific cart items. The amounts are consecutively built on the previous redeemable's effects, such that for each redeemable, the amounts are further reduced by the redeemable. The sequence in the request body is important because that will be the sequence the redeemables are applied one on top of the other.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items showing the effects of particular discounts on the item-level.", - "items": { + }, + "6_res_validate_voucher_gift_card": { "type": "object", + "title": "Valid - Gift Card", + "description": "Response schema model for validating a gift card using **POST** `/vouchers/{code}/validate`.", "properties": { - "object": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "Hashed customer source ID." }, - "product_id": { + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "code": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "Voucher code." }, - "sku_id": { + "gift": { + "type": "object", + "description": "Contains current gift card balance information.", + "properties": { + "amount": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "balance": { + "type": "integer", + "description": "Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the credits are applied to the customer's order." + } + } + }, + "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." + }, + "start_date": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" + "session": { + "$ref": "#/components/schemas/6_res_session_lock_gift_card" + } + } + }, + "6_res_validate_voucher_loyalty_card": { + "type": "object", + "title": "Valid - Loyalty Card", + "description": "Response schema model for validating a loyalty card using **POST** `/vouchers/{code}/validate`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." }, - "product": { + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "loyalty": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "Contains the cost of reward in points.", "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { + "points_cost": { "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Number of points that wlil be deducted from loyaty card for the associated reward." } } }, - "sku": { + "reward": { "type": "object", - "description": "This object stores more information about the related SKU.", + "description": "Contains information about the reward that is being validated.", "properties": { "id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "description": "Unique reward ID assigned by Voucherify.", + "example": "rew_Crmu3hu2FKZWZIML59AeAs1n" }, - "sku": { + "assignment_id": { "type": "string", - "description": "SKU name." + "example": "rewa_xZr6Ks0j5AHeMRVdELmpI9sc", + "description": "Unique reward assignment ID assigned by Voucherify." }, - "price": { + "points": { "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Number of points applied to the reward." } } + }, + "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." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." + }, + "session": { + "$ref": "#/components/schemas/6_res_session_lock_loyalty_card" } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer_id": { - "type": "null" - }, - "referrer_id": { - "type": "null" - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_res_redemptions_parentRedemptionId_rollbacks": { - "type": "object", - "properties": { - "rollbacks": { - "type": "array", - "description": "Contains the rollback redemption objects of the particular incentives.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_discount_voucher_stacked" + }, + "6_res_applicable_to_object": { + "title": "Included Items", + "type": "object", + "description": "Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.", + "properties": { + "data": { + "type": "array", + "description": "Contains array of items to which the discount can apply.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_product_collection" + }, + { + "$ref": "#/components/schemas/6_res_product_collection_unit" + }, + { + "$ref": "#/components/schemas/6_res_product_collection_fixed_amount" + }, + { + "$ref": "#/components/schemas/6_res_product" + }, + { + "$ref": "#/components/schemas/6_res_product_unit" + }, + { + "$ref": "#/components/schemas/6_res_product_fixed_amount" + }, + { + "$ref": "#/components/schemas/6_res_sku" + }, + { + "$ref": "#/components/schemas/6_res_sku_unit" + }, + { + "$ref": "#/components/schemas/6_res_sku_unit_fixed_amount" + } + ] + } }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_loyalty_card_stacked" + "total": { + "type": "integer", + "description": "Total number of objects defining included products, SKUs, or product collections." }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_gift_card_stacked" + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of included objects." }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_promotion_tier_stacked" + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary." } - ] - } - }, - "parent_rollback": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "rr_0c675efbc2039b83b3", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_QszL0PS1NekVjQaHGxrbpPHu", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID.", - "example": "track_fxEMFisanb4sbl4Z4yCn" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2023-02-03T09:12:22.536Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, + } + }, + "6_res_inapplicable_to_object": { + "title": "Excluded Items", + "type": "object", + "description": "Contains list of items that **do not** qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These **CANNOT** be discounted.", + "properties": { + "data": { + "description": "Contains array of items to which the discount cannot apply.", + "type": "array", "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_product_collection_excluded" + }, + { + "$ref": "#/components/schemas/6_res_product_excluded" + }, + { + "$ref": "#/components/schemas/6_res_sku_excluded" } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." + ] } + }, + "total": { + "type": "integer", + "description": "Total number of objects defining excluded products, SKUs, or product collections." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of excluded objects." + }, + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary." } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } + } + }, + "6_res_product_collection": { + "title": "Product Collection", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." } - }, - "result": { - "type": "string", - "description": "Redemption rollback result", - "enum": [ - "SUCCESS" - ] - }, - "redemption": { - "type": "string", - "example": "r_0c656311b5878a2031", - "description": "Unique redemption ID of the initial redemption." } - } - }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked" - } - }, - "description": "Response body schema for POST `/redemptions/{parentRedemptionID}/rollbacks`.", - "title": "Rollback Stackable Redemptions Response Body" - }, - "19_obj_redemption_rollback_object_discount_voucher_stacked": { - "type": "object", - "title": "Rollback Discount Voucher", - "description": "This is an object representing a redemption rollback for a discount voucher.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eba630bc4979e70", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + }, + "6_res_product_collection_unit": { + "title": "Product Collection for Unit Discount", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted per order line item." + }, + "aggregated_quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + } } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "6_res_product_collection_fixed_amount": { + "title": "Product Collection for Fixed Amount Discount", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "price": { + "type": "integer", + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + }, + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "\"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "discount": { - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ] - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "DISCOUNT_VOUCHER" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." + }, + "6_res_product_collection_excluded": { + "title": "Product Collection", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." + } } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - } - } - }, - "19_obj_redemption_rollback_object_loyalty_card_stacked": { - "type": "object", - "title": "Rollback Loyalty Card Voucher", - "description": "This is an object representing a redemption rollback for a loyalty card.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eaf4060133bf784", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "reward": { - "description": "Defines the reward that was initially redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption after the redemption rollback." - } + }, + "6_res_sku": { + "title": "SKU", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." } - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "LOYALTY_CARD" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - }, - "holder_id": { - "type": "string", - "description": "Unique customer ID of the loyalty card owner.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - } - } - }, - "19_obj_redemption_rollback_object_gift_card_stacked": { - "type": "object", - "title": "Rollback Gift Card", - "description": "This is an object representing a gift card redemption rollback.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "gift": { - "type": "object", - "description": "Contains the balance of the gift card after credits are added back to the gift card for the redemption rollback.", - "properties": { - "amount": { - "type": "integer", - "example": 10000, - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "example": 500, - "description": "Available funds after the redemption rollback credits back the amount used up during the initial redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the credits are applied to the customer's order." - } + }, + "6_res_sku_unit": { + "title": "SKU for Unit Discount", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted per order line item." + }, + "aggregated_quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." } - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "GIFT_VOUCHER" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0c5bf3323008a35032" - } - } - }, - "19_obj_redemption_rollback_object_promotion_tier_stacked": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption rollback", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "name": { - "type": "string", - "description": "Promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website." - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } + }, + "6_res_sku_unit_fixed_amount": { + "title": "SKU for Amount Discount", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "price": { + "type": "integer", + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + }, + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." } } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of initial redemption." - } - } - }, - "19_res_redemptions_POST": { - "type": "object", - "title": "Stackable Redemptions Response Body", - "description": "Response body schema for POST `/redemptions`.", - "properties": { - "redemptions": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended_stacked" + }, + "6_res_sku_excluded": { + "title": "SKU", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended_stacked" + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended_stacked" + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended_stacked" + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." } - ] - } - }, - "parent_redemption": { - "type": "object", - "title": "Stacked Redemption", - "description": "This is an object representing a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - }, - "customer": { - "type": "object", - "description": "Defines the customer making the stacked redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } + } + }, + "6_res_product": { + "title": "Product", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This object stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." - }, - "voucher": { - "type": "null" } - } - }, - "order": { - "description": "Contains the order details associated with the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - } - } - }, - "7_obj_order_object_rollback": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "6_res_product_unit": { + "title": "Product for Unit Discount", "type": "object", + "description": "Contains definition for a product.", "properties": { "object": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "default": "product", + "description": "This object stores information about the product." }, - "product_id": { + "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" }, - "sku_id": { + "source_id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "The product ID from your inventory system." }, - "quantity": { + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { "type": "integer", - "description": "Quantity of the item in the cart." + "description": "The maximum number of units allowed to be discounted per order line item." }, - "amount": { + "aggregated_quantity_limit": { "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + } + } + }, + "6_res_product_fixed_amount": { + "title": "Product for Fixed Amount Discount", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This object stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" }, "price": { "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product_excluded": { + "title": "Product", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This product stores information about the product." }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption and redemption rollback.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "rollback_id": { - "type": "string", - "description": "Unique ID of the redemption rollback.", - "example": "rr_0c63c84eb78ee0a6c0" - }, - "rollback_date": { - "type": "string", - "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", - "example": "2023-01-31T14:18:37.150Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "enum": [ - "voucher", - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the related object that defines the incentive." - }, - "related_object_parent_id": { - "type": "string", - "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign." - } + }, + "6_obj_order_object": { + "title": "Order object", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "oneOf": [ + { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" + }, + { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_items" } - } - } - } - } - }, - "7_obj_order_object": { - "title": "Order object", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "oneOf": [ - { - "$ref": "#/components/schemas/7_obj_order_object_apply_to_order" - }, - { - "$ref": "#/components/schemas/7_obj_order_object_apply_to_items" - } - ] - }, - "7_obj_order_object_apply_to_order": { - "type": "object", - "title": "Order object - Effect: Apply to order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the order-level discount applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "This field sums up all order-level and all product-specific discounts applied in a particular request." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + ] + }, + "6_obj_order_object_apply_to_order": { "type": "object", + "title": "Order object - Effect: Apply to order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", "properties": { - "object": { + "id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "product_id": { + "source_id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "sku_id": { + "created_at": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "status": { + "type": "string", + "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] }, "amount": { "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "Order amount before applying any discount." }, - "price": { + "discount_amount": { "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Sum of all order-level discounts applied to the order." }, - "subtotal_amount": { + "total_discount_amount": { "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "description": "Sum of all order-level discounts." }, - "product": { + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the order-level discount applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "This field sums up all order-level discounts applied to the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", "properties": { "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." }, - "name": { + "object": { "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "default": "customer", + "description": "Type of object represented by the `customer` object." } } }, - "sku": { + "referrer": { "type": "object", - "description": "This object stores more information about the related SKU.", + "description": "Object containing information about the referrer.", "properties": { "id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." }, - "sku": { + "object": { "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "default": "customer", + "description": "Type of object represented by the `referrer` object." } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption.", - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - } - } - }, - "7_obj_order_object_apply_to_items": { - "type": "object", - "title": "Order object - Effect: Apply to items", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. " - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + }, + "6_obj_order_object_apply_to_items": { "type": "object", + "title": "Order object - Effect: Apply to items", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", "properties": { - "object": { + "id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "product_id": { + "source_id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "sku_id": { + "created_at": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "status": { + "type": "string", + "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] }, "amount": { "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "Order amount before applying any discount." }, - "discount_amount": { + "items_discount_amount": { "type": "integer", - "description": "The item-level discount applied to the item." + "description": "Sum of all product-specific discounts applied. \n`sum(items, i => i.discount_amount)`" }, - "applied_discount_amount": { + "total_discount_amount": { "type": "integer", - "description": "The item-level discount applied to the item." + "description": "Sum of all product-specific discounts applied." }, - "price": { + "total_amount": { "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" }, - "subtotal_amount": { + "items_applied_discount_amount": { "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "description": "Product-specifc discounts applied to all the items." }, - "product": { + "total_applied_discount_amount": { + "type": "integer", + "description": "Product-specific discounts applied in the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", "properties": { "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." }, - "name": { + "object": { "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "default": "customer", + "description": "Type of object represented by the `customer` object." } } }, - "sku": { + "referrer": { "type": "object", - "description": "This object stores more information about the related SKU.", + "description": "Object containing information about the referrer.", "properties": { "id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." }, - "sku": { + "object": { "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "default": "customer", + "description": "Type of object represented by the `referrer` object." } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption.", - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - } - } - }, - "7_obj_order_object_stacked_redemptions": { - "type": "object", - "title": "Order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. " - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the sum of all order-level discounts applied." - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied.\n`sum(items, i => i.applied_discount_amount)`" - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order.\n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + }, + "6_query_validate_voucher_client_side_orders_order_item": { "type": "object", + "title": "Order Item", + "description": "This object represents an order line item.", "properties": { - "object": { + "source_id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "related_object": { + "type": "string", + "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." }, "product_id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "description": "A unique product ID assigned by Voucherify.", + "example": "prod_0a7e62db1fca8322a2" }, "sku_id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "A unique SKU ID assigned by Voucherify.", + "example": "sku_0a41e31c7b41c28358" }, "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." + "type": "string", + "description": "The quantity of the particular item in the cart." + }, + "price": { + "type": "string", + "description": "The unit price of the item." }, "amount": { + "type": "string", + "description": "The total amount of the order item (`price` * `quantity`)." + } + } + }, + "6_req_validate_promotion": { + "title": "Validate Promotion Request Body", + "type": "object", + "description": "Request schema model for validating a promotion using **POST** `/promotions/validation`.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { + "type": "string", + "enum": [ + "category" + ], + "example": "category" + } + } + } + } + } + }, + "6_res_validate_promotion": { + "title": "Validate Promotion Response Body", + "type": "object", + "description": "Response schema model for validating a promotion using **POST** `/promotions/validation`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "promotions": { + "type": "array", + "description": "Contains an array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/6_res_validate_promotion_object" + } + } + } + }, + "6_res_validate_promotion_object": { + "title": "Validate Promotion", + "type": "object", + "description": "Validate Promotion", + "properties": { + "valid": { + "type": "string", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "id": { + "type": "string", + "example": "promo_4TqHr24boFISDrcOHSlfAxwm", + "description": "Unique promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 45% off items" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + }, + "campaign": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "description": "Unique promotion tier ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "example": "2022-11-01T00:00:00.000Z", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z", + "format": "date-time" + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by the campaign object. This object stores information about the campaign." + } + } + }, + "hierarchy": { "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." }, "discount_amount": { "type": "integer", - "description": "The item-level discount applied to the item." + "description": "The calculated discount amount based on the discount type and effect." }, "applied_discount_amount": { "type": "integer", - "description": "The item-level discount applied to the item." + "description": "The effective discount amount that would be applied to the order." }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." }, - "product": { + "category_id": { + "type": "string", + "description": "Promotion tier category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion tier." + } + } + }, + "6_req_validate_promotion_tier": { + "title": "Validate Promotion Tier Request Body", + "type": "object", + "description": "Request schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_res_validate_promotion_tier": { + "title": "Validate Promotion Tier Response Body", + "description": "Response schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_true" + }, + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_false" + } + ] + }, + "6_res_validate_promotion_tier_true": { + "title": "Promotion Tier Valid", + "type": "object", + "description": "Response schema model for valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "properties": { + "valid": { + "type": "string", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "id": { + "type": "string", + "example": "promo_4TqHr24boFISDrcOHSlfAxwm", + "description": "Unique promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 45% off items" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + }, + "campaign": { "type": "object", - "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "description": "Unique promotion tier ID." }, - "source_id": { + "start_date": { "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "example": "2022-11-01T00:00:00.000Z", + "format": "date-time" }, - "name": { + "expiration_date": { "type": "string", - "example": "Brewing System", - "description": "Product name." + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z", + "format": "date-time" }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by the campaign object. This object stores information about the campaign." } } }, - "sku": { + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "discount_amount": { + "type": "integer", + "description": "The calculated discount amount based on the discount type and effect." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The effective discount amount that would be applied to the order." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + } + } + }, + "6_res_validate_promotion_tier_false": { + "type": "object", + "description": "Response schema model for a non-valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "title": "Promotion Tier Not Valid", + "properties": { + "valid": { + "type": "boolean", + "description": "Response schema for a voucher that is not valid." + }, + "reason": { + "type": "string", + "description": "System generated cause for the voucher being invalid in the context of the provided parameters." + }, + "error": { + "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_false_custom_message" + }, + { + "$ref": "#/components/schemas/e_error_no_translation" + } + ] + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "id": { + "type": "string", + "example": "promo_ByIIAHC1Mz9ouJsitzAWsush", + "description": "Promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 25% off" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z" + }, + "campaign": { "type": "object", - "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Unique promotion tier ID." }, - "source_id": { + "start_date": { "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "format": "date-time", + "example": "2022-11-01T00:00:00.000Z" }, - "sku": { + "expiration_date": { "type": "string", - "description": "SKU name." + "format": "date-time", + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z" }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "object": { + "type": "string", + "description": "The type of object represented by the campaign object. This object stores information about the campaign.", + "default": "campaign" } } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the promotion tier.", + "default": "promotion_tier" } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." + }, + "6_res_validate_promotion_tier_false_custom_message": { + "type": "object", + "description": "Custom Error Message", + "title": "Custom Message", + "properties": { + "message": { + "type": "string", + "description": "Customized error message." + } } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption", - "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" - } - } - }, - "7_obj_redemption_object": { - "title": "Redemption Object", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such an operation a [redemption rollback](ref:rollback-redemption).", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_stackable_discounts" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_fail" - } - ] - }, - "7_obj_redemption_object_voucher": { - "title": "Redemption Object", - "description": "This is an object representing an attempted or successful voucher redemption.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - } - ] - }, - "7_obj_redemption_object_voucher_extended": { - "title": "Redemption Object", - "description": "This is an object representing an attempted or successful voucher redemption.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended" - } - ] - }, - "7_obj_redemption_object_discount_voucher_extended": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_req_session_lock": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** and **loyalty points** specified within the request.", + "enum": [ + "LOCK" + ] + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_res_session_lock": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } - } - }, - "7_obj_redemption_object_discount_voucher_extended_stacked": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_order_object_rollback_stacked": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption and redemption rollback.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption rollback of incentives.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "rollback_id": { + "type": "string", + "description": "Unique ID of the redemption rollback.", + "example": "rr_0c63c84eb78ee0a6c0" + }, + "rollback_date": { + "type": "string", + "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", + "example": "2023-01-31T14:18:37.150Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the redemption is a `redemption` because this rollback is in the context of a stacked redemption.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the parent redemption.", + "example": "r_0ba186c4824e4881e1" + }, + "stacked": { + "type": "array", + "description": "Lists the stacked redemption IDs in the initial redemption request.", + "items": { + "type": "string" + } + }, + "rollback_stacked": { + "type": "array", + "description": "Lists the rollback redemption IDs of the particular child redemptions.", + "items": { + "type": "string" + } + } + } + } + } + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_order_object_rollback_stacked_per_redemption_apply_to_order": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } - } - }, - "7_obj_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_order_object_rollback_stacked_per_redemption_apply_to_items": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order.`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "19_req_redeemables_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Redeem a gift card.", + "properties": { + "id": { + "type": "string", + "description": "Unique gift card code." + }, + "object": { + "type": "string", + "description": "Type of object, i.e. `voucher`.", + "default": "voucher" + }, + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfill the order. The value of credits cannot be higher than the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } }, - "name": { - "type": "string", - "description": "Customer's first and last name." + "required": [ + "object", + "id" + ] + }, + "19_req_redeemables_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Redeem a loyalty card.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty card code." + }, + "object": { + "type": "string", + "description": "Type of object, i.e. `voucher`.", + "default": "voucher" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", + "example": "rew_EPx1hCTpqzF0HW1z9NKckZH4" + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order using a **pay with points** reward. The number of points cannot be higher than the current balance on the loyalty card." + } + } + } }, - "email": { - "type": "string", - "description": "Customer's email address." + "required": [ + "object", + "id", + "reward" + ] + }, + "19_req_redeemables_discount_referral_promotion_tier_promotion_stack": { + "title": "Discount code, referral code, promotion tier, promotion stack", + "type": "object", + "description": "Redeem a discount code, referral code, promotion tier, or promotion stack.", + "properties": { + "object": { + "type": "string", + "description": "Redeemable object type.", + "enum": [ + "voucher", + "promotion_tier", + "promotion_stack" + ], + "default": "voucher" + }, + "id": { + "type": "string", + "description": "Redeemable code or unique ID such as: \n- discount code, referral code: `DiscountCode100`, `v_6ZPI2BLMtpc6zz8pQVjQgxJH3D4ac3ZT` \n- promotion tier: `promo_Mwy9XpA0TLctSGriM5kum0qp` \n- promotion stack: `stack_KxSD0GahLUg9ULB6TseGfUHJ` " + } }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + "required": [ + "object", + "id" + ] + }, + "19_req_redemptions": { + "title": "Redeem Stackable Discounts Request Body", + "type": "object", + "description": "This data model represents the request body for redeeming multiple incentives.", + "properties": { + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", + "items": { + "type": "string", + "enum": [ + "order", + "redemption", + "redeemable", + "category" + ] + } + } + } + }, + "redeemables": { + "type": "array", + "minItems": 1, + "maxItems": 5, + "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" + }, + { + "$ref": "#/components/schemas/19_req_redeemables_gift_card" + }, + { + "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" + } + ] + } + }, + "session": { + "$ref": "#/components/schemas/19_req_session_lock" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." + } }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + "required": [ + "redeemables" + ] + }, + "19_req_validations": { + "title": "Validate Stackable Discounts Request Body", + "type": "object", + "description": "This data model represents the request body for the `/validations` endpoint.", + "properties": { + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata not included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "items": { + "type": "string", + "enum": [ + "order", + "redemption", + "redeemable", + "category" + ] + } + } + } + }, + "redeemables": { + "type": "array", + "minItems": 1, + "maxItems": 5, + "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" + }, + { + "$ref": "#/components/schemas/19_req_redeemables_gift_card" + }, + { + "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" + } + ] + } + }, + "session": { + "$ref": "#/components/schemas/19_req_session_lock" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." + } }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + "required": [ + "redeemables" + ] + }, + "19_res_validations": { + "title": "Validate Stackable Discounts Response Body", + "description": "Response body schema for POST `/validations`.", + "oneOf": [ + { + "$ref": "#/components/schemas/19_res_validations-true" + }, + { + "$ref": "#/components/schemas/19_res_validations-false" + } + ] + }, + "19_res_validations-false": { + "type": "object", + "title": "False", + "description": "Response body schema for POST `/validations`.", + "properties": { + "valid": { + "type": "boolean", + "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", + "default": false + }, + "redeemables": { + "type": "array", + "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", + "items": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE", + "INAPPLICABLE", + "SKIPPED" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules. `SKIPPED` indicates that the validation stopped once it identified at least one unapplicable redeemable and did not continue to validate the given redeemable." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the voucher code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher", + "promotion_tier", + "promotion_stack" + ] + }, + "result": { + "type": "object", + "description": "Provides details for an inapplicable redeemable.", + "properties": { + "error": { + "$ref": "#/components/schemas/e_error" + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + } + }, + "tracking_id": { + "type": "string", + "example": "track_VAVo1/z+G2GI2LPw==", + "description": "Hashed customer source ID." + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + }, + "19_res_validations_redeemables_discount_voucher": { + "type": "object", + "description": "Response schema model for validating a discount code.", + "title": "Discount Voucher", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the voucher code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_validation_res_per_redeemable" + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_voucher_code" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." + }, + "19_res_validations_redeemables_gift_card": { + "type": "object", + "description": "Response schema model for validating a gift card.", + "title": "Gift Card", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the gift card code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_gift_card" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } } - } - } - } - }, - "7_obj_redemption_object_loyalty_card_extended_stacked": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_res_validations_redeemables_loyalty_card": { + "type": "object", + "description": "Response schema model for validating a loyalty card.", + "title": "Loyalty Card", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the loyalty card code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_loyalty_card" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_res_validations_redeemables_promotion_tier": { + "type": "object", + "description": "Response schema model for validating a promotion tier.", + "title": "Promotion Tier", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the promotion tier ID." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "promotion_tier" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_tier" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + }, + "19_res_validations_redeemables_promotion_stack": { + "type": "object", + "description": "Response schema model for validating a promotion stack.", + "title": "Promotion Stack", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the promotion stack ID." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "promotion_stack" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_stack" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." + }, + "19_res_validations-true": { + "type": "object", + "title": "True", + "description": "Response body schema for POST `/validations`.", + "properties": { + "valid": { + "type": "boolean", + "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", + "default": true + }, + "redeemables": { + "type": "array", + "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_res_validations_redeemables_discount_voucher" + }, + { + "$ref": "#/components/schemas/19_res_validations_redeemables_gift_card" + }, + { + "$ref": "#/components/schemas/19_res_validations_redeemables_loyalty_card" + }, + { + "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_tier" + }, + { + "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_stack" + } + ] + } + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_validation_res" + }, + "tracking_id": { + "type": "string", + "example": "track_VAVo1/z+G2GI2LPw==", + "description": "Hashed customer source ID." + }, + "session": { + "$ref": "#/components/schemas/19_res_session_lock" + } } - } - } - } - }, - "7_obj_redemption_object_gift_card_extended": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_validations-true_result_voucher_code": { + "type": "object", + "title": "Coupon Code", + "description": "This is a `result` object representing the results for a coupon code.", + "properties": { + "discount": { + "description": "Discount details about the type of discount to be applied for the redeemable.", + "oneOf": [ + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount_dynamic" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage_dynamic" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_order" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_items" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_shipping" + } + ] + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_voucher_object_discount_amount": { + "title": "Static Amount", + "type": "object", + "description": "Amount discount type based on a static value.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Applies an amount discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "amount_off": { + "type": "integer", + "example": 100, + "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", + "enum": [ + false + ] + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "19_obj_voucher_object_discount_amount_dynamic": { + "title": "Dynamic Amount", + "type": "object", + "description": "Amount discount type based on a formula.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Applies an amount discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", + "enum": [ + true + ] + } } - } - } - } - }, - "7_obj_redemption_object_gift_card_extended_stacked": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_voucher_object_discount_percentage": { + "title": "Percentage", + "type": "object", + "description": "Percentage discount type applied to an order (static or dynamic) or a percentage discount type applied to items (static).", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Applies a percentage discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "percent_off": { + "type": "integer", + "description": "Percent taken off the subtotal amount. In case of the percent being calculated by the formula and applied to the order level, i.e. the `is_dynamic` parameter is `true`, this value becomes a dynamically calculated value that varies based on the formula.", + "minimum": 0, + "maximum": 100 + }, + "amount_limit": { + "type": "string", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", + "enum": [ + false, + true + ] + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_voucher_object_discount_percentage_dynamic": { + "title": "Dynamic Percentage for Items", + "type": "object", + "description": "Percentage discount type applied to items and based on a formula (dynamic).", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Applies a percentage discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "amount_limit": { + "type": "string", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", + "enum": [ + true + ] + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "19_obj_voucher_object_discount_fixed_order": { + "title": "Fixed Order Amount", + "description": "Fixed discount type for an order.", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Sets a fixed total on the cart and then calculates the discount to apply." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER" + ], + "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |" + }, + "fixed_amount": { + "type": "integer", + "description": "Set a fixed valued for an order total. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.", + "example": 1000 + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the fixed amount is based on a formula that dynamically calculates the fixed amount.", + "enum": [ + false, + true + ] + } } - } - } - } - }, - "7_obj_rollback_redemption_object_truncated": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier_fail" - } - ] - }, - "7_obj_rollback_redemption_object_extended": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_discount_voucher_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_loyalty_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_gift_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_promotion_tier_extended" - } - ] - }, - "7_obj_rollback_redemption_object_discount_voucher_extended": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique rollback redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_voucher_object_discount_fixed_items": { + "title": "New Prices for Items", + "description": "Fixed discount type for item(s).", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Sets a new item price and then calculates the discount to apply." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ITEMS" + ], + "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |" + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag defaults to false because each item price could be defined separately and either based on a formula that dynamically calculates the discount or based on a fixed set price.", + "enum": [ + false + ] + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_voucher_object_discount_unit_one": { + "title": "Unit, single item", + "type": "object", + "description": "Single item type.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Applies a full value discount to item(s)." + }, + "effect": { + "type": "string", + "enum": [ + "ADD_NEW_ITEMS", + "ADD_MISSING_ITEMS" + ], + "default": "ADD_MISSING_ITEMS", + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "number", + "description": "Number of units to be granted a full value discount. ", + "example": 1, + "format": "float" + }, + "unit_type": { + "type": "string", + "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `sku_0a3efc90375d1217e2` or `prod_s3C0nDpr0DuC7`.", + "example": "prod_f1r5Tpr0DuC7" + }, + "sku": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0a3efc90375d1217e2", + "description": "Unique SKU ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "SKU source ID." + }, + "sku": { + "type": "string", + "description": "SKU name." + } + } + }, + "product": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "prod_0bc3bd76a61082e6b3", + "description": "Unique (parent) product ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of items is based on a formula.", + "enum": [ + false, + true + ] + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } - } - }, - "7_obj_rollback_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a loyalty card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_voucher_object_discount_unit_multiple": { + "title": "Unit, multiple items", + "type": "object", + "description": "Multiple item types.", + "properties": { + "type": { + "type": "string", + "description": "Applies a full value discount to item(s).", + "default": "UNIT" + }, + "effect": { + "type": "string", + "default": "ADD_MANY_ITEMS", + "description": "Defines the effect for adding multiple item types." + }, + "units": { + "type": "array", + "description": "Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.", + "items": { + "type": "object", + "description": "Object defining a unit discount.", + "properties": { + "effect": { + "type": "string", + "enum": [ + "ADD_NEW_ITEMS", + "ADD_MISSING_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount. In case of the unit being calculated by a formula, this value is the result of the dynamic calculation.", + "example": 1 + }, + "unit_type": { + "type": "string", + "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `prod_0bc3bd76a61082e6b3` or `sku_0a3efc90701d121820`.", + "example": "prod_f1r5Tpr0DuC7" + }, + "sku": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0a3efc90375d1217e2", + "description": "Unique SKU ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "SKU source ID." + }, + "sku": { + "type": "string", + "description": "SKU name." + } + } + }, + "product": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "prod_0bc3bd76a61082e6b3", + "description": "Unique (parent) product ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + } + } + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of items is based on a formula." + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_voucher_object_discount_shipping": { + "title": "Shipping", + "description": "Shipping discount type.", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Applies a full value discount to item(s)." + }, + "effect": { + "type": "string", + "description": "Defines how the unit is added to the customer's order.", + "default": "ADD_MISSING_ITEMS" + }, + "unit_off": { + "type": "number", + "format": "float", + "description": "Subtracts 1 shipping item from the subtotal.", + "default": 1 + }, + "unit_type": { + "type": "string", + "description": "The shipping product deemed as free.", + "default": "prod_5h1pp1ng" + }, + "product": { + "type": "object", + "description": "Defines the product details of the shipping product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h1pp1ng", + "description": "Unique product ID assigned by Voucherify, i.e. `prod_5h1pp1ng`.", + "default": "prod_5h1pp1ng" + }, + "source_id": { + "type": "string", + "description": "Product source ID.", + "default": "5h1pp1ng", + "example": "5h1pp1ng" + }, + "name": { + "type": "string", + "description": "Product name.", + "example": "Shipping", + "default": "Shipping" + } + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of shipping items is based on a formula.", + "default": false, + "enum": [ + false + ] + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + }, + "19_obj_validations-true_result_gift_card": { + "type": "object", + "title": "Gift Card", + "description": "This is a `result` object representing the results for a gift card.", + "properties": { + "gift": { + "description": "Stores the amount of gift card credits to be applied in the redemption.", + "type": "object", + "properties": { + "credits": { + "type": "integer", + "description": "Total number of gift card credits to be applied in the redemption expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } + } + } } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being returned to the loyalty card for the reward redemption rollback." + }, + "19_obj_validations-true_result_loyalty_card": { + "type": "object", + "title": "Loyalty Card", + "description": "This is a `result` object representing the results for a loyalty card.", + "properties": { + "loyalty_card": { + "description": "Stores the amount of loyalty card points to be applied in the redemption.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Total number of loyalty points to be applied in the redemption." + } + } + } } - } - } - } - }, - "7_obj_rollback_redemption_object_gift_card_extended": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount credited back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_validations-true_result_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is a `result` object representing the results for a promotion tier.", + "properties": { + "discount": { + "description": "Discount details about the type of discount to be applied for the redeemable.", + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ] + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + }, + "19_obj_validations-true_result_promotion_stack": { + "type": "object", + "title": "Promotion Stack", + "description": "This is a `result` object representing the results for a promotion stack.", + "properties": { + "loyalty_card": { + "description": "Stores the amount of loyalty card points to be applied in the redemption.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Total number of loyalty points to be applied in the redemption." + } + } + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being added back to the gift card for the redemption rollback.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount added back on the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } - } - }, - "7_obj_rollback_redemption_object_promotion_tier_extended": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the rollback redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + }, + "19_obj_order_object_validation_res": { + "type": "object", + "title": "Order", + "description": "Contains the combined effect of all redeemables taken into account on the order object properties.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items showing the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer_id": { + "type": "null" + }, + "referrer_id": { + "type": "null" + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } } - } - } - } - }, - "7_obj_redemption_object_discount_voucher": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_obj_order_object_validation_res_per_redeemable": { + "type": "object", + "title": "Order", + "description": "Contains the effect of each redeemable on the order and specific cart items. The amounts are consecutively built on the previous redeemable's effects, such that for each redeemable, the amounts are further reduced by the redeemable. The sequence in the request body is important because that will be the sequence the redeemables are applied one on top of the other.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items showing the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer_id": { + "type": "null" + }, + "referrer_id": { + "type": "null" + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "19_res_redemptions_parentRedemptionId_rollbacks": { + "type": "object", + "properties": { + "rollbacks": { + "type": "array", + "description": "Contains the rollback redemption objects of the particular incentives.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_discount_voucher_stacked" + }, + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_loyalty_card_stacked" + }, + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_gift_card_stacked" + }, + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_promotion_tier_stacked" + } + ] + } + }, + "parent_rollback": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "rr_0c675efbc2039b83b3", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_QszL0PS1NekVjQaHGxrbpPHu", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID.", + "example": "track_fxEMFisanb4sbl4Z4yCn" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2023-02-03T09:12:22.536Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "description": "Redemption rollback result", + "enum": [ + "SUCCESS" + ] + }, + "redemption": { + "type": "string", + "example": "r_0c656311b5878a2031", + "description": "Unique redemption ID of the initial redemption." + } + } + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked" + } }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" + "description": "Response body schema for POST `/redemptions/{parentRedemptionID}/rollbacks`.", + "title": "Rollback Stackable Redemptions Response Body" + }, + "19_obj_redemption_rollback_object_discount_voucher_stacked": { + "type": "object", + "title": "Rollback Discount Voucher", + "description": "This is an object representing a redemption rollback for a discount voucher.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eba630bc4979e70", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "discount": { + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ] + }, + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "DISCOUNT_VOUCHER" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + } + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + } } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } - } - }, - "7_obj_redemption_rollback_object_discount_voucher": { - "type": "object", - "title": "Rollback Discount Voucher", - "description": "This is an object representing a redemption rollback for a discount voucher.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eba630bc4979e70", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } - } - }, - "7_obj_redemption_rollback_object_loyalty_card": { - "type": "object", - "title": "Rollback Loyalty Card Voucher", - "description": "This is an object representing a redemption rollback for a loyalty card.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eaf4060133bf784", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "reward": { - "description": "Defines the reward that was initially redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being added back to the loyalty card for the reward redemption rollback." - } - } - } - } - }, - "7_obj_redemption_object_loyalty_card": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } - } - } - } - }, - "7_obj_redemption_object_loyalty_card_pay_with_points": { - "type": "object", - "description": "Defines the pay with points reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "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`.", - "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." + }, + "19_obj_redemption_rollback_object_loyalty_card_stacked": { + "type": "object", + "title": "Rollback Loyalty Card Voucher", + "description": "This is an object representing a redemption rollback for a loyalty card.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eaf4060133bf784", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "reward": { + "description": "Defines the reward that was initially redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - } - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "COIN" - ] - } - }, - "title": "Pay with Points Reward" - }, - "7_obj_redemption_object_loyalty_card_material_product": { - "type": "object", - "description": "Defines the product material reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "product": { - "description": "Details of the product redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_product_object_truncated" - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a material reward.", - "properties": { - "product": { - "type": "object", - "description": "Defines the product redeemed as a reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assignedy by Voucherify of the product.", - "example": "prod_0b2c2ddf35150b83bb" - }, - "sku_id": { - "type": "null" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption after the redemption rollback." + } + } + }, + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "LOYALTY_CARD" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "holder_id": { + "type": "string", + "description": "Unique customer ID of the loyalty card owner.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + } } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." } } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "MATERIAL" - ] - } - }, - "title": "Product Material Reward" - }, - "7_obj_redemption_object_loyalty_card_material_sku": { - "type": "object", - "description": "Defines the SKU material reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "product": { - "description": "Details of the SKU's parent product redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_product_object_truncated" - }, - "sku": { - "description": "Details of the SKU redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a material reward.", - "properties": { - "product": { - "type": "object", - "description": "Defines the SKU redeemed as a reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assignedy by Voucherify of the SKU's parent." - }, - "sku_id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify of the SKU redeemed as a reward." + }, + "19_obj_redemption_rollback_object_gift_card_stacked": { + "type": "object", + "title": "Rollback Gift Card", + "description": "This is an object representing a gift card redemption rollback.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "gift": { + "type": "object", + "description": "Contains the balance of the gift card after credits are added back to the gift card for the redemption rollback.", + "properties": { + "amount": { + "type": "integer", + "example": 10000, + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "balance": { + "type": "integer", + "example": 500, + "description": "Available funds after the redemption rollback credits back the amount used up during the initial redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the credits are applied to the customer's order." + } + } + }, + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "GIFT_VOUCHER" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + } } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0c5bf3323008a35032" } } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "MATERIAL" - ] - } - }, - "title": "SKU Material Reward" - }, - "7_obj_redemption_object_loyalty_card_digital": { - "type": "object", - "description": "Defines the digital reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Voucher object." - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a digital reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.", - "properties": { - "campaign": { - "description": "Defines the source of the digital reward.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_gift_card_credits" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_loyalty_card_points" + }, + "19_obj_redemption_rollback_object_promotion_tier_stacked": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption rollback", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - ] - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "CAMPAIGN" - ] - } - }, - "title": "Digital Reward" - }, - "7_obj_redemption_object_loyalty_card_digital_discount_voucher": { - "type": "object", - "title": "Discount Voucher", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "DISCOUNT_COUPONS" - ] - } - } - }, - "7_obj_redemption_object_loyalty_card_digital_gift_card_credits": { - "type": "object", - "title": "Gift Card", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "balance": { - "type": "integer", - "description": "The amount credited to the gift card as a reward expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "GIFT_VOUCHERS" - ] - } - } - }, - "7_obj_redemption_object_loyalty_card_digital_loyalty_card_points": { - "type": "object", - "title": "Loyalty Card", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "balance": { - "type": "integer", - "description": "The number of loyalty points that is added to the loyalty card as a reward." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "LOYALTY_PROGRAM" - ] - } - } - }, - "7_obj_redemption_rollback_object_gift_card": { - "type": "object", - "title": "Rollback Gift Card", - "description": "This is an object representing a gift card redemption rollback.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0c5bf3323008a35032" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "gift": { - "type": "object", - "description": "Contains the amount being adde back to the gift card for the redemption rollback", - "properties": { - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "name": { + "type": "string", + "description": "Promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website." + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } + } + } + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of initial redemption." + } } - } - } - } - }, - "7_obj_redemption_object_gift_card": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "19_res_redemptions_POST": { + "type": "object", + "title": "Stackable Redemptions Response Body", + "description": "Response body schema for POST `/redemptions`.", + "properties": { + "redemptions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended_stacked" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended_stacked" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended_stacked" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended_stacked" + } + ] + } + }, + "parent_redemption": { + "type": "object", + "title": "Stacked Redemption", + "description": "This is an object representing a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + }, + "customer": { + "type": "object", + "description": "Defines the customer making the stacked redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." + }, + "voucher": { + "type": "null" + } + } + }, + "order": { + "description": "Contains the order details associated with the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + } } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } - } - }, - "7_obj_redemption_object_voucher_fail": { - "type": "object", - "title": "Failed Voucher Redemption", - "description": "This is an object representing a failed redemption for a voucher.", - "properties": { - "id": { - "type": "string", - "example": "rf_0bbaccc96e0830ff9e", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "voucher": { - "type": "object", - "description": "Defines the voucher details.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } - } - }, - "7_obj_redemption_object_promotion_tier_fail": { - "type": "object", - "title": "Failed Promotion Tier Redemption", - "description": "This is an object representing a failed redemption for a promotion tier.", - "properties": { - "id": { - "type": "string", - "example": "rf_0bbaccc96e0830ff9e", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the promotion.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details about the promotion tier and it's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + }, + "7_obj_order_object_rollback": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption and redemption rollback.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "rollback_id": { + "type": "string", + "description": "Unique ID of the redemption rollback.", + "example": "rr_0c63c84eb78ee0a6c0" + }, + "rollback_date": { + "type": "string", + "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", + "example": "2023-01-31T14:18:37.150Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "enum": [ + "voucher", + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the related object that defines the incentive." + }, + "related_object_parent_id": { + "type": "string", + "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign." + } + } + } } } } - } - } - } - }, - "7_obj_redemption_object_fail": { - "type": "object", - "title": "Failed Redemption", - "description": "This is an object representing a failed redemption when a resource to be redeemed cannot be found.", - "properties": { - "id": { - "type": "string", - "example": "rf_0c4c7baf58c243af6b", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "null", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "null", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "not_found", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] + }, + "7_obj_order_object": { + "title": "Order object", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "oneOf": [ + { + "$ref": "#/components/schemas/7_obj_order_object_apply_to_order" + }, + { + "$ref": "#/components/schemas/7_obj_order_object_apply_to_items" + } + ] + }, + "7_obj_order_object_apply_to_order": { + "type": "object", + "title": "Order object - Effect: Apply to order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the order-level discount applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "This field sums up all order-level and all product-specific discounts applied in a particular request." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption.", + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" + } } - } - }, - "customer": { - "type": "null" - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| redemption | Related redemption. |\n", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "rf_0c5bde8dfc0156f0e3" - }, - "voucher": { - "type": "null" - } - } - }, - "7_obj_redemption_rollback_object_voucher_fail": { - "type": "object", - "title": "Failed Voucher Redemption Rollback", - "description": "This is an object representing a failed redemption rollback for a voucher.", - "properties": { - "id": { - "type": "string", - "example": "rrf_0c63990fed133bfb88", - "description": "Unique failed redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "failure_code": { - "type": "string", - "example": "already_rolled_back", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "voucher": { - "type": "object", - "description": "Defines the voucher details.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } - } - }, - "7_obj_redemption_rollback_object_promotion_tier_fail": { - "type": "object", - "title": "Failed Promotion Tier Redemption Rollback", - "description": "This is an object representing a failed redemption rollback for a promotion tier.", - "properties": { - "id": { - "type": "string", - "example": "rrf_0c5eb3bd884497ed05", - "description": "Unique failed redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the promotion.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details about the promotion tier and it's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + }, + "7_obj_order_object_apply_to_items": { + "type": "object", + "title": "Order object - Effect: Apply to items", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. " + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption.", + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" } } - } - } - } - }, - "7_obj_redemption_rollback_object_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption rollback", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of initial redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + }, + "7_obj_order_object_stacked_redemptions": { + "type": "object", + "title": "Order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. " + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the sum of all order-level discounts applied." + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied.\n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order.\n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption", + "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" } } - } - } - } - }, - "7_obj_redemption_object_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } + }, + "7_obj_redemption_object": { + "title": "Redemption Object", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such an operation a [redemption rollback](ref:rollback-redemption).", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_stackable_discounts" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_fail" } - } - } - } - } - }, - "7_obj_redemption_object_promotion_tier_extended": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "description": "Contains details of the promotion tier and the parent campaign.", - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - } - }, - "7_obj_redemption_object_promotion_tier_extended_stacked": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "description": "Contains details of the promotion tier and the parent campaign.", - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - } - }, - "7_obj_redemption_object_stackable_discounts": { - "type": "object", - "title": "Stacked Redemption", - "description": "This is an object representing a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer making the stacked redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." - }, - "voucher": { - "type": "null" - } - } - }, - "7_res_get_redemption": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" - } - ], - "title": "Get Redemption Response Body", - "description": "Response body schema for **GET** `/redemptions/{redemptionId}" - }, - "7_res_list_redemptions": { - "title": "List Redemptions Response Body", - "type": "object", - "description": "Response body schema for **GET** `/redemptions`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "redemptions", - "description": "Identifies the name of the attribute that contains the array of redemption objects." - }, - "redemptions": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" - } - ] - }, - "total": { - "type": "integer", - "description": "Total number of redemptions." - } - } - }, - "7_filter_conditions_string": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - } - } - }, - "7_res_get_vouchers_redemptions": { - "type": "object", - "title": "Get Voucher's Redemptions Response Body", - "description": "Response body schema for **GET** `/vouchers/{code}/redemption`.", - "properties": { - "quantity": { - "type": "integer", - "description": "The maximum number of times a voucher can be redeemed." - }, - "redeemed_quantity": { - "type": "integer", - "description": "The number of times the voucher was redeemed successfully." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/PROMO-CODE2/redemptions?page=1&limit=10", - "description": "URL " - }, - "data_ref": { - "type": "string", - "default": "redemption_entries", - "description": "Identifies the name of the attribute that contains the array of `redemption_entries`." - }, - "total": { - "type": "integer", - "description": "Total number of redemption objects." - }, - "redemption_entries": { - "type": "array", - "description": "Contains the array of successful and failed redemption objects.", - "items": { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher" - } - } - } - }, - "7_req_redeem_voucher": { - "title": "Redeem Voucher Request Body", - "description": "Request body schema for redeeming a voucher using **POST** `/vouchers/{code}/redemption`.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_req_redeem_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/7_req_redeem_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/7_req_redeem_voucher_loyalty_card" - } - ] - }, - "7_res_redeem_voucher": { - "title": "Redeem Voucher Response Body", - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_extended", - "description": "Response body schema for **POST** `/vouchers/{code}/redemption`." - }, - "7_req_redeem_promotion_tier": { - "title": "Redeem Promotion Tier", - "type": "object", - "description": "Redeem a promotion tier.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against promotion tiers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "7_req_redeem_voucher_discount_code": { - "title": "Discount Code", - "type": "object", - "description": "Redeem a discount code.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_discount_code" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { + ] + }, + "7_obj_redemption_object_voucher": { + "title": "Redemption Object", + "description": "This is an object representing an attempted or successful voucher redemption.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" + } + ] + }, + "7_obj_redemption_object_voucher_extended": { + "title": "Redemption Object", + "description": "This is an object representing an attempted or successful voucher redemption.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended" + } + ] + }, + "7_obj_redemption_object_discount_voucher_extended": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { "type": "string", "enum": [ - "category" + "SUCCESS", + "FAILURE" ], - "example": "category" - } - } - } - } - } - }, - "7_req_redeem_voucher_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Redeem a gift card.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_gift_card" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", "enum": [ - "category" - ], - "example": "category" + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." } } - } - } - } - }, - "7_req_redeem_voucher_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Redeem a loyalty card.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" + }, + "7_obj_redemption_object_discount_voucher_extended_stacked": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + } } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { + }, + "7_obj_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "result": { "type": "string", "enum": [ - "category" + "SUCCESS", + "FAILURE" ], - "example": "category" + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } + } } } - } - } - } - }, - "7_req_rollback_redemption": { - "title": "Rollback Redemption Request Body", - "type": "object", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_rollback_redemption_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_rollback_redemption_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "7_obj_redemption_object_loyalty_card_extended_stacked": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } + } + } } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_rollback_redemption_order_id" - }, - { - "$ref": "#/components/schemas/6_req_rollback_redemption_order_source_id" + }, + "7_obj_redemption_object_gift_card_extended": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } + } + } } - ], - "description": "Send order information to ensure the correct order is being undone." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to update **redemption** metadata." - } - }, - "description": "Request body schema for **POST** `/redemptions/{redemptionId}/rollback`." - }, - "7_res_rollback_redemption": { - "title": "Rollback Redemption Response Body", - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended", - "description": "Response body schema for **POST** `/redemptions/{redemptionId}/rollback`." - }, - "8_obj_loyalty_campaign_object": { - "title": "Loyalty Campaign Object", - "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", - "x-tags": [ - "LOYALTIES API" - ], - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Loyalty campaign name." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + }, + "7_obj_redemption_object_gift_card_extended_stacked": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - } - } - }, - "8_obj_loyalty_campaign_object_no_extended_categories": { - "title": "Loyalty Campaign Object", - "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Loyalty campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - } - } - }, - "8_obj_loyalty_card_object": { - "title": "Loyalty Card Object", - "type": "object", - "description": "This is an object representing a loyalty card.", - "examples": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + "7_obj_rollback_redemption_object_truncated": { + "title": "Rollback Redemption Object", + "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier_fail" + } + ] }, - "object": "voucher" - } - ], - "properties": { - "id": { - "type": "string", - "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", - "description": "Assigned by the Voucherify API, identifies the voucher." - }, - "code": { - "type": "string", - "example": "WVPblOYX", - "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." - }, - "campaign": { - "type": "string", - "example": "Loyalty Card Campaign", - "description": "A unique campaign name, identifies the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." - }, - "category_id": { - "type": "string", - "description": "Unique category ID assigned by Voucherify.", - "example": "cat_0bb343dee3cdb5ec0c" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ], - "description": "Defines the type of voucher. " - }, - "discount": { - "default": null, - "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", - "type": "null" - }, - "gift": { - "type": "null", - "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." - }, - "loyalty_card": { - "type": "object", - "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption." - }, - "next_expiration_date": { - "type": "string", - "format": "date", - "example": "2023-05-30", - "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", - "example": "2021-12-01T00:00:00.000Z", - "format": "date-time", - "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " - }, - "expiration_date": { - "type": "string", - "example": "2021-12-31T00:00:00.000Z", - "format": "date-time", - "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." - }, - "validity_timeframe": { - "type": "object", - "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": { - "duration": { - "type": "string", - "example": "PT1H", - "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." - }, - "interval": { - "type": "string", - "example": "P2D", - "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", - "enum": [ - [ - 0 - ], - [ - 1 - ], - [ - 2 - ], - [ - 3 - ], - [ - 4 - ], - [ - 5 - ], - [ - 6 + "7_obj_rollback_redemption_object_extended": { + "title": "Rollback Redemption Object", + "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_discount_voucher_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_loyalty_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_gift_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_promotion_tier_extended" + } ] - ], - "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" - } - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "additional_info": { - "type": "string", - "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`" + }, + "7_obj_rollback_redemption_object_discount_voucher_extended": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique rollback redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - } - }, - "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`" + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." } } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - }, - "created_at": { - "type": "string", - "example": "2021-12-22T10:13:06.487Z", - "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2021-12-22T10:14:45.316Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." - }, - "holder_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of voucher owner." - }, - "redemption": { - "type": "object", - "description": "Stores a summary of redemptions that have been applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - }, - "redeemed_quantity": { - "type": "integer", - "example": 1, - "description": "How many times a voucher has already been redeemed." - }, - "redeemed_points": { - "type": "integer", - "example": 100000, - "description": "Total loyalty points redeemed." - }, - "object": { - "type": "string", - "default": "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", - "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", - "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" - } - } - }, - "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", - "properties": { - "object": { - "type": "string", - "default": "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", - "example": 0, - "description": "Publication events counter." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", - "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `voucher`.", - "default": "voucher" - } - }, - "x-tags": [ - "LOYALTIES API" - ] - }, - "8_obj_loyalty_reward_object": { - "title": "Loyalty Reward Object", - "type": "object", - "description": "This is an object representing a loyalty reward.", - "x-tags": [ - "LOYALTIES API" - ], - "properties": { - "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "assignment": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - }, - "object": { - "type": "string", - "default": "loyalty_reward", - "description": "The type of object represented by JSON. This object stores information about the loyalty reward object." - } - } - }, - "8_obj_loyalty_points_bucket": { - "type": "object", - "title": "Loyalty Points Bucket Object", - "description": "This is an object representing a loyalty points bucket.", - "properties": { - "id": { - "type": "string", - "example": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", - "description": "Unique loyalty points bucket ID." - }, - "voucher_id": { - "type": "string", - "example": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "description": "Unique parent loyalty card ID." - }, - "campaign_id": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "description": "Unique parent campaign ID." - }, - "bucket": { - "type": "object", - "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." - } - } - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE" - ], - "description": "Loyalty points bucket point status." - }, - "expires_at": { - "type": "string", - "example": "2022-11-30", - "format": "date", - "description": "Date when the number of points defined in the `bucket` object are due to expire." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-21T13:49:54.949Z", - "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-08-30T08:34:45.989Z", - "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", - "default": "loyalty_points_bucket", - "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." - } - } - }, - "8_obj_loyalty_tier_reward_object": { - "title": "Loyalty Tier Reward Object", - "type": "object", - "description": "This is an object representing a loyalty tier reward.", - "x-tags": [ - "LOYALTIES API" - ], - "properties": { - "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "assignment": { - "$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." - } - } - }, - "8_obj_loyalty_card_object_non_expanded_categories": { - "title": "Loyalty Card Object", - "type": "object", - "description": "This is an object representing a loyalty card.", - "examples": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + "7_obj_rollback_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a loyalty card rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being returned to the loyalty card for the reward redemption rollback." + } + } + } } }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - } - ], - "properties": { - "id": { - "type": "string", - "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", - "description": "Assigned by the Voucherify API, identifies the voucher." - }, - "code": { - "type": "string", - "example": "WVPblOYX", - "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." - }, - "campaign": { - "type": "string", - "example": "Loyalty Card Campaign", - "description": "A unique campaign name, identifies the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." - }, - "category_id": { - "type": "string", - "description": "Unique category ID assigned by Voucherify.", - "example": "cat_0bb343dee3cdb5ec0c" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ], - "description": "Defines the type of voucher. " - }, - "discount": { - "default": null, - "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", - "type": "null" - }, - "gift": { - "type": "null", - "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." - }, - "loyalty_card": { - "type": "object", - "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption." - }, - "next_expiration_date": { - "type": "string", - "format": "date", - "example": "2023-05-30", - "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", - "example": "2021-12-01T00:00:00.000Z", - "format": "date-time", - "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " - }, - "expiration_date": { - "type": "string", - "example": "2021-12-31T00:00:00.000Z", - "format": "date-time", - "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." - }, - "validity_timeframe": { - "type": "object", - "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": { - "duration": { - "type": "string", - "example": "PT1H", - "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." - }, - "interval": { - "type": "string", - "example": "P2D", - "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", - "enum": [ - [ - 0 - ], - [ - 1 - ], - [ - 2 - ], - [ - 3 - ], - [ - 4 - ], - [ - 5 - ], - [ - 6 - ] - ], - "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" - } - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "additional_info": { - "type": "string", - "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`" + "7_obj_rollback_redemption_object_gift_card_extended": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount credited back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - } - }, - "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`" + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being added back to the gift card for the redemption rollback.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount added back on the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } } } } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - }, - "created_at": { - "type": "string", - "example": "2021-12-22T10:13:06.487Z", - "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2021-12-22T10:14:45.316Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." - }, - "holder_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of voucher owner." - }, - "redemption": { - "type": "object", - "description": "Stores a summary of redemptions that have been applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - }, - "redeemed_quantity": { - "type": "integer", - "example": 1, - "description": "How many times a voucher has already been redeemed." - }, - "redeemed_points": { - "type": "integer", - "example": 100000, - "description": "Total loyalty points redeemed." - }, - "object": { - "type": "string", - "default": "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", - "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", - "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" - } - } - }, - "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", - "properties": { - "object": { - "type": "string", - "default": "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", - "example": 0, - "description": "Publication events counter." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", - "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `voucher`.", - "default": "voucher" - } - } - }, - "8_res_get_loyalty_card_transactions": { - "title": "Get Loyalty Card Transactions Response Body", - "type": "object", - "description": "List of loyalty card transactions", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of transaction objects." - }, - "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/1_obj_loyalty_card_transaction_object" - } - }, - "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." - } - } - }, - "1_obj_loyalty_card_transaction_object": { - "title": "Loyalty Card Transaction Object", - "description": "Loyalty card transaction object", - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_redemption" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual_custom_event" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_refund" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_addition" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_removal" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_expiration" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_out" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_in" - } - ] - }, - "1_obj_loyalty_card_transaction_object_redemption": { - "title": "Redemption", - "description": "When loyalty points are used to pay for an order.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a redemption, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "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`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REDEMPTION", - "enum": [ - "POINTS_REDEMPTION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points prior to the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + }, + "7_obj_rollback_redemption_object_promotion_tier_extended": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the rollback redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_accrual": { - "title": "Accrual", - "description": "When points are earned on the card through an earning rule.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } } } } } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." + } + }, + "7_obj_redemption_object_discount_voucher": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - } - }, - "event": { - "type": "object", - "description": "Contains information about the event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.order.paid" + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } } } } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_accrual_custom_event": { - "title": "Accrual for Custom Event", - "description": "When points are earned on the card through an earning rule based on a custom event.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + }, + "7_obj_redemption_rollback_object_discount_voucher": { + "type": "object", + "title": "Rollback Discount Voucher", + "description": "This is an object representing a redemption rollback for a discount voucher.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eba630bc4979e70", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } } - } - }, - "event": { - "type": "object", - "description": "Contains information about the customer event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.custom_event" + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } } } - }, - "custom_event": { - "type": "object", - "description": "Contains information about the custom event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "event_0cc916d8374bfe8bc2" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" + } + }, + "7_obj_redemption_rollback_object_loyalty_card": { + "type": "object", + "title": "Rollback Loyalty Card Voucher", + "description": "This is an object representing a redemption rollback for a loyalty card.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eaf4060133bf784", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - } - }, - "event_schema": { - "type": "object", - "description": "Contains information about the custom event metadata schema.", - "properties": { - "id": { - "type": "string", - "description": "Unique metadata schema ID.", - "example": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + }, + "reward": { + "description": "Defines the reward that was initially redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being added back to the loyalty card for the reward redemption rollback." + } } } } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_refund": { - "title": "Refund", - "description": "When points are credited back to a card through a redemption rollback.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points refund, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a points refund, this value is `null`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points refund, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REFUND", - "enum": [ - "POINTS_REFUND" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + }, + "7_obj_redemption_object_loyalty_card": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } } - } - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID.", - "example": "rr_0c9b0967244a862a33" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } } } } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_addition": { - "title": "Addition", - "description": "When points are added to a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ADDITION", - "enum": [ - "POINTS_ADDITION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + }, + "7_obj_redemption_object_loyalty_card_pay_with_points": { + "type": "object", + "description": "Defines the pay with points reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_removal": { - "title": "Removal", - "description": "When points are removed from a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REMOVAL", - "enum": [ - "POINTS_REMOVAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "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`.", + "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." + } } } } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "COIN" + ] } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_expiration": { - "title": "Expiration", - "description": "When points expire.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points expiration, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points expiration, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_EXPIRATION", - "enum": [ - "POINTS_EXPIRATION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points removed during 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + }, + "title": "Pay with Points Reward" + }, + "7_obj_redemption_object_loyalty_card_material_product": { + "type": "object", + "description": "Defines the product material reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_transfer_out": { - "title": "Transfer Out", - "description": "When points are transferred from one loyalty card to another.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_OUT", - "enum": [ - "POINTS_TRANSFER_OUT" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "product": { + "description": "Details of the product redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a material reward.", + "properties": { + "product": { + "type": "object", + "description": "Defines the product redeemed as a reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assignedy by Voucherify of the product.", + "example": "prod_0b2c2ddf35150b83bb" + }, + "sku_id": { + "type": "null" + } } } } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "MATERIAL" + ] } }, - "destination_voucher": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the destination voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the destination voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. This does not mean that the transferred points were added to this bucket. It only shows the next set of points due to expire. The transferred points are added to the last expiring bucket, i.e. to the bucket of points that are to expire the furthest in the future.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the next expiration date." - } - } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the receiving card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_transfer_in": { - "title": "Transfer In", - "description": "When points are transferred in from another loyalty card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a ponits transfer, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_IN", - "enum": [ - "POINTS_TRANSFER_IN" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "title": "Product Material Reward" + }, + "7_obj_redemption_object_loyalty_card_material_sku": { + "type": "object", + "description": "Defines the SKU material reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "product": { + "description": "Details of the SKU's parent product redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "sku": { + "description": "Details of the SKU redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a material reward.", + "properties": { + "product": { + "type": "object", + "description": "Defines the SKU redeemed as a reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assignedy by Voucherify of the SKU's parent." + }, + "sku_id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify of the SKU redeemed as a reward." + } } } } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "MATERIAL" + ] } }, - "source_voucher": { - "type": "object", - "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the source voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the source voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "holder_id": { - "type": "string", - "description": "Unqiue customer ID of the loyalty card holder, this is the ID that was assigned by the Voucherify API.", - "example": "cust_xqA7DGj5eYPHg6PHVKwYRWiA" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the source loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after 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." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. The points from the source loyalty card are taken from the expiration bucket(s) that are the first coming up to expire, starting from the first expiration bucket to expire in time. This parameter shows the next expiration date after the points were taken out of the loyalty card.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the expiration date." - } + "title": "SKU Material Reward" + }, + "7_obj_redemption_object_loyalty_card_digital": { + "type": "object", + "description": "Defines the digital reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Voucher object." + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a digital reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.", + "properties": { + "campaign": { + "description": "Defines the source of the digital reward.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_gift_card_credits" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_loyalty_card_points" + } + ] } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "CAMPAIGN" + ] + } + }, + "title": "Digital Reward" + }, + "7_obj_redemption_object_loyalty_card_digital_discount_voucher": { + "type": "object", + "title": "Discount Voucher", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "DISCOUNT_COUPONS" + ] } } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the source card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "8_req_create_loyalty_card_transactions_export": { - "type": "object", - "title": "Create Loyalty Card Transactions Export Request Body", - "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", - "description": "Contains the parameters that define the data to be exported." - } - } - }, - "8_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" - } - } - } - }, - "8_obj_export_transactions_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [loyalty card transactions](ref:list-loyalty-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "default": "API" - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "default": "voucher_transactions" - }, - "parameters": { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - }, - "result": { - "type": "object", - "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](ref:download-export) method." + }, + "7_obj_redemption_object_loyalty_card_digital_gift_card_credits": { + "type": "object", + "title": "Gift Card", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "balance": { + "type": "integer", + "description": "The amount credited to the gift card as a reward expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "GIFT_VOUCHERS" + ] + } } - } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" - } - } - }, - "8_obj_loyalty_tier_object": { - "type": "object", - "title": "Loyalty Tier Object", - "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "properties": { - "id": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": "object", - "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", - "example": "2022-11-10T12:20:52.755Z", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-25T10:59:43.231Z", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "earning_rules": { - "type": "object", - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", - "properties": { - "unique_earning_rule_ID": { - "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] + }, + "7_obj_redemption_object_loyalty_card_digital_loyalty_card_points": { + "type": "object", + "title": "Loyalty Card", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "balance": { + "type": "integer", + "description": "The number of loyalty points that is added to the loyalty card as a reward." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "LOYALTY_PROGRAM" + ] + } } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" + }, + "7_obj_redemption_rollback_object_gift_card": { + "type": "object", + "title": "Rollback Gift Card", + "description": "This is an object representing a gift card redemption rollback.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0c5bf3323008a35032" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + }, + "gift": { + "type": "object", + "description": "Contains the amount being adde back to the gift card for the redemption rollback", + "properties": { + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } } } } - } - }, - "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." - } - } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." - } - } - }, - "8_obj_loyalty_tier_object_member": { - "type": "object", - "title": "Loyalty Tier Object", - "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "properties": { - "id": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": "object", - "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", - "example": "2022-11-10T12:20:52.755Z", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-25T10:59:43.231Z", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "earning_rules": { - "type": "object", - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", - "properties": { - "unique_earning_rule_ID": { - "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" + }, + "7_obj_redemption_object_gift_card": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } } - ] - } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } } } } - } - }, - "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": "Contains information about when the expiration tier will expire.", - "properties": { - "customer_id": { - "type": "string", - "example": "cust_qBwHpagDOFu71Z3F22UzR80X", - "description": "Unique customer ID whose point expiration dates are defined in this object." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "tier_id": { - "type": "string", - "example": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "description": "Unique loyalty tier ID." - }, - "start_date": { - "type": "string", - "example": "2022-11-10", - "description": "Exact start date of the loyalty tier for the given customer." - }, - "expiration_date": { - "type": "string", - "example": "2023-02-28", - "description": "Exact expiration date of the loyalty tier for the given customer." - }, - "created_at": { - "type": "string", - "example": "2022-11-09T11:26:26.719Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-11-10T08:54:47.200Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - } - } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." - } - } - }, - "8_obj_mapping_multiply": { - "type": "object", - "title": "Multiply Points", - "description": "Points are multiplied by a multiplier.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "MULTIPLY" - ] - }, - "multiplier": { - "type": "integer", - "description": "Multiplication factor used to multiply the points to obtain the mapped points." - } - } - }, - "8_obj_mapping_fixed": { - "type": "object", - "title": "Fixed Points", - "description": "Points are fixed.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "CUSTOM" - ] - }, - "points": { - "type": "integer", - "description": "Fixed number of points to be applied." - } - } - }, - "8_obj_earning_rule_object": { - "description": "This is an object representing an earning rule.", - "title": "Earning Rule Object", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - }, - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - }, - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_object_voucher_fail": { + "type": "object", + "title": "Failed Voucher Redemption", + "description": "This is an object representing a failed redemption for a voucher.", + "properties": { + "id": { + "type": "string", + "example": "rf_0bbaccc96e0830ff9e", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "voucher": { + "type": "object", + "description": "Defines the voucher details.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } } } }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_object_promotion_tier_fail": { + "type": "object", + "title": "Failed Promotion Tier Redemption", + "description": "This is an object representing a failed redemption for a promotion tier.", + "properties": { + "id": { + "type": "string", + "example": "rf_0bbaccc96e0830ff9e", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the promotion.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details about the promotion tier and it's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } + } + } + } } } }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_object_fail": { + "type": "object", + "title": "Failed Redemption", + "description": "This is an object representing a failed redemption when a resource to be redeemed cannot be found.", + "properties": { + "id": { + "type": "string", + "example": "rf_0c4c7baf58c243af6b", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "null", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "null", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "not_found", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "null" + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| redemption | Related redemption. |\n", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "rf_0c5bde8dfc0156f0e3" + }, + "voucher": { + "type": "null" } } }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" - } - ] - }, - "8_obj_earning_rule_object_no_validation_rule": { - "description": "This is an object representing an earning rule.", - "title": "Earning Rule Object", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - }, - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - }, - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_rollback_object_voucher_fail": { + "type": "object", + "title": "Failed Voucher Redemption Rollback", + "description": "This is an object representing a failed redemption rollback for a voucher.", + "properties": { + "id": { + "type": "string", + "example": "rrf_0c63990fed133bfb88", + "description": "Unique failed redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "failure_code": { + "type": "string", + "example": "already_rolled_back", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "voucher": { + "type": "object", + "description": "Defines the voucher details.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } } } }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_rollback_object_promotion_tier_fail": { + "type": "object", + "title": "Failed Promotion Tier Redemption Rollback", + "description": "This is an object representing a failed redemption rollback for a promotion tier.", + "properties": { + "id": { + "type": "string", + "example": "rrf_0c5eb3bd884497ed05", + "description": "Unique failed redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the promotion.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details about the promotion tier and it's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } + } + } + } } } }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "7_obj_redemption_rollback_object_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption rollback", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of initial redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } + } + } + } } } }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier_no_validation_rule" - } - ] - }, - "8_obj_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + "7_obj_redemption_object_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } + } + } + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" + "7_obj_redemption_object_promotion_tier_extended": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "description": "Contains details of the promotion tier and the parent campaign.", + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "7_obj_redemption_object_promotion_tier_extended_stacked": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "description": "Contains details of the promotion tier and the parent campaign.", + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + }, + "7_obj_redemption_object_stackable_discounts": { + "type": "object", + "title": "Stacked Redemption", + "description": "This is an object representing a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer making the stacked redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." + }, + "voucher": { + "type": "null" + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_update_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "7_res_get_redemption": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" + } + ], + "title": "Get Redemption Response Body", + "description": "Response body schema for **GET** `/redemptions/{redemptionId}" }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" + "7_res_list_redemptions": { + "title": "List Redemptions Response Body", + "type": "object", + "description": "Response body schema for **GET** `/redemptions`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "redemptions", + "description": "Identifies the name of the attribute that contains the array of redemption objects." + }, + "redemptions": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" + } + ] + }, + "total": { + "type": "integer", + "description": "Total number of redemptions." + } } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "7_filter_conditions_string": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + } } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + }, + "7_res_get_vouchers_redemptions": { + "type": "object", + "title": "Get Voucher's Redemptions Response Body", + "description": "Response body schema for **GET** `/vouchers/{code}/redemption`.", + "properties": { + "quantity": { + "type": "integer", + "description": "The maximum number of times a voucher can be redeemed." + }, + "redeemed_quantity": { + "type": "integer", + "description": "The number of times the voucher was redeemed successfully." + }, + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/PROMO-CODE2/redemptions?page=1&limit=10", + "description": "URL " + }, + "data_ref": { + "type": "string", + "default": "redemption_entries", + "description": "Identifies the name of the attribute that contains the array of `redemption_entries`." + }, + "total": { + "type": "integer", + "description": "Total number of redemption objects." + }, + "redemption_entries": { + "type": "array", + "description": "Contains the array of successful and failed redemption objects.", + "items": { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher" + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_order_paid_no_validation_rule": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "7_req_redeem_voucher": { + "title": "Redeem Voucher Request Body", + "description": "Request body schema for redeeming a voucher using **POST** `/vouchers/{code}/redemption`.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_req_redeem_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/7_req_redeem_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/7_req_redeem_voucher_loyalty_card" + } + ] }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" + "7_res_redeem_voucher": { + "title": "Redeem Voucher Response Body", + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_extended", + "description": "Response body schema for **POST** `/vouchers/{code}/redemption`." }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "7_req_redeem_promotion_tier": { + "title": "Redeem Promotion Tier", + "type": "object", + "description": "Redeem a promotion tier.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against promotion tiers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + "7_req_redeem_voucher_discount_code": { + "title": "Discount Code", + "type": "object", + "description": "Redeem a discount code.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_discount_code" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { + "type": "string", + "enum": [ + "category" + ], + "example": "category" + } + } + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + "7_req_redeem_voucher_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Redeem a gift card.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_gift_card" + }, + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { + "type": "string", + "enum": [ + "category" + ], + "example": "category" + } + } + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_update_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + "7_req_redeem_voucher_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Redeem a loyalty card.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." + } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { + "type": "string", + "enum": [ + "category" + ], + "example": "category" + } + } + } + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_entered_segment_no_validation_rule": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" + "7_req_rollback_redemption": { + "title": "Rollback Redemption Request Body", + "type": "object", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_rollback_redemption_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_rollback_redemption_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_rollback_redemption_order_id" + }, + { + "$ref": "#/components/schemas/6_req_rollback_redemption_order_source_id" + } + ], + "description": "Send order information to ensure the correct order is being undone." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to update **redemption** metadata." + } }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" + "description": "Request body schema for **POST** `/redemptions/{redemptionId}/rollback`." }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "7_res_rollback_redemption": { + "title": "Rollback Redemption Response Body", + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended", + "description": "Response body schema for **POST** `/redemptions/{redemptionId}/rollback`." }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + "8_obj_loyalty_campaign_object": { + "title": "Loyalty Campaign Object", + "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", + "x-tags": [ + "LOYALTIES API" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Loyalty campaign name." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "8_obj_loyalty_campaign_object_no_extended_categories": { + "title": "Loyalty Campaign Object", + "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Loyalty campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + } + } }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + "8_obj_loyalty_card_object": { + "title": "Loyalty Card Object", + "type": "object", + "description": "This is an object representing a loyalty card.", + "examples": [ + { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + } + ], + "properties": { + "id": { + "type": "string", + "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", + "description": "Assigned by the Voucherify API, identifies the voucher." + }, + "code": { + "type": "string", + "example": "WVPblOYX", + "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + }, + "campaign": { + "type": "string", + "example": "Loyalty Card Campaign", + "description": "A unique campaign name, identifies the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + }, + "category_id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify.", + "example": "cat_0bb343dee3cdb5ec0c" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ], + "description": "Defines the type of voucher. " + }, + "discount": { + "default": null, + "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", + "type": "null" + }, + "gift": { + "type": "null", + "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." + }, + "loyalty_card": { + "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption." + }, + "next_expiration_date": { + "type": "string", + "format": "date", + "example": "2023-05-30", + "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", + "example": "2021-12-01T00:00:00.000Z", + "format": "date-time", + "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " + }, + "expiration_date": { + "type": "string", + "example": "2021-12-31T00:00:00.000Z", + "format": "date-time", + "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." + }, + "validity_timeframe": { + "type": "object", + "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": { + "duration": { + "type": "string", + "example": "PT1H", + "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." + }, + "interval": { + "type": "string", + "example": "P2D", + "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", + "enum": [ + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ], + "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" + } + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "additional_info": { + "type": "string", + "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." + }, + "created_at": { + "type": "string", + "example": "2021-12-22T10:13:06.487Z", + "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2021-12-22T10:14:45.316Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." + }, + "holder_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of voucher owner." + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + }, + "redeemed_quantity": { + "type": "integer", + "example": 1, + "description": "How many times a voucher has already been redeemed." + }, + "redeemed_points": { + "type": "integer", + "example": 100000, + "description": "Total loyalty points redeemed." + }, + "object": { + "type": "string", + "default": "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", + "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" + } + } + }, + "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", + "properties": { + "object": { + "type": "string", + "default": "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", + "example": 0, + "description": "Publication events counter." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", + "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" + } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `voucher`.", + "default": "voucher" + } }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + "x-tags": [ + "LOYALTIES API" + ] + }, + "8_obj_loyalty_reward_object": { + "title": "Loyalty Reward Object", + "type": "object", + "description": "This is an object representing a loyalty reward.", + "x-tags": [ + "LOYALTIES API" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "assignment": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "object": { + "type": "string", + "default": "loyalty_reward", + "description": "The type of object represented by JSON. This object stores information about the loyalty reward object." + } } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "8_obj_loyalty_points_bucket": { + "type": "object", + "title": "Loyalty Points Bucket Object", + "description": "This is an object representing a loyalty points bucket.", + "properties": { + "id": { + "type": "string", + "example": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", + "description": "Unique loyalty points bucket ID." + }, + "voucher_id": { + "type": "string", + "example": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "description": "Unique parent loyalty card ID." + }, + "campaign_id": { + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "description": "Unique parent campaign ID." + }, + "bucket": { + "type": "object", + "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." + } + } + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE" + ], + "description": "Loyalty points bucket point status." + }, + "expires_at": { + "type": "string", + "example": "2022-11-30", + "format": "date", + "description": "Date when the number of points defined in the `bucket` object are due to expire." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-11-21T13:49:54.949Z", + "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-08-30T08:34:45.989Z", + "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", + "default": "loyalty_points_bucket", + "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." + } } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "8_obj_loyalty_tier_reward_object": { + "title": "Loyalty Tier Reward Object", + "type": "object", + "description": "This is an object representing a loyalty tier reward.", + "x-tags": [ + "LOYALTIES API" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "assignment": { + "$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." + } } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_update_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + "8_obj_loyalty_card_object_non_expanded_categories": { + "title": "Loyalty Card Object", + "type": "object", + "description": "This is an object representing a loyalty card.", + "examples": [ + { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + } + ], + "properties": { + "id": { + "type": "string", + "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", + "description": "Assigned by the Voucherify API, identifies the voucher." + }, + "code": { + "type": "string", + "example": "WVPblOYX", + "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + }, + "campaign": { + "type": "string", + "example": "Loyalty Card Campaign", + "description": "A unique campaign name, identifies the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + }, + "category_id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify.", + "example": "cat_0bb343dee3cdb5ec0c" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ], + "description": "Defines the type of voucher. " + }, + "discount": { + "default": null, + "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", + "type": "null" + }, + "gift": { + "type": "null", + "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." + }, + "loyalty_card": { + "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption." + }, + "next_expiration_date": { + "type": "string", + "format": "date", + "example": "2023-05-30", + "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", + "example": "2021-12-01T00:00:00.000Z", + "format": "date-time", + "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " + }, + "expiration_date": { + "type": "string", + "example": "2021-12-31T00:00:00.000Z", + "format": "date-time", + "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." + }, + "validity_timeframe": { + "type": "object", + "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": { + "duration": { + "type": "string", + "example": "PT1H", + "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." + }, + "interval": { + "type": "string", + "example": "P2D", + "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", + "enum": [ + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ], + "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" + } + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "additional_info": { + "type": "string", + "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." + }, + "created_at": { + "type": "string", + "example": "2021-12-22T10:13:06.487Z", + "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2021-12-22T10:14:45.316Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." + }, + "holder_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of voucher owner." + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + }, + "redeemed_quantity": { + "type": "integer", + "example": 1, + "description": "How many times a voucher has already been redeemed." + }, + "redeemed_points": { + "type": "integer", + "example": 100000, + "description": "Total loyalty points redeemed." + }, + "object": { + "type": "string", + "default": "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", + "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" + } + } + }, + "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", + "properties": { + "object": { + "type": "string", + "default": "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", + "example": 0, + "description": "Publication events counter." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", + "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" + } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `voucher`.", + "default": "voucher" + } } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + }, + "8_res_get_loyalty_card_transactions": { + "title": "Get Loyalty Card Transactions Response Body", + "type": "object", + "description": "List of loyalty card transactions", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of transaction objects." + }, + "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/1_obj_loyalty_card_transaction_object" + } + }, + "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." + } } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_custom_event_no_validation_rule": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "1_obj_loyalty_card_transaction_object": { + "title": "Loyalty Card Transaction Object", + "description": "Loyalty card transaction object", + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_redemption" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual_custom_event" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_refund" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_addition" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_removal" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_expiration" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_out" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_in" + } + ] }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" + "1_obj_loyalty_card_transaction_object_redemption": { + "title": "Redemption", + "description": "When loyalty points are used to pay for an order.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a redemption, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "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`." + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REDEMPTION", + "enum": [ + "POINTS_REDEMPTION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points prior to the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." + } + } + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" + } + } + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID.", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" + }, + "name": { + "type": "string", + "description": "Reward name.", + "example": "100 = $20" + } + } + } + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_update_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_tier_no_validation_rule": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.", - "type": "null" - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_fixed_points": { - "title": "Define Fixed Amount of Points", - "type": "object", - "description": "This is an object representing points calculated based on a fixed value.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points to be added to the loyalty card.", - "example": 100 - }, - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", - "enum": [ - "FIXED" - ] - } - } - }, - "8_obj_calculate_points_proportionally_order_paid": { - "title": "Calculate Points Proportionally", - "description": "This is an object representing points calculated proportionally to another property.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_amounts" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_total_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_item_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_subtotal_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_quantity" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "8_obj_calculate_points_proportionally_order_amounts": { - "title": "Calculate Points Proportionally to Order Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_AMOUNT" - ], - "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" - }, - "order": { - "type": "object", - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "1_obj_loyalty_card_transaction_object_accrual": { + "title": "Accrual", + "description": "When points are earned on the card through an earning rule.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points accrual, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ACCRUAL", + "enum": [ + "POINTS_ACCRUAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." + } + } + }, + "event": { + "type": "object", + "description": "Contains information about the event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "evcus_0c9c21def34e3c05bf" + }, + "type": { + "type": "string", + "description": "Type of event.", + "example": "customer.order.paid" + } + } + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID.", + "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" + }, + "source": { + "type": "object", + "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." + } + } + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_order_total_amount": { - "title": "Calculate Points Proportionally to Total Order Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_TOTAL_AMOUNT" - ], - "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" - }, - "order": { - "type": "object", - "properties": { - "total_amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "1_obj_loyalty_card_transaction_object_accrual_custom_event": { + "title": "Accrual for Custom Event", + "description": "When points are earned on the card through an earning rule based on a custom event.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points accrual, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ACCRUAL", + "enum": [ + "POINTS_ACCRUAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "event": { + "type": "object", + "description": "Contains information about the customer event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "evcus_0c9c21def34e3c05bf" + }, + "type": { + "type": "string", + "description": "Type of event.", + "example": "customer.custom_event" + } + } + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID.", + "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" + }, + "source": { + "type": "object", + "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." + } + } + } + } + }, + "custom_event": { + "type": "object", + "description": "Contains information about the custom event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "event_0cc916d8374bfe8bc2" + }, + "type": { + "type": "string", + "description": "Type of custom event.", + "example": "user_subscribed" + } + } + }, + "event_schema": { + "type": "object", + "description": "Contains information about the custom event metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID.", + "example": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "type": { + "type": "string", + "description": "Type of custom event.", + "example": "user_subscribed" + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_order_metadata": { - "title": "Calculate Points Proportionally To an Order Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to an order metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_METADATA" - ], - "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `order.metadata` object)" - }, - "order": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the order metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "number_of_store_visits", - "description": "Order metadata property." + }, + "1_obj_loyalty_card_transaction_object_refund": { + "title": "Refund", + "description": "When points are credited back to a card through a redemption rollback.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points refund, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a points refund, this value is `null`." + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points refund, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REFUND", + "enum": [ + "POINTS_REFUND" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." + } + } + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" + } + } + }, + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID.", + "example": "rr_0c9b0967244a862a33" + } + } + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID.", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" + }, + "name": { + "type": "string", + "description": "Reward name.", + "example": "100 = $20" + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_item_amount": { - "title": "Calculate Points Proportionally to Order Items Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_AMOUNT" - ], - "description": "- `ORDER_ITEMS_AMOUNT`; Pre-discount amount spent on items defined in the `order_items.amount.object` & `.id` (X points for every Y spent on items excluding discounts)" - }, - "order_items": { - "type": "object", - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + }, + "1_obj_loyalty_card_transaction_object_addition": { + "title": "Addition", + "description": "When points are added to a card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ADDITION", + "enum": [ + "POINTS_ADDITION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_items_subtotal_amount": { - "title": "Calculate Points Proportionally to Order Items Subtotal Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_SUBTOTAL_AMOUNT" - ], - "description": "- `ORDER_ITEMS_SUBTOTAL_AMOUNT`; Amount spent on items defined in the `order_items.subtotal_amount.object` & `.id` (X points for every Y spent on items including discounts)" - }, - "order_items": { - "type": "object", - "properties": { - "subtotal_amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + }, + "1_obj_loyalty_card_transaction_object_removal": { + "title": "Removal", + "description": "When points are removed from a card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REMOVAL", + "enum": [ + "POINTS_REMOVAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being subtracted 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_items_quantity": { - "title": "Calculate Points Proportionally to Quantity of Items in the Cart", - "type": "object", - "description": "This is an object representing points calculated proportionally to quantity of items in the cart.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_QUANTITY" - ], - "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in `order_items.quantity.object` & `.id` (X points for every Y items excluding free items)" - }, - "order_items": { - "type": "object", - "properties": { - "quantity": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + }, + "1_obj_loyalty_card_transaction_object_expiration": { + "title": "Expiration", + "description": "When points expire.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points expiration, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points expiration, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_EXPIRATION", + "enum": [ + "POINTS_EXPIRATION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points removed during 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - } - } - }, - "8_obj_calculate_points_proportionally_customer_metadata": { - "title": "Calculate Points Proportionally To a Customer Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to a customer metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "`CUSTOMER_METADATA`: Customer Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `customer.metadata` object)" - }, - "customer": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "customer_life_time_value", - "description": "Customer metadata property." - } - } - } - } - } - } - }, - "8_obj_calculate_points_proportionally_custom_event_metadata": { - "title": "Calculate Points Proportionally To a Custom Event Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to a custom event metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "`CUSTOM_EVENT_METADATA`: Custom Event Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `custom_event.metadata` object)" - }, - "custom_event": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the custom event metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "volume_number", - "description": "Custom event metadata property." - } - } - } - } - } - } - }, - "8_res_list_loyalty_campaigns": { - "title": "List Loyalty Campaigns Response Body", - "type": "object", - "description": "Response body schema for listing loyalty campaigns using **GET** `/loyalties`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty campaigns in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "campaigns", - "description": "Identifies the name of the attribute that contains the array of loyalty campaign objects." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of loyalty campaign objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object_no_extended_categories" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty campaign objects." - } - } - }, - "8_req_create_loyalty_cards": { - "type": "object", - "title": "Create Loyalty Campaign Request Body", - "description": "Request body schema for creating a loyalty campaign.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } - } - }, - "8_loyalty_tiers_expiration_balance": { - "title": "Balance", - "type": "object", - "description": "Defines the Balance expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "BALANCE" - ], - "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." - } - } - }, - "expiration_date": { - "description": "Defines the conditions for the expiration date of a tier.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_balance_drop" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_custom" - } - ] - } - } - }, - "8_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { - "title": "Balance Drop", - "type": "object", - "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", - "properties": { - "type": { - "type": "string", - "enum": [ - "BALANCE_DROP" - ], - "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." - } - } - }, - "8_loyalty_tiers_expiration_balance_expiration_date_custom": { - "title": "Custom", - "type": "object", - "description": "Defines the custom conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." - }, - "extend": { - "type": "string", - "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." - }, - "rounding": { - "description": "Defines the rounding mechanism for tier expiration.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_default_options" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_custom" - } - ] - } - } - }, - "8_loyalty_tiers_expiration_expiration_date_rounding_default_options": { - "title": "Calendar Periods", - "type": "object", - "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", - "properties": { - "type": { - "type": "string", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ], - "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." - } - } - }, - "8_loyalty_tiers_expiration_expiration_date_rounding_custom": { - "title": "Specific Month", - "type": "object", - "description": "Defines the custom rounding mechanism for tier expiration.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "This mechanism describes a custom rounding for the expiration date." - }, - "unit": { - "type": "string", - "description": "Defines the type of unit of time in which the rounding period is counted.", - "enum": [ - "MONTH" - ] - }, - "value": { - "type": "integer", - "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" - } - } - }, - "8_loyalty_tiers_expiration_points_in_period": { - "title": "Points in Period", - "type": "object", - "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "POINTS_IN_PERIOD" - ], - "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." - }, - "qualification_period": { - "type": "string", - "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
- January - March
- April - June
- July - September
- October - December |\n| **Calendar Half-year** | Points collected in the half-year
- January - June
- July - December |\n| **Calendar Year** | Points collected in one calendar year
January - December |", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ] - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE", - "NEXT_PERIOD" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." - } - } - }, - "expiration_date": { - "type": "object", - "description": "Defines the conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "END_OF_PERIOD", - "END_OF_NEXT_PERIOD" - ], - "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." - }, - "extend": { - "type": "string", - "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." - } - } - } - } - }, - "8_req_update_loyalty_campaign": { - "type": "object", - "title": "Update Loyalty Campaign Request Body", - "description": "Request body schema for updating a loyalty campaign using **PUT** `/loyalties/{campaignId}`.", - "properties": { - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." + }, + "1_obj_loyalty_card_transaction_object_transfer_out": { + "title": "Transfer Out", + "description": "When points are transferred from one loyalty card to another.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place.", + "enum": [ + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_TRANSFER_OUT", + "enum": [ + "POINTS_TRANSFER_OUT" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being subtracted 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "destination_voucher": { + "type": "object", + "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the destination voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "code": { + "type": "string", + "description": "Unique code of the destination voucher.", + "example": "LOYALTY-CARD-A8XVurg" + }, + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "LOYALTY_CARD" + }, + "campaign": { + "type": "string", + "description": "Unqiue campaign name of the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "loyalty_card": { + "type": "object", + "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", + "properties": { + "points": { + "type": "integer", + "description": "The total amount of points after the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "next_expiration_date": { + "type": "string", + "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. This does not mean that the transferred points were added to this bucket. It only shows the next set of points due to expire. The transferred points are added to the last expiring bucket, i.e. to the bucket of points that are to expire the furthest in the future.", + "example": "2023-12-31" + }, + "next_expiration_points": { + "type": "integer", + "description": "The number of points due to expire on the next expiration date." + } + } + }, + "is_referral_code": { + "type": "integer", + "description": "Flag indicating whether this voucher is a referral code." + } + } + } } + }, + "related_transaction_id": { + "type": "string", + "description": "The related transaction ID on the receiving card.", + "example": "vtx_0c9afe802593b34b81" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - } - } - }, - "8_req_create_earning_rules": { - "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", - "title": "Create Earning Rule Request Body", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_earning_rule_object_order_paid" }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_entered_segment" - }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_custom_event" - }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_tier" - } - ] - } - }, - "8_req_create_earning_rules_copy": { - "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", - "type": "object", - "title": "Create Earning Rule Request Body", - "properties": { - "event": { - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. Read more here. \n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment. Read more here. \n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining custom events. " - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "description": "Fixed. Applicable to events `order.paid`, `customer.segment.entered`, and `custom_event`.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points to be added to the loyalty card.", - "example": 1000 - }, - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", - "default": "FIXED" - } + "1_obj_loyalty_card_transaction_object_transfer_in": { + "title": "Transfer In", + "description": "When points are transferred in from another loyalty card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" }, - "required": [ - "points", - "type" - ] - }, - { - "description": "Proportional. Applicable to only `order.paid`.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio", - "default": "PROPORTIONAL" - }, - "order": { - "type": "object", - "description": "Defines proportion for calculating how many points to add to a loyalty card. The ratio is based on the order amount. For `every` dollar spent, the customer will get this many `points`. \n", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the order amount.", - "required": [ - "every", - "points" - ], - "properties": { - "every": { - "type": "integer", - "description": "Order amount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points awarded." + "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. In case of a ponits transfer, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place.", + "enum": [ + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_TRANSFER_IN", + "enum": [ + "POINTS_TRANSFER_IN" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "source_voucher": { + "type": "object", + "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the source voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "code": { + "type": "string", + "description": "Unique code of the source voucher.", + "example": "LOYALTY-CARD-A8XVurg" + }, + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "LOYALTY_CARD" + }, + "campaign": { + "type": "string", + "description": "Unqiue campaign name of the voucher's parent campaign." + }, + "holder_id": { + "type": "string", + "description": "Unqiue customer ID of the loyalty card holder, this is the ID that was assigned by the Voucherify API.", + "example": "cust_xqA7DGj5eYPHg6PHVKwYRWiA" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "loyalty_card": { + "type": "object", + "description": "Contains information on how the balance on the source loyalty card was affected by the transaction.", + "properties": { + "points": { + "type": "integer", + "description": "The total amount of points after 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." + }, + "next_expiration_date": { + "type": "string", + "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. The points from the source loyalty card are taken from the expiration bucket(s) that are the first coming up to expire, starting from the first expiration bucket to expire in time. This parameter shows the next expiration date after the points were taken out of the loyalty card.", + "example": "2023-12-31" + }, + "next_expiration_points": { + "type": "integer", + "description": "The number of points due to expire on the expiration date." + } } + }, + "is_referral_code": { + "type": "integer", + "description": "Flag indicating whether this voucher is a referral code." } } } } }, - "required": [ - "type", - "order" - ] - } - ], - "type": "object" - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + "related_transaction_id": { + "type": "string", + "description": "The related transaction ID on the source card.", + "example": "vtx_0c9afe802593b34b81" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created 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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day. `start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" + }, + "8_req_create_loyalty_card_transactions_export": { + "type": "object", + "title": "Create Loyalty Card Transactions Export Request Body", + "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", + "description": "Contains the parameters that define the data to be exported." + } } }, - "required": [ - "duration", - "interval" - ] - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API." + "8_obj_export_loyalty_card_transactions": { + "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", + "title": "Export Transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details", + "related_transaction_id" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "items": { + "type": "string" + } + } } }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - }, - "required": [ - "id" - ] - } - }, - "required": [ - "event", - "loyalty" - ] - }, - "8_req_update_earning_rule": { - "description": "Request body schema for updating earning rules using **PUT** `/loyalties/{campaignId}/earning-rules/{earningRuleId}` endpoint.", - "title": "Update Earning Rule Request Body", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_order_paid" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_entered_segment" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_custom_event" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_tier" - } - ] - }, - "8_res_list_earning_rules": { - "description": "Response body schema for listing earning rules using **GET** `/loyalties/{campaignId}/earning-rules` endpoint.", - "type": "object", - "title": "List Earning Rules Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "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/8_obj_earning_rule_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } - } - }, - "8_req_add_remove_points_balance": { - "title": "Add or Remove Points Balance Request Body", - "type": "object", - "description": "Request schema for adding or removing points from a loyalty card.", - "properties": { - "points": { - "type": "integer", - "description": "Incremental balance to be added to/subtracted from the loyalty card. \n\nTo add points: `100` \nTo subtract points, add a minus: `-100`" - }, - "expiration_type": { - "type": "string", - "default": "PROGRAM_RULES", - "enum": [ - "PROGRAM_RULES", - "NON_EXPIRING", - "CUSTOM_DATE" - ], - "description": "Set the type of expiration for added points. \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", - "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`.", - "example": "2020-05-30" - }, - "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." - } - } - }, - "8_res_add_remove_points_balance": { - "description": "Response schema for adding or removing points from a loyalty card.", - "type": "object", - "title": "Add or Remove Loyalty Card Balance Response Body", - "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", - "description": "The balance after adding/removing points." - }, - "type": { - "type": "string", - "description": "The type of voucher being modified.", - "default": "loyalty_card" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `balance`.", - "default": "balance" - }, - "related_object": { - "type": "object", - "description": "Defines the object that is being modified with the values that are returned in the balance object.", - "properties": { - "type": { - "type": "string", - "description": "The object being modified.", - "default": "voucher" - }, - "id": { - "type": "string", - "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + "8_obj_export_transactions_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\n Using this endpoint, you can export [loyalty card transactions](ref:list-loyalty-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "default": "API" + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "default": "voucher_transactions" + }, + "parameters": { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + }, + "result": { + "type": "object", + "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](ref:download-export) method." + } + } + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } } - } - } - } - }, - "8_req_transfer_loyalty_points": { - "description": "Request body schema for transferring points from a loyalty card.", - "type": "array", - "title": "Transfer Loyalty Points Request Body", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source).", - "example": "L-CARD-02hgnq4" - }, - "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).", - "example": 2 - }, - "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." - } - } - } - }, - "8_req_redeem_reward": { - "description": "Request body schema for redeeming a reward.", - "type": "object", - "title": "Redeem Reward Request Body", - "properties": { - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward if the reward is a pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", - "example": "rew_eSi4eYJk7o3tOycvweicR2z7" - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card." - } - } - }, - "order": { - "$ref": "#/components/schemas/8_req_order_object_redeem_reward", - "description": "Order object that is **required** when redeeming a pay with points reward." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "8_req_order_object_redeem_reward": { - "type": "object", - "title": "Order object", - "description": "Request body schema for creating an order, **required** when redeeming a pay with points reward.", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - } - } - }, - "8_res_redeem_reward": { - "description": "Response body schema for redeeming a reward.", - "title": "Redeem Reward Response Body", - "$ref": "#/components/schemas/8_obj_redemption_object_loyalty_card_extended" - }, - "8_obj_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher lifecycle. A customer can redeem a voucher once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } - } - } - } - }, - "8_res_loyalties_campaign_id_tiers_tier_id_earning_rules": { - "type": "object", - "properties": { - "object": { - "type": "string" - }, - "data_ref": { - "type": "string" - }, - "data": { - "type": "array", - "items": { + "8_obj_loyalty_tier_object": { "type": "object", + "title": "Loyalty Tier Object", + "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", "properties": { "id": { - "type": "string" + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "description": "Unique loyalty tier ID." + }, + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": "object", + "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" + "type": "string", + "format": "date-time", + "example": "2022-11-10T12:20:52.755Z", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." }, "updated_at": { - "type": "null" + "type": "string", + "format": "date-time", + "example": "2022-11-25T10:59:43.231Z", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." }, - "validation_rule_id": { - "type": "null" + "earning_rules": { + "type": "object", + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", + "properties": { + "unique_earning_rule_ID": { + "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } }, - "loyalty": { + "rewards": { + "type": "object", + "description": "Contains a list of reward IDs and their points mapping for the given reward.", + "properties": { + "unique_reward_ID": { + "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } + }, + "config": { "type": "object", + "description": "Defines loyalty tier range in points.", "properties": { "points": { - "type": "integer" + "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." + } + } + } + } + }, + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." }, - "type": { - "type": "string" + "to": { + "type": "integer", + "description": "Top points threshold value." } } }, - "event": { - "type": "string" + "object": { + "type": "string", + "default": "loyalty_tier", + "description": "The type of object represented by JSON. This object stores information about the loyalty." + } + } + }, + "8_obj_loyalty_tier_object_member": { + "type": "object", + "title": "Loyalty Tier Object", + "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", + "properties": { + "id": { + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "description": "Unique loyalty tier ID." }, - "source": { + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": "object", + "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", + "example": "2022-11-10T12:20:52.755Z", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-11-25T10:59:43.231Z", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "earning_rules": { "type": "object", + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", "properties": { - "banner": { - "type": "string" - }, - "object_id": { - "type": "string" - }, - "object_type": { - "type": "string" + "unique_earning_rule_ID": { + "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] } } }, - "active": { - "type": "boolean" + "rewards": { + "type": "object", + "description": "Contains a list of reward IDs and their points mapping for the given reward.", + "properties": { + "unique_reward_ID": { + "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } }, - "object": { - "type": "string" + "config": { + "type": "object", + "description": "Defines loyalty tier range in 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." + } + } + } + } }, - "automation_id": { - "type": "string" + "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." + } + } }, - "custom_event": { + "expiration": { "type": "object", + "description": "Contains information about when the expiration tier will expire.", "properties": { - "schema_id": { - "type": "string" + "customer_id": { + "type": "string", + "example": "cust_qBwHpagDOFu71Z3F22UzR80X", + "description": "Unique customer ID whose point expiration dates are defined in this object." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "tier_id": { + "type": "string", + "example": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "description": "Unique loyalty tier ID." + }, + "start_date": { + "type": "string", + "example": "2022-11-10", + "description": "Exact start date of the loyalty tier for the given customer." + }, + "expiration_date": { + "type": "string", + "example": "2023-02-28", + "description": "Exact expiration date of the loyalty tier for the given customer." + }, + "created_at": { + "type": "string", + "example": "2022-11-09T11:26:26.719Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-11-10T08:54:47.200Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." } } + }, + "object": { + "type": "string", + "default": "loyalty_tier", + "description": "The type of object represented by JSON. This object stores information about the loyalty." } } - } - }, - "total": { - "type": "integer" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "title": "List Loyalty Tier Earning Rules" - }, - "8_res_loyalties_campaign_id_tiers_tier_id_rewards": { - "title": "List Loyalty Tier Rewards", - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`." - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id": { - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}`", - "title": "Get Reward Assignment", - "properties": { - "id": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" - }, - "reward_id": { - "type": "string", - "example": "rew_JhjeISE1npQyxRmGV1JYohDP" - }, - "related_object_id": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "related_object_type": { - "type": "string", - "example": "campaign" - }, - "created_at": { - "type": "string", - "example": "2021-12-13T11:58:32.261Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-01-13T11:58:32.261Z", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "reward_assignment" - } - } - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id_reward": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "parameters": { - "type": "object", - "properties": { - "coin": { - "type": "object", - "properties": { - "exchange_ratio": { - "type": "number" - }, - "points_ratio": { - "type": "integer" - } + }, + "8_obj_mapping_multiply": { + "type": "object", + "title": "Multiply Points", + "description": "Points are multiplied by a multiplier.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "MULTIPLY" + ] + }, + "multiplier": { + "type": "integer", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." } } - } - }, - "stock": { - "type": "null" - }, - "redeemed": { - "type": "null" - }, - "attributes": { - "type": "object", - "properties": {} - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "null", - "format": "date-time" - }, - "object": { - "type": "string" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}/`", - "title": "Get Reward Details" - }, - "8_obj_export_object_points_expiration": { - "title": "Points Expirations Export Object", - "type": "object", - "description": "This is an object representing an export of points expirations. ", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the export." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Status of the export. Informs you whether the export has already been completed.", - "enum": [ - "SCHEDULED", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "enum": [ - "API", - "WEBSITE" - ] - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "enum": [ - "points_expiration" - ] - }, - "parameters": { - "type": "object", - "description": "List of fields and filters that were passed in the request body to create the export.", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combination of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" + }, + "8_obj_mapping_fixed": { + "type": "object", + "title": "Fixed Points", + "description": "Points are fixed.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "CUSTOM" + ] + }, + "points": { + "type": "integer", + "description": "Fixed number of points to be applied." } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_filter_campaign_id" + } + }, + "8_obj_earning_rule_object": { + "description": "This is an object representing an earning rule.", + "title": "Earning Rule Object", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" }, - { - "$ref": "#/components/schemas/8_req_filter_voucher_id" + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + }, + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + }, + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" } - ] - } - } - }, - "result": { - "type": "object", - "description": "Contains the URL of the CSV file.", - "properties": { - "url": { - "type": "string", - "description": "URL of the CSV file location." - } - } - }, - "user_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr", - "description": " The user_id identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`." - } - } - }, - "8_req_export_points_expirations": { - "title": "Points Expirations Export Request Body", - "type": "object", - "description": "Request body schema for creating points expirations. ", - "properties": { - "parameters": { - "type": "object", - "description": "List of fields and filters that were passed in the request body to create the export.", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_filter_campaign_id" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" + } + ] + }, + "8_obj_earning_rule_object_no_validation_rule": { + "description": "This is an object representing an earning rule.", + "title": "Earning Rule Object", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" }, - { - "$ref": "#/components/schemas/8_req_filter_voucher_id" + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + }, + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + }, + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" } - ] - } - } - } - } - }, - "8_req_filter_campaign_id": { - "title": "Filter by campaign ID", - "type": "object", - "description": "Filter conditions set on the campaign ID.", - "properties": { - "campaign_id": { - "$ref": "#/components/schemas/8_req_filter_conditions" - }, - "junction": { - "type": "string", - "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.", - "enum": [ - "AND", - "OR" - ] - } - } - }, - "8_req_filter_voucher_id": { - "title": "Filter by voucher ID", - "type": "object", - "description": "Filter conditions set on the voucher ID.", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/8_req_filter_conditions" - }, - "junction": { - "type": "string", - "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.", - "enum": [ - "AND", - "OR" - ] - } - } - }, - "8_req_filter_junction": { - "title": "Filter by campaign ID", - "type": "object", - "description": "Filter conditions by campaign ID.", - "properties": { - "junction": { - "type": "string", - "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." - } - } - }, - "8_req_filter_conditions": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results.", - "items": { - "type": "string" + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results.", - "items": { - "type": "string" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_tier_no_validation_rule" } - }, - "$is": { - "type": "string", - "description": "Specify the exact resource value." - }, - "$is_not": { - "type": "string", - "description": "Results should omit this value." - } - } - } - } - }, - "8_res_list_reward_assignments": { - "title": "List Reward Assignments", - "type": "object", - "description": "Response body schema for **GET** `/loyalties/{campaignId}/rewards`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty reward assignments in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of reward assignment objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of reward assignment objects.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of reward assignment objects." - } - } - }, - "8_res_list_loyalty_tiers": { - "title": "List Loyalty Tiers", - "type": "object", - "description": "Response body schema for listing loyalty tiers for a campaign using **GET** `/loyalties/{campaignId}/tiers`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - } - }, - "8_res_get_member_loyalty_tier": { - "title": "Get Member's Loyalty Tier Response Body", - "type": "object", - "description": "Response body schema for retrieving a member's loyalty tier for a campaign using **GET** `/loyalties/members/{memberId}/tiers`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object_member" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tiers." - } - } - }, - "8_req_create_reward_assignment": { - "title": "Create Reward Assignment Request Body", - "type": "array", - "description": "Request body schema for **POST** `/loyalties/{campaignId}/rewards`.", - "items": { - "type": "object", - "properties": { - "reward": { - "type": "string", - "example": "rew_2yGflHThU2yJwFECEFKrXBI2", - "description": "Unique reward ID." + ] }, - "parameters": { + "8_obj_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", "type": "object", - "description": "An object that defines the price of the reward in loyalty points.", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" + } + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { "type": "object", - "description": "Stores the points parameter.", + "description": "Contains the custom earning rule name and parent campaign.", "properties": { - "points": { - "type": "integer", - "description": "Defines how many points are required to obtain the reward." + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } - } - } - } - }, - "8_res_create_reward_assignment": { - "title": "Create Reward Assignment Response Body", - "type": "array", - "description": "Response body schema for **POST** `/loyalties/{campaignId}/rewards`.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } - }, - "8_req_update_reward_assignment": { - "title": "Update Reward Assignment Request Body", - "type": "object", - "description": "Request body schema for **PUT** `/loyalties/{campaignId}/rewards/{assignmentId}`.", - "properties": { - "parameters": { - "type": "object", - "description": "An object that defines the price of the reward in loyalty points.", - "properties": { - "loyalty": { - "type": "object", - "description": "Stores the points parameter.", - "properties": { - "points": { - "type": "integer", - "description": "Defines how many points are required to obtain the reward." + }, + "8_req_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" + } + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } - } - } - } - }, - "8_res_list_loyalty_tier_earning_rules": { - "title": "List Loyalty Tier Earning Rules", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tier earning rules in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier earning rule objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier earning rules.", - "items": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } - } - }, - "8_res_list_loyalty_tier_rewards": { - "title": "List Loyalty Tier Rewards", - "type": "object", - "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty tier rewards in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty tier reward objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier reward objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier reward objects." - } - } - }, - "8_res_list_members": { - "title": "List Members", - "type": "object", - "description": "Response body schema for **GET** `/loyalties/{campaignId}/members`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about members in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "vouchers", - "description": "Identifies the name of the attribute that contains the array of voucher objects." - }, - "vouchers": { - "type": "array", - "description": "Contains array of voucher objects representing loyalty cards, in other words, loyalty program members.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - } - }, - "total": { - "type": "integer", - "description": "Total number of voucher objects." - } - } - }, - "8_req_add_member": { - "title": "Add Member Request Body", - "type": "object", - "description": "Request body schema for assigning a loyalty card to a customer using **POST** `/loyalties/{campaignId}/members`.", - "properties": { - "voucher": { - "type": "string", - "description": "Specify the loyalty card code that you would like to publish to a customer." - }, - "channel": { - "type": "string", - "description": "Specify the distribution channel." - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_customer_id_string" - }, - { - "$ref": "#/components/schemas/8_req_customer_id" - }, - { - "$ref": "#/components/schemas/8_req_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "metadata": { - "type": "string", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "8_req_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer." - } - } - }, - "8_req_customer_id_string": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify or the source ID.", - "type": "string" - }, - "8_req_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } - } - }, - "8_res_get_member_activities": { - "title": "Get Member Activities", - "type": "object", - "description": "Response body schema for retrieving member activities.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about member activities in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "activities", - "description": "Identifies the name of the attribute that contains the array of event objects." - }, - "activities": { - "type": "array", - "description": "Contains array of event objects.", - "items": {} - }, - "total": { - "type": "integer", - "description": "Total number of event objects." - } - } - }, - "8_res_list_member_rewards": { - "title": "List Member Rewards", - "type": "object", - "description": "Response body schema for `/loyalties/members/{memberId}/rewards`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about member rewards in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty reward objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty reward objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_reward_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty reward objects." - } - } - }, - "8_res_get_points_expiration": { - "title": "Get Points Expiration Response Body", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/members/{memberId}/points-expiration`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of loyalty points expiration buckets.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_points_bucket" - } - }, - "total": { - "type": "integer", - "description": "Total number of point expiration buckets." - } - } - }, - "9_req_create_customer": { - "type": "object", - "title": "Customer", - "description": "This is an object containing information about the customer.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service. \n\nPlease note that if you would like your data to sync based on the `source_id` of the customer, you need to define the `source_id` upfront. You will not be able to change or update the `source_id` later on." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " - } - } - }, - "9_req_update_customer": { - "type": "object", - "title": "Customer object", - "description": "This is an object containing information about the customer.", - "properties": { - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " - } - } - }, - "9_obj_customer_object": { - "type": "object", - "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", - "title": "Customer Object", - "examples": [ - { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", - "source_id": "08dd9b5a", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "address": { - "city": "New York", - "state": "NY", - "line_1": "678 Main St", - "line_2": null, - "country": "USA", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 5, - "total_failed": 0, - "total_succeeded": 5, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 830 - } - }, - "orders": { - "total_amount": 94600, - "total_count": 5, - "average_amount": 18920, - "last_order_amount": 27500, - "last_order_date": "2022-09-15T11:11:36.630Z" - } - }, - "loyalty": { - "points": 830, - "referred_customers": 0, - "campaigns": { - "Loyalty Campaign - Webinar": { - "points": 830, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "age": 24, - "loyalty_customer": "true", - "acquisition_channel": "Facebook" - }, - "system_metadata": { - "consents": { - "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { - "date": "2022-11-22T15:48:50.219Z", - "value": true - } - } - }, - "created_at": "2022-09-15T10:33:46.388Z", - "updated_at": "2022-11-22T15:48:50.220Z", - "assets": { - "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" }, - "object": "customer" - } - ], - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_CSnYd37MXmrbS19XCrghjBsv" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate." - }, - "birthday": { - "type": "string", - "description": "Customer's birthday." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "summary": { - "type": "object", - "description": "Contains a summary of customer's redemption and order statistics.", - "properties": { - "redemptions": { - "type": "object", - "description": "Customer's redemptions statistics.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Total number of redemptions made by the customer." - }, - "total_failed": { - "type": "integer", - "description": "Total number of redemptions that failed." - }, - "total_succeeded": { - "type": "integer", - "description": "Total number of redemptions that succeeded." - }, - "total_rolled_back": { - "type": "integer", - "description": "Total number of redemptions that were rolled back for the customer." + "8_req_update_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" }, - "total_rollback_failed": { - "type": "integer", - "description": "Total number of redemption rollbacks that failed." + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "total_rollback_succeeded": { - "type": "integer", - "description": "Total number of redemption rollbacks that succeeded." + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "gift": { - "type": "object", - "description": "Summary of gift card credits.", - "properties": { - "redeemed_amount": { - "type": "integer", - "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "amount_to_go": { - "type": "integer", - "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } - }, - "loyalty_card": { - "type": "object", - "description": "Summary of loyalty points.", - "properties": { - "redeemed_points": { - "type": "integer", - "description": "Total number of loyalty points redeemed by the customer." - }, - "points_to_go": { - "type": "integer", - "description": "Sum of remaining available point balance across all loyalty cards." - } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - }, - "orders": { - "type": "object", - "description": "Customer's order statistics.", - "properties": { - "total_amount": { - "type": "integer", - "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "total_count": { - "type": "integer", - "description": "Total number of orders made by the customer." + } + }, + "8_obj_earning_rule_object_order_paid_no_validation_rule": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" }, - "average_amount": { - "type": "integer", - "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "last_order_amount": { - "type": "integer", - "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "last_order_date": { - "type": "string", - "format": "date-time", - "example": "2022-08-30T11:51:08.029Z", - "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" } - } - } - }, - "loyalty": { - "type": "object", - "description": "Summary of customer's loyalty information.", - "properties": { - "points": { - "type": "integer", - "description": "Sum of remaining available point balance across all loyalty cards." - }, - "referred_customers": { - "type": "integer", - "description": "Total number of customers referred by the customer." - }, - "campaigns": { - "type": "object", - "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", - "properties": { - "campaign_name": { - "type": "object", - "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", - "properties": { - "points": { - "type": "integer", - "description": "Remaining point balance in campaign." - }, - "loyalty_tier": { - "type": "string", - "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", - "description": "Customer's loyalty tier within the campaign." - }, - "referred_customers": { - "type": "integer", - "description": "Number of customers referred by the customer in campaign." - } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } - } - } - } - } - }, - "referrals": { - "type": "object", - "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", - "properties": { - "total": { - "type": "integer", - "description": "Total number of times this customer received a referral, i.e. was referred by another customer." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of campaigns that served as the source of a referral for the customer.", - "items": { + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { "type": "object", - "description": "Contains information about the source of the referral.", + "description": "Contains the custom earning rule name and parent campaign.", "properties": { - "campaign_id": { + "banner": { "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_rRsfatlwN7unSeUIJDCYedal" + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "referrer_id": { + "object_id": { "type": "string", - "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." }, - "related_object_id": { + "object_type": { "type": "string", - "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." - }, - "related_object_type": { + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { "type": "string", - "description": "Related object type, i.e. `redemption`." + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" }, - "date": { + "interval": { "type": "string", - "format": "date-time", - "example": "2022-08-30T10:19:39.196Z", - "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } - } - } - } - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "system_metadata": { - "type": "object", - "description": "Object used to store system metadata information.", - "properties": { - "consents": { - "type": "object", - "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", - "properties": { - "consentId": { - "type": "object", - "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", - "example": "2022-05-10T08:50:10.338Z", - "format": "date-time" - }, - "value": { - "type": "boolean", - "description": "Accepted: `true`, Rejected: `false`" - } - } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" } - } - }, - "source": { - "type": "string", - "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." - } - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", - "example": "2022-08-30T06:32:07.380Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", - "example": "2022-08-31T06:32:07.380Z", - "format": "date-time" - }, - "assets": { - "type": "object", - "description": "Contains information about the customer's cockpit.", - "properties": { - "cockpit_url": { - "type": "string", - "description": "Customer's cockpit URL address." - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the customer.", - "default": "customer" - } - } - }, - "9_obj_customer_object_email_parameter": { - "type": "object", - "description": "This is an object representing a customer.", - "title": "Customer Object", - "examples": [ - { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", - "source_id": "08dd9b5a", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "address": { - "city": "New York", - "state": "NY", - "line_1": "678 Main St", - "line_2": null, - "country": "USA", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 5, - "total_failed": 0, - "total_succeeded": 5, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 830 + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - }, - "orders": { - "total_amount": 94600, - "total_count": 5, - "average_amount": 18920, - "last_order_amount": 27500, - "last_order_date": "2022-09-15T11:11:36.630Z" } }, - "loyalty": { - "points": 830, - "referred_customers": 0, - "campaigns": { - "Loyalty Campaign - Webinar": { - "points": 830, - "referred_customers": 0 + "8_obj_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "age": 24, - "loyalty_customer": "true", - "acquisition_channel": "Facebook" - }, - "system_metadata": { - "consents": { - "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { - "date": "2022-11-22T15:48:50.219Z", - "value": true + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } }, - "created_at": "2022-09-15T10:33:46.388Z", - "updated_at": "2022-11-22T15:48:50.220Z", - "assets": { - "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" - }, - "object": "customer" - } - ], - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_CSnYd37MXmrbS19XCrghjBsv" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate." - }, - "birthday": { - "type": "string", - "description": "Customer's birthday." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "summary": { - "type": "object", - "description": "Contains a summary of customer's redemption and order statistics.", - "properties": { - "redemptions": { - "type": "object", - "description": "Customer's redemptions statistics.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Total number of redemptions made by the customer." - }, - "total_failed": { - "type": "integer", - "description": "Total number of redemptions that failed." - }, - "total_succeeded": { - "type": "integer", - "description": "Total number of redemptions that succeeded." + "8_req_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" }, - "total_rolled_back": { - "type": "integer", - "description": "Total number of redemptions that were rolled back for the customer." + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" }, - "total_rollback_failed": { - "type": "integer", - "description": "Total number of redemption rollbacks that failed." + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "total_rollback_succeeded": { - "type": "integer", - "description": "Total number of redemption rollbacks that succeeded." + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "gift": { - "type": "object", - "description": "Summary of gift card credits.", - "properties": { - "redeemed_amount": { - "type": "integer", - "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "amount_to_go": { - "type": "integer", - "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "loyalty_card": { - "type": "object", - "description": "Summary of loyalty points.", - "properties": { - "redeemed_points": { - "type": "integer", - "description": "Total number of loyalty points redeemed by the customer." - }, - "points_to_go": { - "type": "integer", - "description": "Sum of remaining available point balance accross all loyalty cards." - } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - }, - "orders": { - "type": "object", - "description": "Customer's order statistics.", - "properties": { - "total_amount": { - "type": "integer", - "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + }, + "8_req_update_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" }, - "total_count": { - "type": "integer", - "description": "Total number of orders made by the customer." + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" }, - "average_amount": { - "type": "integer", - "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "last_order_amount": { - "type": "integer", - "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "last_order_date": { - "type": "string", - "example": "2022-08-30T11:51:08.029Z", - "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" } - } - } - }, - "loyalty": { - "type": "object", - "description": "Summary of customer's loyalty information.", - "properties": { - "points": { - "type": "integer" - }, - "referred_customers": { - "type": "integer", - "description": "Total number of customers referred by the customer." - }, - "campaigns": { - "type": "object", - "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", - "properties": { - "campaign_name": { - "type": "object", - "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", - "properties": { - "points": { - "type": "integer", - "description": "Remaining point balance in campaign." - }, - "loyalty_tier": { - "type": "string", - "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", - "description": "Customer's loyalty tier within the campaign." - }, - "referred_customers": { - "type": "integer", - "description": "Number of customers referred by the customer in campaign." - } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } - } - }, - "referrals": { - "type": "object", - "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", - "properties": { - "total": { - "type": "integer", - "description": "Total number of times this customer received a referral, i.e. was referred by another customer." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of campaigns that served as the source of a referral for the customer.", - "items": { + }, + "8_obj_earning_rule_object_entered_segment_no_validation_rule": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "segment": { "type": "object", - "description": "Contains information about the source of the referral.", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", "properties": { - "campaign_id": { + "id": { "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_rRsfatlwN7unSeUIJDCYedal" - }, - "referrer_id": { + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { "type": "string", - "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "related_object_id": { + "object_id": { "type": "string", - "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." }, - "related_object_type": { + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { "type": "string", - "description": "Related object type, i.e. `redemption`." + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" }, - "date": { + "interval": { "type": "string", - "example": "2022-08-30T10:19:39.196Z", - "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } - } - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "system_metadata": { - "type": "object", - "description": "Object used to store system metadata information.", - "properties": { - "consents": { - "type": "object", - "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", - "properties": { - "consentId": { - "type": "object", - "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", - "example": "2022-05-10T08:50:10.338Z", - "format": "date-time" - }, - "value": { - "type": "boolean", - "description": "Accepted: `true`, Rejected: `false`" - } + }, + "8_obj_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" } } - } - }, - "source": { - "type": "string", - "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." - } - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", - "example": "2022-08-30T06:32:07.380Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", - "example": "2022-08-31T06:32:07.380Z", - "format": "date-time" - }, - "assets": { - "type": "object", - "description": "Contains information about the customer's cockpit.", - "properties": { - "cockpit_url": { - "type": "string", - "description": "Customer's cockpit URL address." - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the customer.", - "default": "customer" - }, - "email_unsubscribed": { - "type": "boolean" - } - } - }, - "9_res_list_customers": { - "type": "object", - "title": "List Customers Response Body", - "description": "Response body schema for **GET** `/customers`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about customers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "customers", - "description": "Identifies the name of the attribute that contains the array of customer objects." - }, - "customers": { - "type": "array", - "description": "Contains array of customer objects.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of customers." - } - } - }, - "9_res_list_customer_activities": { - "type": "object", - "title": "List Customer Activities Response Body", - "description": "Request body schema for `/customers/{customerId}/activities`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about customer activities in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of customer activity objects." - }, - "data": { - "type": "array", - "description": "Array of customer activity objects.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_activity_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of customer activities." - } - } - }, - "22_obj_webhooks": { - "type": "object", - "title": "Webhooks", - "description": "Data object model for a webhook.\n\n\nredemption.succeeded \nredemption.failed \nredemption.rollback.succeeded \nredemption.rollback.failed \npublication.succeeded \nvoucher.published \nvoucher.updated \nvoucher.deleted \nvoucher.created \nVoucher.enabled \nvoucher.disabled \nvoucher.loyalty_card.points_added \nvoucher.gift.balance_added \ncampaign.enabled \ncampaign.deleted \ncampaign.created \ncampaign.updated \ncampaign.disabled \ncampaign.vouchers.generation.completed \nbusiness_validation_rule.assignment.created \nbusiness_validation_rule.assignment.deleted \nbusiness_validation_rule.created \nbusiness_validation_rule.deleted \nbusiness_validation_rule.updated \ncustomer.created \ncustomer.deleted \ncustomer.rewarded \ncustomer.rewarded.loyalty_points \ncustomer.consents.revoked \ncustomer.consents.given ", - "x-tags": [ - "WEBHOOKS" - ], - "properties": { - "id": { - "type": "string", - "example": "event_m7MXf3zPf1n51IoUM8XHpP0w", - "description": "Unique event ID." - }, - "object": { - "type": "string", - "default": "event", - "description": "The type of object represented by JSON. This object stores information about events in a dictionary." - }, - "webhook_id": { - "type": "string", - "example": "wh_K7hpwSVDmKaxmBsDn0EpCvDy", - "description": "Unique webhook ID." - }, - "project_id": { - "type": "string", - "example": "proj_z7id5", - "description": "Unique Voucherify project ID." - }, - "created_at": { - "type": "string", - "example": "2022-11-30T16:53:30.434Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the webhook was created in ISO 8601 format." - }, - "type": { - "type": "string", - "enum": [ - "redemption.succeeded", - "redemption.failed", - "redemption.rollback.succeeded", - "redemption.rollback.failed", - "publication.succeeded", - "voucher.published", - "voucher.updated", - "voucher.deleted", - "voucher.created", - "Voucher.enabled", - "voucher.disabled", - "voucher.loyalty_card.points_added", - "voucher.gift.balance_added", - "campaign.enabled", - "campaign.deleted", - "campaign.created", - "campaign.updated", - "campaign.disabled", - "campaign.vouchers.generation.completed", - "business_validation_rule.assignment.created", - "business_validation_rule.assignment.deleted", - "business_validation_rule.created", - "business_validation_rule.deleted", - "business_validation_rule.updated", - "customer.created", - "customer.deleted", - "customer.rewarded", - "customer.rewarded.loyalty_points", - "customer.consents.revoked", - "customer.consents.given" - ] - }, - "data": { - "$ref": "#/components/schemas/22_obj_webhook_object_data" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a webhook. The metadata object stores all custom attributes assigned to the webhook. It can be useful for storing additional information about the webhook in a structured format.", - "properties": { - "source": { - "type": "string", - "description": "The origin of the webhook.", - "enum": [ - "API" - ] - } - } - } - } - }, - "22_obj_webhook_object_data": { - "title": "Webhook Object", - "description": "Webhook event data object schema.", - "anyOf": [ - { - "$ref": "#/components/schemas/22_obj_event_redemption_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_publication_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_published" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_loyalty_card_points_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_gift_balance_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_vouchers_generation_completed" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded_loyalty_points" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_given" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_revoked" - } - ] - }, - "22_obj_event_redemption_succeeded": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `redemption.succeeded`.", - "type": "object" - }, - "22_obj_event_redemption_failed": { - "title": "Redemption Failed", - "description": "Event data object schema for `redemption.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_failed": { - "title": "Redemption Rollback Failed", - "description": "Event data object schema for `redemption.rollback.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_succeeded": { - "title": "Redemption Rollback Succeeded", - "description": "Event data object schema for `redemption.rollback.succeeded`.", - "type": "object" - }, - "22_obj_event_publication_succeeded": { - "title": "Publication Succeeded", - "description": "Event data object schema for `publication.succeeded`.", - "type": "object" - }, - "22_obj_event_voucher_published": { - "title": "Voucher Published", - "description": "Event data object schema for `voucher.published`.", - "type": "object" - }, - "22_obj_event_voucher_updated": { - "title": "Voucher Updated", - "description": "Event data object schema for `voucher.updated`.", - "type": "object" - }, - "22_obj_event_voucher_deleted": { - "title": "Voucher Deleted", - "description": "Event data object schema for `voucher.deleted`.", - "type": "object" - }, - "22_obj_event_voucher_created": { - "title": "Voucher Created", - "description": "Event data object schema for `voucher.created`.", - "type": "object" - }, - "22_obj_event_voucher_enabled": { - "title": "Voucher Enabled", - "description": "Event data object schema for `voucher.enabled`.", - "type": "object" - }, - "22_obj_event_voucher_disabled": { - "title": "Voucher Disabled", - "description": "Event data object schema for `voucher.disabled`.", - "type": "object" - }, - "22_obj_event_voucher_loyalty_card_points_added": { - "title": "Voucher Loyalty Card Points Added", - "description": "Event data object schema for `voucher.loyalty_card.points_added`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object" - } - } - }, - "22_obj_event_voucher_gift_balance_added": { - "title": "Voucher Gift Balance Added", - "description": "Event data object schema for `voucher.gift.balance_added`.", - "type": "object" - }, - "22_obj_event_campaign_enabled": { - "title": "Campaign Enabled", - "description": "Event data object schema for `campaign.enabled`.", - "type": "object" - }, - "22_obj_event_campaign_deleted": { - "title": "Campaign Deleted", - "description": "Event data object schema for `campaign.deleted`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "campaign": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } - } - }, - "22_obj_event_campaign_created": { - "title": "Campaign Created", - "description": "Event data object schema for `campaign.created`.", - "type": "object" - }, - "22_obj_event_campaign_updated": { - "title": "Campaign Updated", - "description": "Event data object schema for `campaign.updated`.", - "type": "object" - }, - "22_obj_event_campaign_disabled": { - "title": "Campaign Disabled", - "description": "Event data object schema for `campaign.disabled`.", - "type": "object" - }, - "22_obj_event_campaign_vouchers_generation_completed": { - "title": "Campaign Vouchers Generation Completed", - "description": "Event data object schema for `campaign.vouchers.generation.completed`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_created": { - "title": "Business Validation Rule Assignment Created", - "description": "Event data object schema for `business_validation_rule.assignment.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_deleted": { - "title": "Business Validation Rule Assignment Deleted", - "description": "Event data object schema for `business_validation_rule.assignment.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_created": { - "title": "Business Validation Rule Created", - "description": "Event data object schema for `business_validation_rule.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_deleted": { - "title": "Business Validation Rule Deleted", - "description": "Event data object schema for `business_validation_rule.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_updated": { - "title": "Business Validation Rule Updated", - "description": "Event data object schema for `business_validation_rule.updated`.", - "type": "object" - }, - "22_obj_event_customer_created": { - "title": "Customer Created", - "description": "Event data object schema for `customer.created`.", - "type": "object" - }, - "22_obj_event_customer_deleted": { - "title": "Customer Deleted", - "description": "Event data object schema for `customer.deleted`.", - "type": "object" - }, - "22_obj_event_customer_rewarded": { - "title": "Customer Rewarded", - "description": "Event data object schema for `customer.rewarded`.", - "type": "object" - }, - "22_obj_event_customer_rewarded_loyalty_points": { - "title": "Customer Rewarded Loyalty Points", - "description": "Event data object schema for `customer.rewarded.loyalty_points`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "voucher": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "code": { - "type": "string" - }, - "loyalty_card": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "balance": { - "type": "integer" - } - } - }, - "type": { - "type": "string", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string" - }, - "campaign_id": { - "type": "string" - }, - "is_referral_code": { - "type": "boolean" - }, - "holder_id": { - "type": "string", - "example": "cust_o3ffuQSwM0vlxeJJoMqiOLMI" - } - } - }, - "campaign": { - "type": "string" - }, - "earning_rule": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } - } - }, - "22_obj_event_customer_consents_revoked": { - "title": "Customer Consents Revoked", - "description": "Event data object schema for `customer.consents.revoked`.", - "type": "object" - }, - "22_obj_event_customer_consents_given": { - "title": "Customer Consents Given", - "description": "Event data object schema for `customer.consents.given`.", - "type": "object" - }, - "9_obj_customer_activity_object": { - "type": "object", - "title": "Customer Activity Object", - "description": "This is an object representing customer activity. \n\nThis is a general object which presents moments from customers' activity. There are all types of different events that customers perform during their journey once they participate in Promotions. Events describe moments when customers redeem coupons and earn points or rewards. The list of all types of activities is listed below.\n\nThe details describing the activity are collected in a property named `data`. In this object, software integrators will find all further information explaining the event context. \n\nCustomer Activity Object is a type of [Event](ref:track-custom-event) which is our way of letting you know when something interesting happens in your project. When an interesting event concerning an individual customer occurs, we create a new Customer Activity object. For example, when a code is published to a customer, we create a `customer.publication.succeeded` event.\n\n| **Event types (definition in progress)** |\n|:---|\n| customer.confirmed |\n| customer.created |\n| customer.updated |\n| customer.deleted |\n| customer.referred |\n| customer.custom_event |\n| customer.segment.entered |\n| customer.segment.left |\n| customer.sms.sent |\n| customer.sms.failed |\n| customer.email.sent |\n| customer.email.failed |\n| customer.activecampaign.sent |\n| customer.activecampaign.failed |\n| customer.braze.sent |\n| customer.braze.failed |\n| customer.mailchimp.sent |\n| customer.mailchimp.failed |\n| customer.intercom.sent |\n| customer.intercom.failed |\n| customer.rewarded |\n| customer.rewarded.loyalty_points |\n| customer.voucher.gift.balance_added |\n| customer.voucher.loyalty_card.points_added |\n| customer.voucher.loyalty_card.points_transferred |\n| customer.publication.succeeded |\n| customer.publication.failed |\n| customer.redemption.succeeded |\n| customer.redemption.failed |\n| customer.redemption.rollback.succeeded |\n| customer.redemption.rollback.failed |\n| customer.consents.given |\n| customer.consents.revoked |", - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique event ID, assigned by Voucherify.", - "example": "evcus_0c150c51730c6b60b1" - }, - "type": { - "type": "string", - "description": "Event type.", - "enum": [ - "customer.confirmed", - "customer.created", - "customer.updated", - "customer.deleted", - "customer.referred", - "customer.custom_event", - "customer.segment_entered", - "customer.segment.left", - "customer.sms.sent", - "customer.sms.failed", - "customer.email.sent", - "customer.email.failed", - "customer.activecampaign.sent", - "customer.braze.sent", - "customer.mailchimp.sent", - "customer.intercom.sent", - "customer.intercom.failed", - "customer.rewarded", - "customer.rewarded.loyalty_points", - "customer.voucher.gift.balance_added", - "customer.voucher.loyalty_card.points_added", - "customer.voucher.loyalty_card.points_transferred", - "customer.publication.succeeded", - "customer.publication.failed", - "customer.redemption.succeeded", - "customer.redemption.failed", - "customer.redemption.rollback.succeeded", - "customer.redemption.rollback.failed", - "customer.consents.given", - "customer.consents.revoked" - ] - }, - "data": { - "type": "array", - "description": "Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data" - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.", - "example": "2022-08-30T09:14:07.660Z", - "format": "date-time" - } - } - }, - "9_obj_customer_activity_object_data": { - "title": "Customer Activity Data Object", - "description": "Event data object schema.", - "anyOf": [ - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_confirmed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_created" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_updated" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_deleted" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_referred" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_custom_event" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_entered" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_left" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded_loyalty_points" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_given" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_revoked" - } - ] - }, - "9_obj_customer_activity_object_data_customer_email_unsubscribed": { - "title": "Email Unsubscribed", - "description": "Email unsubscribed", - "type": "object", - "properties": { - "email_unsubscribed": { - "type": "boolean" - } - } - }, - "9_obj_customer_activity_object_data_customer_confirmed": { - "title": "Customer Confirmed", - "description": "Event data object schema for `customer.confirmed`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - }, - "unconfirmed_customer": { - "type": "string", - "example": "ucust_1qa70mVfYkl11Ab0ZxDPdWNa" - } - } - }, - "9_obj_customer_activity_object_data_customer_created": { - "title": "Customer Created", - "description": "Event data object schema for `customer.created`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } - } - }, - "9_obj_customer_activity_object_data_customer_updated": { - "title": "Customer Updated", - "description": "Event data object schema for `customer.updated`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } - } - }, - "9_obj_customer_activity_object_data_customer_deleted": { - "title": "Customer Deleted", - "description": "Event data object schema for `customer.deleted`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } - } - }, - "9_obj_customer_activity_object_data_customer_referred": { - "title": "Customer Referred", - "description": "Event data object schema for `customer.referred`.", - "type": "object", - "properties": { - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "referrer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "custom_event": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_custom_event": { - "title": "Custom Event", - "description": "Event data object schema for `customer.custom_event`.", - "type": "object", - "properties": { - "event": { - "type": "object" - }, - "loyalty": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "referral": { - "type": "object" - }, - "event_schema": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_segment_entered": { - "title": "Segment Entered", - "description": "Event data object schema for `customer.segment.entered`.", - "type": "object", - "properties": { - "segment": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_segment_left": { - "title": "Segment Left", - "description": "Event data object schema for `customer.segment.left`.", - "type": "object", - "properties": { - "segment": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_sms_sent": { - "title": "SMS Sent", - "description": "Event data object schema for `customer.sms.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_sms_failed": { - "title": "SMS Failed", - "description": "Event data object schema for `customer.sms.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_email_sent": { - "title": "Email Sent", - "description": "Event data object schema for `customer.email.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_email_failed": { - "title": "Email Failed", - "description": "Event data object schema for `customer.email.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_activecampaign_sent": { - "title": "ActiveCampaign Sent", - "description": "Event data object schema for `customer.activecampaign.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_activecampaign_failed": { - "title": "ActiveCampaign Failed", - "description": "Event data object schema for `customer.activecampaign.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_braze_sent": { - "title": "Braze Sent", - "description": "Event data object schema for `customer.braze.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_braze_failed": { - "title": "Braze Failed", - "description": "Event data object schema for `customer.braze.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_mailchimp_sent": { - "title": "Mailchimp Sent", - "description": "Event data object schema for `customer.mailchimp.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_mailchimp_failed": { - "title": "Mailchimp Failed", - "description": "Event data object schema for `customer.mailchimp.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_intercom_sent": { - "title": "Intercom Sent", - "description": "Event data object schema for `customer.intercom.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_intercom_failed": { - "title": "Intercom Failed", - "description": "Event data object schema for `customer.intercom.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_rewarded": { - "title": "Customer Rewarded", - "description": "Event data object schema for `customer.rewarded`.", - "type": "object", - "properties": { - "holder": { - "type": "object" - }, - "reward": { - "type": "object" - }, - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "custom_event": { - "type": "object" - }, - "referral_tier": { - "type": "object" - }, - "customer_event": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_rewarded_loyalty_points": { - "title": "Customer Rewarded Loyalty Points", - "description": "Event data object schema for `customer.rewarded.loyalty_points`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "earning_rule": { - "type": "object" - }, - "loyalty_tier": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added": { - "title": "Gift Voucher Balance Added", - "description": "Event data object schema for `customer.voucher.gift.balance_added`.", - "type": "object", - "properties": { - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added": { - "title": "Loyalty Card Points Added", - "description": "Event data object schema for `customer.voucher.loyalty_card.points_added`.", - "type": "object", - "properties": { - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred": { - "title": "Loyalty Card Points Transferred", - "description": "Event data object schema for `customer.voucher.loyalty_card.points_transferred`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_publication_succeeded": { - "title": "Publication Succeeded", - "description": "Event data object schema for `customer.publication.succeeded`.", - "type": "object", - "properties": { - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "publication": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_publication_failed": { - "title": "Publication Failed", - "description": "Event data object schema for `customer.publication.failed`.", - "type": "object", - "properties": { - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "publication": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_redemption_succeeded": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `customer.redemption.succeeded`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_redemption_failed": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `customer.redemption.failed`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded": { - "title": "Redemption Rollback Succeeded", - "description": "Event data object schema for `customer.redemption.rollback.succeeded`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - }, - "redemption_rollback": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_redemption_rollback_failed": { - "title": "Redemption Rollback Failed", - "description": "Event data object schema for `customer.redemption.rollback.failed`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - }, - "redemption_rollback": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_consents_given": { - "title": "Consents Given", - "description": "Event data object schema for `customer.consents.given`.", - "type": "object", - "properties": { - "consents": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "9_obj_customer_activity_object_data_customer_consents_revoked": { - "title": "Consents Given", - "description": "Event data object schema for `customer.consents.revoked`.", - "type": "object", - "properties": { - "consents": { - "type": "object" - }, - "customer": { - "type": "object" - } - } - }, - "customers_permanent_deletion_response_body": { - "type": "object", - "title": "Customer Permanent Deletion Response Body", - "description": "Response body schema for `/customers/{customerId}/permanent-deletion`.", - "properties": { - "id": { - "type": "string", - "description": "Unique permanent deletion object ID.", - "example": "del_mgzqZNwUnwnt1Ddw6phEG90Q" - }, - "created_at": { - "type": "string", - "example": "2022-09-02T17:55:47.865Z", - "description": "Timestamp representing the date and time when the customer was requested to be deleted in ISO 8601 format.", - "format": "date-time" - }, - "related_object_id": { - "type": "string", - "example": "cust_m557pDDl4IGXexkU6KOQ2Dwi", - "description": "Unique customer ID that is being deleted." - }, - "related_object": { - "type": "string", - "description": "Object being deleted.", - "default": "customer" - }, - "status": { - "type": "string", - "description": "Deletion status.", - "default": "DONE" - }, - "data_json": { - "type": "object", - "description": "Statistics summarizing the number of related information that was deleted.", - "required": [ - "events", - "customer_events", - "daily_events", - "segments", - "orders", - "order_events", - "customer" - ], - "properties": { - "events": { - "type": "integer", - "description": "Number of events deleted." - }, - "customer_events": { - "type": "integer", - "description": "Number of customer events deleted." - }, - "daily_events": { - "type": "integer", - "description": "Number of daily events deleted." - }, - "segments": { - "type": "integer", - "description": "Number of segments deleted." - }, - "orders": { - "type": "integer", - "description": "Number of orders deleted." - }, - "order_events": { - "type": "integer", - "description": "Number of order events deleted." - }, - "customer": { - "type": "integer", - "description": "Number of customers deleted.", - "default": 1 - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON.", - "default": "pernament_deletion" - } - }, - "required": [ - "id", - "created_at", - "related_object_id", - "related_object", - "status", - "data_json", - "object" - ] - }, - "customers_update_metadata_in_bulk_request_body": { - "type": "object", - "title": "Update Customers' Metadata in bulk Request Body", - "description": "Request body schema for `/customers/metadata/async`.", - "properties": { - "source_ids": { - "type": "array", - "description": "An array of customer `source_id`'s.", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object", - "description": "Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - } - }, - "required": [ - "source_ids", - "metadata" - ] - }, - "customers_update_in_bulk_request_body": { - "type": "array", - "title": "Update Customers in bulk Request Body", - "description": "Request body schema for `/customers/bulk/async`.", - "items": { - "$ref": "#/components/schemas/customers_update_in_bulk_item_request_body" - } - }, - "customers_update_in_bulk_item_request_body": { - "title": "Update Customers in bulk Request Body", - "description": "Request body schema for `/customers/bulk/async`.", - "properties": { - "source_id": { - "type": "string", - "description": "Unique customer source ID." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Customer's first and last name." - }, - "description": { - "type": [ - "string", - "null" - ], - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": [ - "string", - "null" - ], - "description": "Customer's email address." - }, - "phone": { - "type": [ - "string", - "null" - ], - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ], - "description": "City" - }, - "state": { - "type": [ - "string", - "null" - ], - "description": "State" - }, - "line_1": { - "type": [ - "string", - "null" - ], - "description": "First line of address." - }, - "line_2": { - "type": [ - "string", - "null" - ], - "description": "Second line of address." - }, - "country": { - "type": [ - "string", - "null" - ], - "description": "Country." - }, - "postal_code": { - "type": [ - "string", - "null" - ], - "description": "Postal code." - } - } - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate; format `YYYY-MM-DD`." - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " - } - }, - "required": [ - "source_id" - ] - }, - "9_req_update_customers_consents": { - "type": "object", - "title": "Update Customer Consents Request Body", - "description": "Request body schema for **PUT** `/customers/{customerId}/consents`.", - "properties": { - "consent_id": { - "type": "boolean", - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not." - }, - "unsubscribed": { - "type": "boolean", - "description": "To deny all consents, use `unsubscribed` as a consent identifier and `true` as a value." - } - } - }, - "10_obj_order_object": { - "type": "object", - "title": "Order object", - "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", - "x-tags": [ - "ORDERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "oneOf": [ - { - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - }, - { - "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" - } - ] - } - } - }, - "10_obj_order_object_no_discount_calculations": { - "type": "object", - "title": "Order object", - "description": "This is an object representing an order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique identifier that represents the product or SKU from your inventory system." - }, - "related_object": { - "type": "string", - "description": "Reference to the object containing details of the related product. This can either be a `product` or `sku`.", - "enum": [ - "product", - "sku" - ] - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } } }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "10_obj_order_object_unstacked_redemptions": { - "type": "object", - "title": "Unstacked Redemption", - "description": "Redemption object representing a single redemption.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "enum": [ - "voucher", - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the related object that defines the incentive." - }, - "related_object_parent_id": { - "type": "string", - "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign." - } - } - } - } - }, - "10_obj_order_object_stacked_redemptions": { - "type": "object", - "title": "Stacked Redemption", - "description": "Redemption object representing a stacked redemption.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique parent redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of multiple incentives.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "default": "redemption" - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the parent redemption.", - "example": "r_0ba186c4824e4881e1" - }, - "stacked": { - "type": "array", - "description": "Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.", - "items": { - "type": "string" - } - } - } - } - } - }, - "10_res_list_orders": { - "type": "object", - "title": "List Orders Response Body", - "description": "Response body schema representing **GET** `/orders`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about orders in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "orders", - "description": "Identifies the name of the attribute that contains the array of order objects." - }, - "orders": { - "type": "array", - "description": "Contains array of order objects.", - "items": { - "$ref": "#/components/schemas/10_obj_order_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of orders." - } - } - }, - "10_req_create_order": { - "type": "object", - "title": "Order", - "description": "Request body schema for creating an order.", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - } - } - }, - "10_req_update_order": { - "type": "object", - "title": "Update Order Request Body", - "description": "Request body schema for **PUT** `/orders/{orderId}`.", - "properties": { - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - }, - "customer_id": { - "type": "string", - "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "description": "Unique customer ID of the customer making the purchase." - }, - "referrer_id": { - "type": "string", - "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "description": "Unique referrer ID." - } - } - }, - "10_req_create_order_export": { - "type": "object", - "title": "Create Order Export Request Body", - "description": "Request body schema for **POST** `/orders/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/16_obj_export_order", - "description": "Contains the parameters that define the data to be exported." - } - } - }, - "10_req_orders_import": { - "type": "array", - "title": "Import Orders Request Body", - "description": "Request body schema for POST `/orders/import`.", - "items": { - "type": "object", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status. One of `CREATED`, `PAID`, `CANCELED`, `FULFILLED`." - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - } - } - } - }, - "10_req_orders_customer_object": { - "type": "object", - "title": "Customer", - "description": "This is an object containing information about the customer.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer that will be linked to the order; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address" - }, - "line_2": { - "type": "string", - "description": "Second line of address" - }, - "country": { - "type": "string", - "description": "Country" - }, - "postal_code": { - "type": "string", - "description": "Postal code" - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer." - } - } - }, - "10_req_orders_referrer_object": { - "type": "object", - "title": "Referrer", - "description": "This is an ojbect containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer that will be linked to the order as the referrer; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Referrer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a referrer object." - }, - "email": { - "type": "string", - "description": "Referrer's email address." - }, - "phone": { - "type": "string", - "description": "Referrer's phone number." - }, - "address": { - "type": "object", - "description": "Referrer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address" - }, - "line_2": { - "type": "string", - "description": "Second line of address" - }, - "country": { - "type": "string", - "description": "Country" - }, - "postal_code": { - "type": "string", - "description": "Postal code" - } - } - }, - "birthdate": { - "type": "string", - "description": "Referrer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Referrer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a referrer." - } - } - }, - "10_req_orders_items_array": { - "type": "array", - "title": "Items Array", - "description": "Array of items applied to the order.", - "items": { - "$ref": "#/components/schemas/10_req_orders_order_item" - } - }, - "10_req_orders_order_item": { - "type": "object", - "title": "Order Item", - "description": "This object represents an order line item.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "related_object": { - "type": "string", - "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." - }, - "product_id": { - "type": "string", - "description": "A unique product ID assigned by Voucherify.", - "example": "prod_0a7e62db1fca8322a2" - }, - "sku_id": { - "type": "string", - "description": "A unique SKU ID assigned by Voucherify.", - "example": "sku_0a41e31c7b41c28358" - }, - "quantity": { - "type": "integer", - "description": "The quantity of the particular item in the cart." - }, - "price": { - "type": "integer", - "description": "The unit price of the item." - }, - "amount": { - "type": "integer", - "description": "The total amount of the order item (`price` * `quantity`)." - }, - "product": { - "$ref": "#/components/schemas/10_req_orders_order_item_product" - }, - "sku": { - "$ref": "#/components/schemas/10_req_orders_order_item_sku" - } - } - }, - "10_req_orders_order_item_product": { - "type": "object", - "title": "Product", - "description": "An object containing details of the related product.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "name": { - "type": "string", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Product price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format." - }, - "override": { - "type": "boolean", - "description": "The override set to true is used to store the product information in the system. If product does not exist, it will be created with the use of `source_id`; if it does exist, the provided values for the `name`, `price`, and `metadata` will replace those already stored in the system." - } - } - }, - "10_req_orders_order_item_sku": { - "type": "object", - "title": "SKU", - "description": "An object containing details of the related SKU.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "sku": { - "type": "string", - "description": "The SKU name." - }, - "price": { - "type": "integer", - "description": "SKU price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format." - }, - "override": { - "type": "boolean", - "description": "The override is used to store the SKU in the system. If the SKU does not exist, it will be created with the use of `source_id`. Additionally, if the SKU does not exist, you are required to set the parent `product_id` that it belongs to. Set the parent `product_id` one level above, i.e. at the item level. If the parent product does not exist in Voucherify, i.e. does not have a unique `product_id`, then define the product object one level above, i.e. at the item level and make sure to also include the override as `true` for the product." - } - } - }, - "10_obj_order_item_object": { - "title": "Order Item Object", - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - }, - "description": "This is an object representing an order item. \n\nOrder Items are always specified within the [order object](ref:get-order). They can be related either to [products](list-products) or [SKUs](ref:list-skus-in-product). \n\nProduct/SKU details sent within an order item will be used on top of Product/SKU already stored in the system during the [Redeem Voucher](ref:redeem-voucher), [Validate Voucher](ref:validate-voucher), [Validate Promotions](ref:validate-promotions) and [Redeem Promotion](ref:redeem-promotion) requests.", - "x-tags": [ - "ORDERS API" - ] - }, - "11_obj_product_object": { - "type": "object", - "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.", - "title": "Product Object", - "x-tags": [ - "PRODUCTS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0b1da8105693710357" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID from your inventory system." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the `product`.", - "default": "product" - }, - "skus": { - "$ref": "#/components/schemas/11_res_get_product_skus_object" - } - } - }, - "11_req_create_product": { - "type": "object", - "description": "Request schema for **POST** `/products`.", - "title": "Create Product Request Body", - "properties": { - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } - }, - "11_req_update_products_metadata_in_bulk": { - "type": "object", - "description": "Request schema for **POST** `/products/metadata/async`.", - "title": "Update Products' Metadata in Bulk Request Body", - "properties": { - "source_ids": { - "type": "array", - "description": "Array of unique product source IDs.", - "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." - } - }, - "required": [ - "source_ids", - "metadata" - ] - }, - "11_req_update_product": { - "type": "object", - "description": "Request schema for **PUT** `/products/{productId}`.", - "title": "Update Product Request Body", - "properties": { - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } - }, - "11_req_update_product_bulk": { - "type": "object", - "description": "Request schema for **POST** `/products/bulk/async`.", - "title": "Update Product Request Body", - "properties": { - "source_id": { - "type": "string", - "description": "Unique product source ID from your inventory system.", - "example": "test_prod_id_1" - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } - }, - "11_res_list_products": { - "type": "object", - "description": "Response body schema representing **GET** `/products`.", - "title": "Product Object", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about products in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of product objects.", - "default": "products" - }, - "products": { - "type": "array", - "description": "Contains array of product objects.", - "items": { - "$ref": "#/components/schemas/11_obj_list_products_product_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of product objects." - } - } - }, - "11_obj_list_products_product_object": { - "type": "object", - "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.", - "title": "Product Object", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0b1da8105693710357" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the product.", - "default": "product" - }, - "skus": { - "type": "object", - "description": "Contains a list of related child SKUs.", - "properties": { - "data": { - "type": "array", - "description": "Contains a list of SKU objects.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - }, - "total": { - "type": "number", - "description": "Total number of SKUs." - } - } - } - } - }, - "11_res_get_product_skus_object": { - "type": "object", - "description": "Contains information about child SKUs.", - "title": "SKUs object", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of SKUs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of SKUs.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of SKUs in the product." - } - } - }, - "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.", - "title": "Product Object", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID.", - "example": "prod_f1r5Tpr0DuC7" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the `product`.", - "default": "product" - } - } - }, - "11_obj_sku_object": { - "title": "SKU Object", - "type": "object", - "description": "This is an object representing a product SKU. \n\nThe SKU (acronym from Stock Keeping Unit) is tightly related to the [product object](ref:get-product). It reflects its different variants. One product can have many SKUs which are characterized and differentiated by varying values of the parent product `attributes`.", - "x-tags": [ - "PRODUCTS API" - ], - "examples": [ - { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" - } - ], - "properties": { - "id": { - "type": "string", - "example": "sku_0b1621b319d248b79f", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "product_id": { - "type": "string", - "example": "prod_0b15f6b9f650c16990", - "description": "The parent product's unique ID." - }, - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency.", - "example": "USD" - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - }, - "created_at": { - "type": "string", - "example": "2022-05-17T10:36:30.187Z", - "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "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" - }, - "object": { - "type": "string", - "default": "sku", - "description": "The type of object represented by JSON. This object stores information about the `SKU`." - } - } - }, - "11_req_create_sku": { - "title": "SKU Object", - "type": "object", - "description": "Request body schema for **POST** `/products/{productId}/skus", - "properties": { - "source_id": { - "type": "string", - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency.", - "example": "USD" - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - } - } - }, - "product_collections_sku_in_collection": { - "title": "SKU in Collection", - "type": "object", - "description": "This is an object representing a SKU in product collection.", - "properties": { - "id": { - "type": "string", - "example": "sku_0b1621b319d248b79f", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": [ - "string", - "null" - ], - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "product_id": { - "type": "string", - "example": "prod_0b15f6b9f650c16990", - "description": "The parent product's unique ID." - }, - "sku": { - "type": [ - "string", - "null" - ], - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "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": { - "type": "object", - "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", - "null" - ], - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - }, - "created_at": { - "type": "string", - "example": "2022-05-17T10:36:30.187Z", - "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "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" - }, - "object": { - "type": "string", - "default": "sku", - "description": "The type of object represented by JSON. This object stores information about the `SKU`." - }, - "product": { - "type": "object", - "description": "Stores information about the parent product.", - "required": [ - "id", - "source_id", - "name", - "price", - "attributes", - "metadata", - "object" - ], - "properties": { - "id": { - "type": "string", - "example": "prod_f15Tpr0DuC7", - "description": "Unique product ID." - }, - "source_id": { - "type": [ - "string", - "null" - ], - "example": "productSourceID11", - "description": "A unique product ID from your inventory system." - }, - "name": { - "type": [ - "string", - "null" - ], - "example": "Shirts", - "description": "Unique user-defined product name." - }, - "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 SKL can have a unique value for a given attribute.", - "items": { - "type": "string" + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - }, - "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." - }, - "object": { - "type": "string", - "default": "product", - "description": "The type of object represented by the object. This object stores information about the parent `product`." } - } - } - }, - "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", - "type": "object", - "description": "Request body schema for **PUT** `/products/{productId}/skus/{skuId}`.", - "properties": { - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency." - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - } - } - }, - "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", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about products and SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of products and SKUs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of products and SKUs.", - "items": { - "oneOf": [ + }, + "8_req_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" + } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ { - "$ref": "#/components/schemas/product_collections_product_in_collection" + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_custom_event_no_validation_rule": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ { - "$ref": "#/components/schemas/product_collections_sku_in_collection" + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" } - ] - } - }, - "total": { - "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", - "description": "Response body schema for **GET** `/products/{productID}/skus`.", - "title": "List SKUs in Product Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of SKUs.", - "default": "skus" - }, - "skus": { - "type": "array", - "description": "A dictionary that contains an array of SKUs.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of SKUs in the product." - } - } - }, - "product_collections_static_collection": { - "type": "object", - "title": "Static Product Collection", - "description": "Schema model for a `STATIC` product collection.", - "properties": { - "type": { - "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", - "enum": [ - "STATIC" - ] - }, - "products": { - "description": "Defines a set of products for a `STATIC` product collection type.", - "type": "array", - "items": { + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" + } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" + } + } + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" + } + } + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_tier_no_validation_rule": { + "description": "This is an object representing an earning rule for tiers.", "type": "object", + "title": "Earning Rule Object for Tiers", "properties": { "id": { "type": "string", - "example": "prod_0a41bcf807c5fcaaf6", - "description": "The product ID." + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." }, - "product_id": { + "created_at": { "type": "string", - "description": "Product ID for SKUs." + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" }, - "object": { - "enum": [ - "sku", - "product" - ], - "description": "Denotes the type of object represented by the ID." - } - }, - "required": [ - "id", - "object" - ] - } - } - }, - "required": [ - "type", - "products" - ] - }, - "product_collections_dynamic_collection": { - "type": "object", - "title": "Dynamic Product Collection", - "description": "Schema model for an `AUTO_UPDATE` product collection.", - "properties": { - "type": { - "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" - ] - }, - "filter": { - "type": "object", - "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" - ] - }, - "product_collections_list_response_body": { - "type": "object", - "title": "List Product Collections Response Body", - "description": "Response body schema for **GET** `/product-collections`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about product collections.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the JSON property that contains the array of product collections." - }, - "data": { - "description": "A dictionary that contains an array of product collections and their details.", - "type": "array", - "items": { - "$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", - "type": "object", - "description": "This is an object representing a validation rule. \n\nThis entity stores the rules used to limit resources in Voucherify. The validation rule can be assigned to resources such as a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)\n\nYou can configure the Validation Rule to include your own custom error messages which are going to be returned from the API upon a validation / redemption failure. You can read more [here](ref:errors#custom-error-messages-with-validation-rules).", - "x-tags": [ - "VALIDATION RULES API" - ], - "properties": { - "id": { - "type": "string", - "example": "val_eR1c41hu0vUU", - "description": "Unique validation rule ID." - }, - "name": { - "type": "string", - "description": "Custom, unique name for set of validation rules.", - "example": "Business Validation Rule" - }, - "rules": { - "type": "object", - "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the rule.", - "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
customer.metadata* \n**Order** |order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** | sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive | order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n\n*Requires the `property` field to be defined." - }, - "property": { - "type": [ - "string", - "null" - ], - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata" - }, - "conditions": { - "type": "object", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n**Condition (key)** | **Definition** | **Does not support Types** \n--- | --- | ---\n $is | A property is a predefined value. | \n $is_not | A property is not a predefined value. | \n $in | A property either one value in a predefined list of values. | \n $less_than | A property is less than a predefined value. | boolean \n $less_than_or_equal | A property is less than or equal to a predefined value. | boolean \n $more_than | A property is more than a predefined value. | boolean \n $more_than_or_equal | A property is more than or equal to a predefined value. | boolean \n $starts_with | A property starts with the predefined sequence of characters. | boolean, number \n $ends_with | A property ends with the predefined sequence of characters. | boolean, number \n $contains | A property contains the predefined sequence of characters. | boolean, number \n $timeframe | | boolean, number \n $dow | | boolean, string \n $count | | boolean, string \n $count_more | | boolean, string \n $count_less | | boolean, string ", - "properties": { - "$one_of_voucherify_conditions": { - "type": "array", - "description": "Contains a set of conditions for the rule.", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] - } - } - } - }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } - } - }, - "logic": { - "type": "string" - } + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.", + "type": "null" + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." - } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" } } - } - }, - "logic": { - "type": "string", - "example": "(1 and 2) and (3)", - "description": "Defines the logic between the rules." - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." - } - } - }, - "applicable_to": { - "type": "object", - "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { + }, + "source": { "type": "object", - "description": "Defines the excluded item.", + "description": "Contains the custom earning rule name and parent campaign.", "properties": { - "object": { + "banner": { "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "id": { + "object_id": { "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." }, - "effect": { + "object_type": { "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } } - } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { "type": "object", - "description": "Defines the included item.", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { + "duration": { "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" }, - "effect": { + "interval": { "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." } - } - }, - "created_at": { - "type": "string", - "example": "2022-03-23T07:44:00.444Z", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-04-26T08:35:54.960Z", - "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "basic", - "advanced", - "complex" - ], - "description": "Type of validation rule." - }, - "context_type": { - "type": "string", - "enum": [ - "earning_rule.order.paid", - "earning_rule.custom_event", - "earning_rule.customer.segment.entered", - "campaign.discount_coupons", - "campaign.discount_coupons.discount.apply_to_order", - "campaign.discount_coupons.discount.apply_to_items", - "campaign.discount_coupons.discount.apply_to_items_proportionally", - "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", - "campaign.discount_coupons.discount.fixed.apply_to_items", - "campaign.gift_vouchers", - "campaign.gift_vouchers.gift.apply_to_order", - "campaign.gift_vouchers.gift.apply_to_items", - "campaign.referral_program", - "campaign.referral_program.discount.apply_to_order", - "campaign.referral_program.discount.apply_to_items", - "campaign.referral_program.discount.apply_to_items_proportionally", - "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", - "campaign.referral_program.discount.fixed.apply_to_items", - "campaign.promotion", - "campaign.promotion.discount.apply_to_order", - "campaign.promotion.discount.apply_to_items", - "campaign.promotion.discount.apply_to_items_proportionally", - "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", - "campaign.promotion.discount.fixed.apply_to_items", - "campaign.loyalty_program", - "campaign.lucky_draw", - "voucher.discount_voucher", - "voucher.discount_voucher.discount.apply_to_order", - "voucher.discount_voucher.discount.apply_to_items", - "voucher.discount_voucher.discount.apply_to_items_proportionally", - "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", - "voucher.discount_voucher.discount.fixed.apply_to_items", - "voucher.gift_voucher", - "voucher.gift_voucher.gift.apply_to_order", - "voucher.gift_voucher.gift.apply_to_items", - "voucher.loyalty_card", - "voucher.lucky_draw_code", - "distribution.custom_event", - "reward_assignment.pay_with_points", - "global" - ], - "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" - }, - "object": { - "type": "string", - "default": "validation_rules", - "description": "The type of object represented by JSON. This object stores information about the validation rule." - } - } - }, - "13_req_create_validation_rule": { - "title": "Create Validation Rule Request Body", - "type": "object", - "description": "Request body schema for **POST** `/validation-rules`.", - "properties": { - "name": { - "type": "string", - "description": "Custom, unique name for the set of validation rules.", - "example": "Business Validation Rule" - }, - "rules": { - "type": "object", - "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the rule.", - "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n| **Name** |\n|:---|\n| **Customer** |\n| customer.segment
customer.metadata* |\n| **Order** |\n| order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** |\n| campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |\n| redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** |\n| product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** |\n| sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** |\n| publication.redeemable_by_linked_customer |\n| **Custom Event** |\n| custom_event.metadata* |\n| **Order items** |\n| order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive |\n| order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n*Requires the `property` field to be defined." - }, - "property": { - "type": [ - "string", - "null" - ], - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" - }, - "conditions": { - "type": "object", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", - "properties": { - "$one_of_voucherify_conditions": { - "type": "array", - "description": "Contains a set of conditions for the rule.", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] + }, + "8_obj_fixed_points": { + "title": "Define Fixed Amount of Points", + "type": "object", + "description": "This is an object representing points calculated based on a fixed value.", + "properties": { + "points": { + "type": "integer", + "description": "The number of points to be added to the loyalty card.", + "example": 100 + }, + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", + "enum": [ + "FIXED" + ] + } + } + }, + "8_obj_calculate_points_proportionally_order_paid": { + "title": "Calculate Points Proportionally", + "description": "This is an object representing points calculated proportionally to another property.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_amounts" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_total_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_item_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_subtotal_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_quantity" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "8_obj_calculate_points_proportionally_order_amounts": { + "title": "Calculate Points Proportionally to Order Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_AMOUNT" + ], + "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" + }, + "order": { + "type": "object", + "properties": { + "amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } } } - }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } + } + } + } + }, + "8_obj_calculate_points_proportionally_order_total_amount": { + "title": "Calculate Points Proportionally to Total Order Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_TOTAL_AMOUNT" + ], + "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + }, + "order": { + "type": "object", + "properties": { + "total_amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } - }, - "logic": { - "type": "string" } } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + }, + "8_obj_calculate_points_proportionally_order_metadata": { + "title": "Calculate Points Proportionally To an Order Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to an order metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_METADATA" + ], + "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `order.metadata` object)" + }, + "order": { + "type": "object", + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the order metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "number_of_store_visits", + "description": "Order metadata property." + } } } } } - }, - "logic": { - "type": "string", - "example": "(1 and 2) and (3)", - "description": "Defines the logic between the rules." - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." } - } - }, - "applicable_to": { - "type": "object", - "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { + }, + "8_obj_calculate_points_proportionally_item_amount": { + "title": "Calculate Points Proportionally to Order Items Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_AMOUNT" + ], + "description": "- `ORDER_ITEMS_AMOUNT`; Pre-discount amount spent on items defined in the `order_items.amount.object` & `.id` (X points for every Y spent on items excluding discounts)" + }, + "order_items": { "type": "object", - "description": "Defines the excluded item.", "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." + "amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + } + } } } } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { + } + }, + "8_obj_calculate_points_proportionally_items_subtotal_amount": { + "title": "Calculate Points Proportionally to Order Items Subtotal Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_SUBTOTAL_AMOUNT" + ], + "description": "- `ORDER_ITEMS_SUBTOTAL_AMOUNT`; Amount spent on items defined in the `order_items.subtotal_amount.object` & `.id` (X points for every Y spent on items including discounts)" + }, + "order_items": { "type": "object", - "description": "Defines the included item.", "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + "subtotal_amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + } + } } } } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." } - } - } - } - }, - "13_res_list_validation_rules": { - "description": "Response body schema for listing validation rules. \n\nThis entity stores the [validation rules](ref:get-validation-rule) used to limit your resources.", - "type": "object", - "title": "List Validation Rules Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about validation rules.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of validation rules.", - "default": "data" - }, - "data": { - "type": "array", - "uniqueItems": true, - "description": "An array of validation rules.", - "items": { + }, + "8_obj_calculate_points_proportionally_items_quantity": { + "title": "Calculate Points Proportionally to Quantity of Items in the Cart", "type": "object", - "description": "Stores information about the validation rule.", + "description": "This is an object representing points calculated proportionally to quantity of items in the cart.", "properties": { - "id": { + "type": { "type": "string", - "description": "Unique validation rule ID.", - "example": "val_F4Artfc4HQIq" + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] }, - "name": { + "calculation_type": { "type": "string", - "description": "Custom, unique name for the set of validation rules." + "enum": [ + "ORDER_ITEMS_QUANTITY" + ], + "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in `order_items.quantity.object` & `.id` (X points for every Y items excluding free items)" }, - "rules": { + "order_items": { "type": "object", - "description": "A set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", "properties": { - "1": { + "quantity": { "type": "object", - "description": "Defines the rule.", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
customer.metadata* \n**Order** |order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** | sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive | order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n*Requires the `property` field to be defined." + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } - } - }, - "logic": { - "type": "string" - } - } + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "property": { + "object": { "type": "string", - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" - }, - "conditions": { - "type": "array", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] - } + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." - } - } + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." } } - }, - "logic": { - "type": "string", - "description": "Defines the logic between the rules.", - "example": "(1 and 2) and (3)" } } + } + } + }, + "8_obj_calculate_points_proportionally_customer_metadata": { + "title": "Calculate Points Proportionally To a Customer Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to a customer metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] }, - "error": { + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "`CUSTOMER_METADATA`: Customer Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `customer.metadata` object)" + }, + "customer": { "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "description": "Defines the formula for calculating points proportionally.", "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "customer_life_time_value", + "description": "Customer metadata property." + } + } } } + } + } + }, + "8_obj_calculate_points_proportionally_custom_event_metadata": { + "title": "Calculate Points Proportionally To a Custom Event Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to a custom event metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] }, - "applicable_to": { + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "`CUSTOM_EVENT_METADATA`: Custom Event Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `custom_event.metadata` object)" + }, + "custom_event": { "type": "object", + "description": "Defines the formula for calculating points proportionally.", "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { - "type": "object", - "description": "Defines the excluded item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." - } - } - } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { - "type": "object", - "description": "Defines the included item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." - } + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the custom event metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "volume_number", + "description": "Custom event metadata property." } } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." } } + } + } + }, + "8_res_list_loyalty_campaigns": { + "title": "List Loyalty Campaigns Response Body", + "type": "object", + "description": "Response body schema for listing loyalty campaigns using **GET** `/loyalties`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty campaigns in a dictionary." }, - "created_at": { + "data_ref": { "type": "string", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "example": "2022-04-07T07:42:44.442Z", - "format": "date-time" + "default": "campaigns", + "description": "Identifies the name of the attribute that contains the array of loyalty campaign objects." }, - "updated_at": { + "campaigns": { + "type": "array", + "description": "Contains an array of loyalty campaign objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object_no_extended_categories" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty campaign objects." + } + } + }, + "8_req_create_loyalty_cards": { + "type": "object", + "title": "Create Loyalty Campaign Request Body", + "description": "Request body schema for creating a loyalty campaign.", + "properties": { + "name": { "type": "string", - "example": "2022-05-09T07:42:44.442Z", - "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", - "format": "date-time" + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." }, "type": { "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", "enum": [ - "basic", - "advanced", - "complex" - ], - "description": "Type of validation rule." + "AUTO_UPDATE", + "STATIC" + ] }, - "context_type": { + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { "type": "string", - "enum": [ - "earning_rule.order.paid", - "earning_rule.custom_event", - "earning_rule.customer.segment.entered", - "campaign.discount_coupons", - "campaign.discount_coupons.discount.apply_to_order", - "campaign.discount_coupons.discount.apply_to_items", - "campaign.discount_coupons.discount.apply_to_items_proportionally", - "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", - "campaign.discount_coupons.discount.fixed.apply_to_items", - "campaign.gift_vouchers", - "campaign.gift_vouchers.gift.apply_to_order", - "campaign.gift_vouchers.gift.apply_to_items", - "campaign.referral_program", - "campaign.referral_program.discount.apply_to_order", - "campaign.referral_program.discount.apply_to_items", - "campaign.referral_program.discount.apply_to_items_proportionally", - "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", - "campaign.referral_program.discount.fixed.apply_to_items", - "campaign.promotion", - "campaign.promotion.discount.apply_to_order", - "campaign.promotion.discount.apply_to_items", - "campaign.promotion.discount.apply_to_items_proportionally", - "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", - "campaign.promotion.discount.fixed.apply_to_items", - "campaign.loyalty_program", - "campaign.lucky_draw", - "voucher.discount_voucher", - "voucher.discount_voucher.discount.apply_to_order", - "voucher.discount_voucher.discount.apply_to_items", - "voucher.discount_voucher.discount.apply_to_items_proportionally", - "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", - "voucher.discount_voucher.discount.fixed.apply_to_items", - "voucher.gift_voucher", - "voucher.gift_voucher.gift.apply_to_order", - "voucher.gift_voucher.gift.apply_to_items", - "voucher.loyalty_card", - "voucher.lucky_draw_code", - "distribution.custom_event", - "reward_assignment.pay_with_points", - "global" - ], - "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" }, - "assignments_count": { - "description": "The number of instances the validation rule has been assigned to different types of redeemables.", - "type": "integer" + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" }, - "object": { + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { "type": "string", - "default": "validation_rules", - "description": "The type of object represented by each nested object in the JSON `data` array. This object stores information about the validation rules." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of validation rules in the project." - } - } - }, - "13_obj_validation_rule_assignment_object": { - "title": "Validation Rule Assignment Object", - "type": "object", - "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", - "x-tags": [ - "VALIDATION RULES API" - ], - "properties": { - "id": { - "type": "string", - "example": "asgm_74F7QZoYbUoljwQO", - "description": "Validation rule assignment ID." - }, - "rule_id": { - "type": "string", - "example": "val_4j7DCRm2IS59", - "description": "Validation rule ID." - }, - "related_object_id": { - "type": "string", - "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", - "description": "The resource ID to which the validation rule was assigned." - }, - "related_object_type": { - "type": "string", - "description": "The type of resource to which the validation rule was assigned.", - "enum": [ - "voucher", - "campaign", - "earning_rule", - "reward_assignment", - "promotion_tier", - "distribution" - ] - }, - "created_at": { - "type": "string", - "example": "2022-02-17T08:18:15.085Z", - "description": "Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "validation_rules_assignment", - "description": "The type of object represented by the ID." - } - } - }, - "13_res_validation-rules_validationRuleId_assignments": { - "type": "object", - "description": "Validation Rule Assignments", - "title": "Validation Rule Assignments", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about validation rule assignments.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of validation rule assignments.", - "items": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of validation rule assignments." - } - } - }, - "13_req_create_validation_rule_assignments": { - "description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.", - "title": "Create Validation Rule Assignments Request Body", - "oneOf": [ - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_voucher" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_campaign" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_promotion_tier" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_earning_rule" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_reward" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_distribution" - } - ] - }, - "13_req_create_validation_rule_assignments_voucher": { - "type": "object", - "description": "Assign a validation rule to a voucher.", - "title": "Voucher", - "properties": { - "voucher": { - "type": "string", - "description": "Unique voucher ID or code to which you would like to assign the validation rule to.", - "example": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" - } - } - }, - "13_req_create_validation_rule_assignments_campaign": { - "type": "object", - "description": "Assign a validation rule to a campaign.", - "title": "Campaign", - "properties": { - "campaign": { - "type": "string", - "description": "Unique campaign ID or name to which you would like to assign the validation rule to.", - "example": "camp_HXsR22VUMC4hN4DR7eAhCalp" - } - } - }, - "13_req_create_validation_rule_assignments_promotion_tier": { - "type": "object", - "description": "Assign a validation rule to a promotion tier.", - "title": "Promotion Tier", - "properties": { - "promotion_tier": { - "type": "string", - "description": "Unique promotion tier ID to which you would like to assign the validation rule to.", - "example": "promo_Vet0vCNyyo5pOddHfu2X3FCB" - } - } - }, - "13_req_create_validation_rule_assignments_earning_rule": { - "type": "object", - "description": "Assign a validation rule to an earning rule.", - "title": "Earning Rule", - "properties": { - "earning_rule": { - "type": "string", - "description": "Unique earning rule ID to which you would like to assign the validation rule to.", - "example": "ern_CfvQ4vWEKD4kHTxghdY8YJGs" - } - } - }, - "13_req_create_validation_rule_assignments_reward": { - "type": "object", - "description": "Assign a validation rule to a reward.", - "title": "Reward", - "properties": { - "related_object_id": { - "type": "string", - "description": "Unique reward assignment ID, i.e. rewa_6VSWcXjfm5PuZlfeuZxl5JZT. This is the first parameter to be sent for a validation rule assignment to be assigned to a reward assignment. The prerequisites for assigning a validation rule to a reward assignment are: \n1. Define a loyalty campaign. \n2. Connect a reward with the campaign. \n3. Retrieve a reward assignment ID for the reward assigned to the loyalty campaign. \n4. And finally you can use this endpoint to assign a validation rule to the particular reward assignment.", - "example": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT" - }, - "related_object_type": { - "type": "string", - "description": "This is the second parameter that needs to be sent in order to properly assign a validation rule to a reward assignment.", - "example": "reward_assignment", - "default": "reward_assignment", - "enum": [ - "reward_assignment" - ] - } - } - }, - "13_req_create_validation_rule_assignments_distribution": { - "type": "object", - "description": "Assign a validation rule to a distribution.", - "title": "Distribution", - "properties": { - "distribution": { - "type": "string", - "description": "Unique distribution ID to which you would like to assign the validation rule to.", - "example": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" - } - } - }, - "14_obj_segment_object": { - "title": "Customer Segment Object", - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "seg_1wc52c5z6r1kQ81brO8j9Hk2", - "description": "Unique segment ID." - }, - "name": { - "type": "string", - "description": "Segment name." - }, - "created_at": { - "type": "string", - "example": "2022-05-12T13:01:56.896Z", - "description": "Timestamp representing the date and time when the segment was created in ISO 8601 format.", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "auto-update", - "static" - ], - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers)." - }, - "filter": { - "type": [ - "object", - "null" - ], - "description": "Defines a set of criteria for an `auto-update` segment type. " - }, - "initial_sync_status": { - "type": "string", - "enum": [ - "IN_PROGRESS", - "DONE" - ] - }, - "object": { - "type": "string", - "default": "segment", - "description": "The type of object represented by JSON. This object stores information about the customer segment." - } - }, - "description": "This is an object representing a customer segment.", - "x-tags": [ - "SEGMENTS API" - ] - }, - "14_req_create_segment": { - "title": "Create Customer Segment Request Body", - "description": "Request body schema for **POST** `/segments`.", - "oneOf": [ - { - "$ref": "#/components/schemas/14_req_create_segment_static" - }, - { - "$ref": "#/components/schemas/14_req_create_segment_dynamic" - } - ] - }, - "14_req_create_segment_static": { - "title": "Static Customer Segment", - "type": "object", - "description": "Request body schema for creating a static customer segment in **POST** `/segments`.", - "properties": { - "name": { - "type": "string", - "description": "Segment name." - }, - "type": { - "type": "string", - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", - "default": "static" - }, - "customers": { - "type": "array", - "description": "Array of customer IDs.", - "items": {} - } - } - }, - "14_req_create_segment_dynamic": { - "title": "Dynamic Customer Segment", - "type": "object", - "description": "Request body schema for creating a dynamic customer segment in **POST** `/segments`.", - "properties": { - "name": { - "type": "string", - "description": "Segment name." - }, - "type": { - "type": "string", - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", - "default": "auto-update" - }, - "filter": { - "type": "object", - "description": "Defines a set of criteria for an `auto-update` segment type." - } - } - }, - "14_res_customers_customerId_segments": { - "type": "object", - "title": "List Segments for Customer Response Body", - "description": "Response body schema for `/customers/{customerId}/segments`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about customer segments.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of segment IDs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of segment IDs and names.", - "items": { - "type": "object", - "properties": { - "id": { + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "category_id": { "type": "string", - "description": "Unique segment ID.", - "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" }, - "name": { + "category": { "type": "string", - "description": "Segment name." + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." }, - "object": { + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + } + } + }, + "8_loyalty_tiers_expiration_balance": { + "title": "Balance", + "type": "object", + "description": "Defines the Balance expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { "type": "string", - "description": "The type of object represented by the ID.", - "default": "segment" + "enum": [ + "BALANCE" + ], + "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." + } + } + }, + "expiration_date": { + "description": "Defines the conditions for the expiration date of a tier.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_balance_drop" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_custom" + } + ] } } - } - }, - "total": { - "type": "integer", - "description": "Total number of segments the customer belongs to." - } - } - }, - "15_obj_event_object": { - "title": "Event Object", - "type": "object", - "description": "This is an object representing an event. \n\nVoucherify distinguishes two types of events - custom and internal. Both are presented in the same Event structure. \n\n## Custom Events\n\nCustom Events are actions taken by your customers. They’re best suited for tracking high-value customer interactions with your application. Logging a custom event can trigger any number of distributions, and enables the segmentation filters around the recency and frequency of that event.\n\nWith Custom Event metadata field, Voucherify allows you to set properties on custom events. These properties can then be used for further qualifying trigger conditions, increasing personalization in messaging, and generating more sophisticated analytics through raw data export.\n\nThe Custom Events are directly linked to the customers' resources from Voucherify. It means that each event gets a connection to a customer. \n\n\n> #### An example \n>\n> If an e-commerce application wanted to send a message to a user when he/she abandons their cart, the custom event could additionally improve its target audience and allow for increased distribution personalization by adding a Custom Event of the `value` of customers’ order.\n\n## Internal Voucherify Events \n\nMoreover, Events are our way of letting you know when something interesting happens in your project. When an interesting event occurs, we create a new Event object. For example, when a redemption succeeds, we create a `redemption.succeeded` event.\n\nNote that many API requests may cause multiple events to be created. For example, if you create a new redemption for a new customer not existing yet in Voucherify, you will receive both a `customer.created` event and a `redemption.succeeded` event.\n\nThe events occur when the state of another API resource changes and the state of that resource at the time of the change is embedded in the data field of the event. \n\n| **Types of internal events** |\n|:---|\n| **Campaign** |\n| campaign.validation_rules.created
campaign.created
campaign.disabled
campaign.export_mailchimp_scheduled
campaign.export_mailchimp_done
campaign.validation_rules.deleted
campaign.validation_rules.updated
campaign.updated
campaign.deleted
campaign.export_mailchimp_failed
campaign.enabled |\n| **Voucher** |\n| voucher.validation.succeeded
voucher.updated
voucher.enabled
voucher.gift.balance_added
voucher.validation_rules.updated
voucher.published
voucher.validation_rules.deleted
voucher.disabled
voucher.validation.failed
voucher.validation_rules.created
voucher.deleted
voucher.created |\n| **Redemption** |\n| redemption.succeeded
redemption.failed
redemption.rollback.failed
redemption.rollback.succeeded |\n| **Customer** |\n| customer.rewarded
customer.rewarded.loyalty_points
customer.sms.sent
customer.email.failed
customer.deleted
customer.created
customer.updated
customer.segment.left
customer.sms.failed
customer.segment.entered
customer.email.sent |\n| **Order** |\n| order.canceled
order.created
order.updated
order.paid |\n| **Product** |\n| product.updated
product.created
product.deleted |\n| **SKU** |\n| sku.updated
sku.created
sku.deleted |\n| **Distribution** |\n| distribution.sms.failed
distribution.sms.sent
distribution.email.sent
distribution.email.failed |\n| **Export** |\n| export.done
export.scheduled
export.failed
export.deleted | \n\n## Webhooks \n\nVoucherify also has a separate system for sending the event objects directly to an endpoint at your end (server). We called that mechanism webhooks. They are managed in your project settings. \n\n| **Attribute** | **Description** | **Example** |\n|:---|:---|:---|\n| `id`
string | | event_xjGas2mI2PduFFPL2NAcFeHkHfLn3H |\n| `object`
string | Type of the object represented by JSON. Value is `event`. | |\n| `created_at`
string, ISO 8601 date format | Time at which the object was created. | 2016-11-16T14:14:31Z |\n| `type`
string | Description of the event | view_pricing_page
redemption.succeeded |\n| `data.object`
object | The object containing data associated with the event. It can be a `customer`, `redemption` or any other type of object which is a source of the event. In this object structure, you can also find a property `related_object` which contains values presenting any other resource connected to the event.

For Custom Event the structure of child attributes is constant:

- customer (`object`) - The object presenting a profile of the related customer who performed an action.

- metadata (`object`) - A set of key/value pairs that you can attach to a custom event object. It can be useful for storing additional information about the event in a structured format. | \"data\": { \"object\": { \"customer\": { \"id\": \"cust_OtHDKrv5sJrjd8aYBYZ6AOIF\", \"name\": \"Gustav Purpleson\", \"object\": \"customer\", \"source_id\": \"gustav@purpleson.com\", \"created_at\": 1510834859417, \"updated_at\": 1510835106559 }, \"metadata\": { \"lang\": \"en\", \"test\": true, \"page\": \"http://main.io\" } } } |\n| `metadata`
object | A set of key/value pairs that Voucherify attaches to a custom event object. It is a set of additional system information about the event in a structured format. | |\n\n\n```json\n{\n \"id\": \"event_ehkvgZFgSePlb95SH3JJulkApy9Kg9\",\n \"object\": \"event\",\n \"created_at\": \"2017-11-16T14:45:34.181Z\",\n \"type\": \"redemption.succeeded\",\n \"data\": {\n \"object\": {\n \"id\": \"r_mist0IpebikTaRdxiOGI2IhL\",\n \"date\": \"2017-11-16T14:45:32.733Z\",\n \"order\": {\n \"id\": \"ord_AhDlR13vQE5ino95P2NIABBN\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"sku_id\": null,\n \"quantity\": 1,\n \"source_id\": null,\n \"product_id\": \"iphone8\"\n }\n ],\n \"amount\": 50000,\n \"object\": \"order\",\n \"status\": \"CREATED\",\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": null,\n \"referrer\": null,\n \"source_id\": null,\n \"created_at\": \"2017-11-16T14:45:32.023Z\",\n \"updated_at\": null,\n \"discount_amount\": 2000\n },\n \"object\": \"redemption\",\n \"result\": \"SUCCESS\",\n \"voucher\": {\n \"code\": \"2017-goX-aH\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"object\": \"voucher\",\n \"campaign\": \"SteffenTest\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 2000\n },\n \"is_referral_code\": false\n },\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": {\n \"city\": \"London1\"\n },\n \"customer_id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"tracking_id\": \"track_3tM7KR57bbeIRtMcvpKYr2aAOrCpYBDZ\",\n \"related_object_type\": \"voucher\"\n },\n \"previous_attributes\": {}\n },\n \"metadata\": {\n \"source\": \"API\"\n }\n}\n```\n\n## Customisable Campaign Events \n\nAs part of campaign creation, users can configure webhooks triggered when specific activities appear within a campaign's lifetime. Those webhooks get configurable names and the users implement them in Voucherify Dashboard as part of the campaign creation process.\n\nThis type of webhooks can be configured for the following actions: \n\n| **Action** |\n|:---|\n| **Referral Program** |\n| Referrer rewarded
Referral code assigned
Customer referred |\n| **Loyalty Campaign** |\n| Loyalty card assigned
Points earned
Points redeemed | \n\nPayloads of customizable webhooks:\n\n### Referral Program\n\n\n```json\n{\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:09:57.765Z\",\n \"type\": \"referral_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"is_referral_code\": true,\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 1,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:00:08.306Z\",\n \"updated_at\": \"2021-11-12T11:09:40.671Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null,\n \"last_order_date\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:09:57.749Z\",\n \"updated_at\": \"2021-11-12T11:09:58.620Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null,\n \"value\": \"$10.00\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:09:57.765Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:49.723Z\",\n \"type\": \"referrer_rewarded_webhook\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/k\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1+tdyBGQeM+ZONM/k\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 1,\n \"campaigns\": {\n \"Referral Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 1\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:09:57.749Z\",\n \"updated_at\": \"2021-01-24T11:19:41.513Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_9Y7nwUx3BaU3cHqBVbd0TEtS2ENiFZhJ\",\n \"created_at\": \"2021-01-24T11:19:40.317Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"test_referrer__01\",\n \"metadata\": {},\n \"channel\": \"Automation\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"dOzJ84Ky\",\n \"vouchers\": [\n {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/kBdZ\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BtdyBGQeM%2BZONM%2FkBdZ\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\"\n ],\n \"campaign_name\": \"Bonus Cards\",\n \"gift\": {\n \"amount\": 0,\n \"balance\": 0\n },\n \"loyalty_card\": null,\n \"discount\": null,\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"is_referral_code\": true,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_Fuzc1rngCCuKRDfBXBjUwl5j\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-01-24T11:19:43.883Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"reward_assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"source_id\": \"event_0a26b3d269013fc79e\",\n \"source_type\": \"redemption_event\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"type\": \"GIFT_VOUCHER\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"object\": \"reward\",\n \"name\": \"Credits - 5$\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"reward_id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"related_object_id\": \"rrt_NWk1WYi1sZs3Epjvvd5a9JZx\",\n \"related_object_type\": \"referral_tier\",\n \"created_at\": \"2021-01-24T11:00:08.471Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"event_0a26b3d269013fc79e\",\n \"type\": \"redemption_event\"\n },\n \"balance\": {\n \"amount\": 500\n }\n },\n \"created_at\": \"2021-01-24T11:19:49.723Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:41.101Z\",\n \"type\": \"referee_invited\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": \"2021-01-24T11:09:40.671Z\",\n \"created_at\": \"2021-01-24T11:00:08.306Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"type\": \"customer.referred\",\n \"created_at\": \"2021-01-24T11:19:34.223Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {}\n },\n \"metadata_json\": {\n \"is_rewarded\": true,\n \"source\": null\n },\n \"automation_id\": null,\n \"group_id\": \"v-0a26b3d24b032c4871\"\n }\n },\n \"metadata\": {}\n}\n```\n\n### Loyalty Campaign \n\n\n```json\n{\n \"id\": \"evcus_0a26b89763051ed721\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"type\": \"loyalty_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 0,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:40:19.724Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"value\": 0\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b89763051ed721\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:40:18.125Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b9290fc4891587\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:42:51.380Z\",\n \"type\": \"points_earned\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 220\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": \"2021-11-12T11:42:50.332Z\",\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": {\n \"distr_naR4rx0AgM1baWZkFm1kfHn7A9\": {\n \"date\": \"2021-11-12T11:40:21.957Z\"\n },\n \"distr_pnfPKLDAxUpiPi3ZsuMrygtYNN\": {\n \"date\": \"2021-11-12T11:42:50.332Z\"\n }\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n }\n },\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": null,\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": null,\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 220\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 220,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 220,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:47.393Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b9290fc4891587\",\n \"type\": \"customer.rewarded.loyalty_points\",\n \"created_at\": \"2021-11-12T11:42:47.359Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:40.635Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n },\n \"balance\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n }\n },\n \"metadata_json\": {\n \"source\": \"Automation\"\n },\n \"automation_id\": \"auto_McXM3rjWcPwaNU5ndIIP13jX\",\n \"group_id\": \"v-0a26b921779d7eebcb\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json \n{\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:53:09.910Z\",\n \"type\": \"points_redeemed\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 1,\n \"total_failed\": 0,\n \"total_succeeded\": 1,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 218,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 218,\n \"referred_customers\": 0\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:53:07.582Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_aFszQ4kOtT1Hori8Wl1i0az1sFQN3CRv\",\n \"created_at\": \"2021-11-12T11:53:03.172Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"Loyal_customer__01\",\n \"metadata\": {},\n \"channel\": \"API\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"xUgBLQck\",\n \"vouchers\": [\n {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\"\n ],\n \"campaign_name\": \"20% discount\",\n \"gift\": null,\n \"loyalty_card\": null,\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 218\n },\n \"type\": \"LOYALTY_CARD\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_uATcoUjIp3VJNgT5TZT5NMaT\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-11-12T11:53:06.025Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"reward_assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"source_id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"source_type\": \"redemption\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"object\": \"reward\",\n \"name\": \"20% discount\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"reward_id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"related_object_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"related_object_type\": \"campaign\",\n \"parameters\": {\n \"loyalty\": {\n \"points\": 2\n }\n },\n \"created_at\": \"2021-11-12T11:39:05.504Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"type\": \"redemption\"\n },\n \"balance\": null\n },\n \"created_at\": \"2021-11-12T11:53:09.910Z\"\n }\n },\n \"metadata\": {}\n}\n```", - "x-tags": [ - "EVENTS API" - ] - }, - "15_req_track_custom_event": { - "title": "Track Custom Event Request Body", - "type": "object", - "description": "Request schema for tracking a custom event.", - "properties": { - "event": { - "type": "string", - "description": "Event name. This is the same name that you used to define a custom event in the **Dashboard** > **Project Settings** > **Event Schema**." - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" + }, + "8_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { + "title": "Balance Drop", + "type": "object", + "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", + "properties": { + "type": { + "type": "string", + "enum": [ + "BALANCE_DROP" + ], + "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." + } } - ], - "type": "object" - }, - "referral": { - "type": "object", - "description": "If a **conversion event** for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event. ", - "properties": { - "code": { - "type": "string", - "description": "A code through which a new visitor has been referred to a service." - }, - "referrer_id": { - "type": "string", - "description": "Unique ID of the referring person - it is optional and not required if the referral **code** is provided.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "8_loyalty_tiers_expiration_balance_expiration_date_custom": { + "title": "Custom", + "type": "object", + "description": "Defines the custom conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." + }, + "extend": { + "type": "string", + "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." + }, + "rounding": { + "description": "Defines the rounding mechanism for tier expiration.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_default_options" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_custom" + } + ] + } } - } - }, - "loyalty": { - "type": "object", - "description": "If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.", - "properties": { - "code": { - "type": "string", - "description": "Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the `event` parameter of the request payload gets sent along with this loyalty card code." + }, + "8_loyalty_tiers_expiration_expiration_date_rounding_default_options": { + "title": "Calendar Periods", + "type": "object", + "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", + "properties": { + "type": { + "type": "string", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ], + "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." + } } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the **Dashboard** > **Project Settings** > **Event Schema** > **Edit particular event** > **Metadata property definition**." - } - } - }, - "15_res_track_custom_event": { - "title": "Track Custom Event Request Body", - "type": "object", - "description": "Request schema for tracking a custom event.", - "properties": { - "object": { - "type": "string", - "default": "event", - "description": "The object represented is an `event`." - }, - "type": { - "type": "string", - "description": "The event name." - }, - "customer": { - "type": "object", - "description": "An empty customer object." - }, - "referral": { - "type": "null", - "description": "A `null` referral object." - }, - "loyalty": { - "type": "null", - "description": "A `null` loyalty object." - } - } - }, - "16_obj_export_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\nThe `/exports` endpoint allows you to retrieve Voucherify objects such as [vouchers](ref:get-voucher), [redemptions](ref:list-redemptions), [publications](ref:list-publications), [customers](ref:get-customer), and [orders](ref:get-order) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can [get](ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported and `filter` out the relevant data\n\n\n```json\n{\n \"fields\": [\n \"code\",\n \"voucher_type\"\n ],\n \"filters\": {\n \"categories\": {\n \"conditions\": {\n \"$in\": [\n \"postman\"\n ]\n }\n }\n }\n}\n```\n\n\n## Fields values\nHere is a list of the fields you can export for particular objects. \n| **Object** | **Fields** |\n|:---|:---|\n| voucher | 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
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
metadata
metadata.X *where X is the name of a particular metadata property* |\n| redemption | 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
metadata.X *where X is the name of a particular metadata property* |\n| publication | voucher_code
customer_id
customer_source_id
date
channel
campaign
is_winner
metadata
metadata.X *where X is the name of a particular metadata property* |\n| customer | 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
birthdate
birthday
metadata
metadata.X *where X is the name of a particular metadata property* |\n| order | id
source_id
status
created_at
updated_at
amount
discount_amount
items_discount_amount
total_discount_amount
total_amount
customer_id
referrer_id
metadata
metadata.X *where X is the name of a particular metadata property* |\n| points expiration | id
campaign_id
voucher_id
expires_at
status
points |\n\n\n## Pagination and example request\nVoucherify allows you to specify the timeframe for the records you want to retrieve. Thanks to this mechanism it should be easy to implement a pagination mechanism. See the example of request body: \n\n\n```json Export Redemption Example\n{\n \"exported_object\": \"redemption\",\n \"parameters\": {\n \"order\": \"-created_at\",\n \"fields\": [\n \"id\",\n \"object\",\n \"date\",\n \"voucher_code\",\n \"customer_id\",\n \"result\"\n ],\n \"filters\": {\n \"junction\": \"and\",\n \"created_at\": {\n \"conditions\": {\n \"$after\": [\n \"2018-05-30T22:00:00.000Z\"\n ],\n \"$before\": [\n \"2018-06-29T22:00:00.000Z\"\n ]\n }\n }\n }\n }\n}\n```\n\nAn export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "x-tags": [ - "EXPORTS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "enum": [ - "API", - "WEBSITE" - ] - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "enum": [ - "order", - "voucher", - "publication", - "redemption", - "customer", - "points_expiration", - "voucher_transactions" - ] - }, - "parameters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_export_order" - }, - { - "$ref": "#/components/schemas/16_obj_export_voucher" - }, - { - "$ref": "#/components/schemas/16_obj_export_publication" - }, - { - "$ref": "#/components/schemas/16_obj_export_redemption" - }, - { - "$ref": "#/components/schemas/16_obj_export_customer" - }, - { - "$ref": "#/components/schemas/16_obj_export_points_expiration" - }, - { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + }, + "8_loyalty_tiers_expiration_expiration_date_rounding_custom": { + "title": "Specific Month", + "type": "object", + "description": "Defines the custom rounding mechanism for tier expiration.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "This mechanism describes a custom rounding for the expiration date." + }, + "unit": { + "type": "string", + "description": "Defines the type of unit of time in which the rounding period is counted.", + "enum": [ + "MONTH" + ] + }, + "value": { + "type": "integer", + "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" + } } - ] - }, - "result": { - "type": "object", - "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](ref:download-export) method." + }, + "8_loyalty_tiers_expiration_points_in_period": { + "title": "Points in Period", + "type": "object", + "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "POINTS_IN_PERIOD" + ], + "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." + }, + "qualification_period": { + "type": "string", + "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
- January - March
- April - June
- July - September
- October - December |\n| **Calendar Half-year** | Points collected in the half-year
- January - June
- July - December |\n| **Calendar Year** | Points collected in one calendar year
January - December |", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ] + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE", + "NEXT_PERIOD" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." + } + } + }, + "expiration_date": { + "type": "object", + "description": "Defines the conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "END_OF_PERIOD", + "END_OF_NEXT_PERIOD" + ], + "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." + }, + "extend": { + "type": "string", + "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." + } + } + } } - } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" - } - } - }, - "16_res_list_exports": { - "description": "Response schema for listing exports.", - "type": "object", - "title": "List Exports Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about exports.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of exports.", - "default": "exports" - }, - "exports": { - "type": "array", - "uniqueItems": true, - "description": "An array of export objects.", - "items": { - "$ref": "#/components/schemas/16_obj_export_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of exports." - } - } - }, - "16_req_create_export_POST": { - "description": "Request schema for creating an export.", - "type": "object", - "title": "Create Export Request Body", - "properties": { - "exported_object": { - "type": "string", - "description": "The type of object to be exported.", - "enum": [ - "order", - "voucher", - "publication", - "redemption", - "customer", - "points_expiration", - "voucher_transactions" - ] - }, - "parameters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_export_order" - }, - { - "$ref": "#/components/schemas/16_obj_export_voucher" - }, - { - "$ref": "#/components/schemas/16_obj_export_publication" - }, - { - "$ref": "#/components/schemas/16_obj_export_redemption" - }, - { - "$ref": "#/components/schemas/16_obj_export_customer" - }, - { - "$ref": "#/components/schemas/16_obj_export_points_expiration" - }, - { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + }, + "8_req_update_loyalty_campaign": { + "type": "object", + "title": "Update Loyalty Campaign Request Body", + "description": "Request body schema for updating a loyalty campaign using **PUT** `/loyalties/{campaignId}`.", + "properties": { + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + } } - ] - } - } - }, - "16_obj_export_order": { - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data.", - "title": "order", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at", - "updated_at", - "-updated_at", - "status", - "-status" - ] - }, - "fields": { - "type": "array", - "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" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |", - "items": { - "type": "string" - } - }, - "filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_order_status" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_source_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_total_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_discount_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_total_discount_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_items_discount_amount" + }, + "8_req_create_earning_rules": { + "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", + "title": "Create Earning Rule Request Body", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_earning_rule_object_order_paid" + }, + { + "$ref": "#/components/schemas/8_req_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_req_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_req_earning_rule_object_tier" + } + ] } - ] - } - } - }, - "16_obj_export_voucher": { - "description": "List of available fields and filters that can be exported with a voucher along with the sorting order of the returned data.", - "title": "voucher", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] - }, - "fields": { - "type": "array", - "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", - "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", - "metadata" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| metadata | Returns all voucher metadata. | Response will include all voucher metadata. |\n| metadata.X | Where X is the name of a particular voucher metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |\n", - "items": { - "type": "string" - } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `categories`\n\n - `vouchers`\n\n - `type`\n\n - `holder_id`\n\n - `is_referral_code`\n\n - `published_for_customer_id`\n\n - `validity_timeframe`\n\n - `category_ids`" - } - } - }, - "16_obj_export_publication": { - "description": "List of available fields and filters that can be exported with a publication along with the sorting order of the returned data.", - "title": "publication", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at", - "channel", - "-channel" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "voucher_code", - "customer_id", - "customer_source_id", - "date", - "channel", - "campaign", - "is_winner", - "metadata" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Returns all publication metadata. | Response will include all publication metadata. |\n| metadata.X | Where X is the name of a particular publication metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" - } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `failure_code`\n\n - `result`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `voucher_type`\n\n - `is_referral_code`\n\n - `parent_object_id`\n\n - `related_object_id`\n\n - `source_id`", - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_publication_failure_code" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_result" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_customer_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_campaign_name" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_voucher_type" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_is_referral_code" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_parent_object_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_related_object_id" + }, + "8_req_create_earning_rules_copy": { + "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", + "type": "object", + "title": "Create Earning Rule Request Body", + "properties": { + "event": { + "type": "string", + "enum": [ + "order.paid", + "customer.segment.entered", + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. Read more here. \n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment. Read more here. \n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining custom events. " + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "description": "Fixed. Applicable to events `order.paid`, `customer.segment.entered`, and `custom_event`.", + "properties": { + "points": { + "type": "integer", + "description": "The number of points to be added to the loyalty card.", + "example": 1000 + }, + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", + "default": "FIXED" + } + }, + "required": [ + "points", + "type" + ] + }, + { + "description": "Proportional. Applicable to only `order.paid`.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio", + "default": "PROPORTIONAL" + }, + "order": { + "type": "object", + "description": "Defines proportion for calculating how many points to add to a loyalty card. The ratio is based on the order amount. For `every` dollar spent, the customer will get this many `points`. \n", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "description": "Defines the ratio based on the order amount.", + "required": [ + "every", + "points" + ], + "properties": { + "every": { + "type": "integer", + "description": "Order amount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points awarded." + } + } + } + } + } + }, + "required": [ + "type", + "order" + ] + } + ], + "type": "object" + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day. `start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + }, + "required": [ + "duration", + "interval" + ] + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API." + } + }, + "required": [ + "schema_id" + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + }, + "required": [ + "id" + ] + } }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_source_id" - } - ] - } - } - }, - "16_obj_export_redemption": { - "description": "List of available fields and filters that can be exported with a redemption along with the sorting order of the returned data.", - "title": "redemption", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at" - ] - }, - "fields": { - "type": "array", - "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" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Returns all redemption metadata. | Response will include all redemption metadata. |\n| metadata.X | Where X is the name of a particular redemption metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" - } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `voucher_code`\n\n - `related_object_id`\n\n - `related_object_parent_id`\n\n - `parent_redemption_id`\n\n - `failure_code`\n\n - `result`\n\n - `object`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `user_login`" - } - } - }, - "16_obj_export_customer": { - "description": "List of available fields and filters that can be exported with a customer along with the sorting order of the returned data.", - "title": "customer", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "name", - "-name", - "id", - "-id", - "email", - "-email", - "source_id", - "-source_id", - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "fields": { - "type": "array", - "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" + "required": [ + "event", + "loyalty" ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | |\n| loyalty_referred_customers | How many customers were referred by this customer. | |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| birthdate | Customer's birthdate. | 2022-04-29 |\n| metadata | Returns all customer metadata. | Response will include all customer metadata. |\n| metadata.X | Where X is the name of a particular customer metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" - } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `name` (string)\n\n - `email` (string)\n\n - `phone` (string)\n\n - `metadata` (json)\n\n - `metadata.X` (?)\n\n - `address` (json)\n\n - `address.state` (string)\n\n - `address.country` (string)\n\n - `address.postal_code` (string)\n\n - `birthday` (string - date-time)\n\n - `birthdate` (string date-time)\n\n - `created_at` (date)\n\n - `source_id` (string)\n\n - `system.metadata` (json)\n\n - `system.metadata.source` (string)\n\n - `system.metadata.consents.unsubscribed` (boolean)\n\n - `loyalty_points` (json)\n\n - `loyalty` (json)\n\n - `summary.orders.total_amount` (json)\n\n - `summary.orders.last_order_date` (date)\n\n - `summary.orders.last_order_amount` (json)\n\n - `summary.redemptions.gift.redeemed_amount` (integer)\n\n - `summary.redemptions.total_succeeded` (integer)\n\n - `events.cart_abandoned.last_occurred` (integer)\n\n - `events.newsletter_subscribed.count` (integer)\n\n - `events.sign_up.last_occurred` (integer)" - } - } - }, - "16_obj_export_points_expiration": { - "description": "List of available fields and filters that can be exported with points expirations along with the sorting order of the returned data.", - "title": "points expiration", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" + }, + "8_req_update_earning_rule": { + "description": "Request body schema for updating earning rules using **PUT** `/loyalties/{campaignId}/earning-rules/{earningRuleId}` endpoint.", + "title": "Update Earning Rule Request Body", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_order_paid" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_tier" + } ] - ], - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" - } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `campaign_id`\n\n - `voucher_id`", - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_points_expiration_campaign_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_points_expiration_voucher_id" + }, + "8_res_list_earning_rules": { + "description": "Response body schema for listing earning rules using **GET** `/loyalties/{campaignId}/earning-rules` endpoint.", + "type": "object", + "title": "List Earning Rules Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "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/8_obj_earning_rule_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } } - ] - } - } - }, - "16_obj_export_gift_card_transactions": { - "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.", - "title": "gift card transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "items": { - "type": "string" - } - }, - "filters": { - "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id" - } - } - }, - "16_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", - "title": "loyalty card transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" - } - }, - "filters": { - "$ref": "#/components/schemas/16_obj_filter_loyalty_card_transactions_voucher_id" - } - } - }, - "16_obj_filter_publication_failure_code": { - "description": "Filter conditions set on the publication `failure_code`. Available options are:\n\n - `not_found`,\n\n - `no_voucher_suitable_for_publication`\n\n - `voucher_already_published`\n\n - `duplicate_source_id`\n\n - `too_many_vouchers_requested`", - "title": "Filter by failure code", - "type": "object", - "properties": { - "failure_code": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_result": { - "description": "Filter conditions set on the publication `result`. Available options are:\n\n - `SUCCESS`\n\n - `FAILURE`", - "title": "Filter by result", - "type": "object", - "properties": { - "result": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_customer_id": { - "description": "Filter conditions set on the publication `customer_id`.", - "title": "Filter by customer ID", - "type": "object", - "properties": { - "customer_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_campaign_name": { - "description": "Filter conditions set on the publication `campaign_name`.", - "title": "Filter by campaign name", - "type": "object", - "properties": { - "campaign_name": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_voucher_type": { - "description": "Filter conditions set on the publication `voucher_type`.", - "title": "Filter by voucher type", - "type": "object", - "properties": { - "voucher_type": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_is_referral_code": { - "description": "Filter conditions set on the publication `is_referral_code`.", - "title": "Filter if the code is a referral code", - "type": "object", - "properties": { - "is_referral_code": { - "$ref": "#/components/schemas/16_filter_conditions_boolean" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_parent_object_id": { - "description": "Filter conditions set on the publication `parent_object_id`, which is the parent campaigns unique ID assigned by Voucherify.", - "title": "Filter by parent object ID", - "type": "object", - "properties": { - "parent_object_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_related_object_id": { - "description": "Filter conditions set on the publication `related_object_id`.", - "title": "Filter by related object ID", - "type": "object", - "properties": { - "related_object_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_source_id": { - "description": "Filter conditions set on the publication `source_id`.", - "title": "Filter by publication source ID", - "type": "object", - "properties": { - "source_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_status": { - "description": "Filter conditions set on the order `status`.", - "title": "Filter by status", - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_source_id": { - "description": "Filter conditions set on the order `source_id`.", - "title": "Filter by order source ID", - "type": "object", - "properties": { - "source_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_amount": { - "description": "Filter conditions set on the order `amount`.", - "title": "Filter by order amount", - "type": "object", - "properties": { - "amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_total_amount": { - "description": "Filter conditions set on the order `total_amount`.", - "title": "Filter by order total amount", - "type": "object", - "properties": { - "total_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_discount_amount": { - "description": "Filter conditions set on the order `discount_amount`.", - "title": "Filter by order discount amount", - "type": "object", - "properties": { - "discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_total_discount_amount": { - "description": "Filter conditions set on the order `total_discount_amount`.", - "title": "Filter by order total discount amount", - "type": "object", - "properties": { - "total_discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_items_discount_amount": { - "description": "Filter conditions set on the order `items_discount_amount`.", - "title": "Filter by order items discount amount", - "type": "object", - "properties": { - "items_discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_points_expiration_campaign_id": { - "description": "Filter conditions set on`the `campaign_id`.", - "title": "Filter by campaign ID", - "type": "object", - "properties": { - "campaign_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_points_expiration_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_gift_card_transactions_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_loyalty_card_transactions_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_filter_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.", - "title": "Logical Operator Between Filters", - "type": "string", - "enum": [ - "AND", - "OR" - ] - }, - "16_filter_conditions_string": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", + }, + "8_req_add_remove_points_balance": { + "title": "Add or Remove Points Balance Request Body", + "type": "object", + "description": "Request schema for adding or removing points from a loyalty card.", + "properties": { + "points": { + "type": "integer", + "description": "Incremental balance to be added to/subtracted from the loyalty card. \n\nTo add points: `100` \nTo subtract points, add a minus: `-100`" + }, + "expiration_type": { + "type": "string", + "default": "PROGRAM_RULES", + "enum": [ + "PROGRAM_RULES", + "NON_EXPIRING", + "CUSTOM_DATE" + ], + "description": "Set the type of expiration for added points. \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", + "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`.", + "example": "2020-05-30" + }, + "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." + } + } + }, + "8_res_add_remove_points_balance": { + "description": "Response schema for adding or removing points from a loyalty card.", + "type": "object", + "title": "Add or Remove Loyalty Card Balance Response Body", + "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", + "description": "The balance after adding/removing points." + }, + "type": { + "type": "string", + "description": "The type of voucher being modified.", + "default": "loyalty_card" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `balance`.", + "default": "balance" + }, + "related_object": { + "type": "object", + "description": "Defines the object that is being modified with the values that are returned in the balance object.", + "properties": { + "type": { + "type": "string", + "description": "The object being modified.", + "default": "voucher" + }, + "id": { + "type": "string", + "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + } + } + } + } + }, + "8_req_transfer_loyalty_points": { + "description": "Request body schema for transferring points from a loyalty card.", + "type": "array", + "title": "Transfer Loyalty Points Request Body", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source).", + "example": "L-CARD-02hgnq4" + }, + "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).", + "example": 2 + }, + "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." + } + } + } + }, + "8_req_redeem_reward": { + "description": "Request body schema for redeeming a reward.", + "type": "object", + "title": "Redeem Reward Request Body", + "properties": { + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward if the reward is a pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", + "example": "rew_eSi4eYJk7o3tOycvweicR2z7" + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card." + } + } + }, + "order": { + "$ref": "#/components/schemas/8_req_order_object_redeem_reward", + "description": "Order object that is **required** when redeeming a pay with points reward." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "8_req_order_object_redeem_reward": { + "type": "object", + "title": "Order object", + "description": "Request body schema for creating an order, **required** when redeeming a pay with points reward.", + "properties": { + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + } + } + }, + "8_res_redeem_reward": { + "description": "Response body schema for redeeming a reward.", + "title": "Redeem Reward Response Body", + "$ref": "#/components/schemas/8_obj_redemption_object_loyalty_card_extended" + }, + "8_obj_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher lifecycle. A customer can redeem a voucher once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } + } + } + } + }, + "8_res_loyalties_campaign_id_tiers_tier_id_earning_rules": { + "type": "object", + "properties": { + "object": { + "type": "string" + }, + "data_ref": { "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "null" + }, + "validation_rule_id": { + "type": "null" + }, + "loyalty": { + "type": "object", + "properties": { + "points": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + }, + "event": { + "type": "string" + }, + "source": { + "type": "object", + "properties": { + "banner": { + "type": "string" + }, + "object_id": { + "type": "string" + }, + "object_type": { + "type": "string" + } + } + }, + "active": { + "type": "boolean" + }, + "object": { + "type": "string" + }, + "automation_id": { + "type": "string" + }, + "custom_event": { + "type": "object", + "properties": { + "schema_id": { + "type": "string" + } + } + } + } + } + }, + "total": { + "type": "integer" } }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", + "title": "List Loyalty Tier Earning Rules" + }, + "8_res_loyalties_campaign_id_tiers_tier_id_rewards": { + "title": "List Loyalty Tier Rewards", + "type": "object", + "properties": { + "id": { "type": "string" } }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`." + }, + "8_res_loyalties_campaign_id_reward-assignments_assignment_id": { + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}`", + "title": "Get Reward Assignment", + "properties": { + "id": { + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" + }, + "reward_id": { + "type": "string", + "example": "rew_JhjeISE1npQyxRmGV1JYohDP" + }, + "related_object_id": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "related_object_type": { + "type": "string", + "example": "campaign" + }, + "created_at": { + "type": "string", + "example": "2021-12-13T11:58:32.261Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-01-13T11:58:32.261Z", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "reward_assignment" + } } - } - } - } - }, - "16_filter_conditions_number": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "integer" + }, + "8_res_loyalties_campaign_id_reward-assignments_assignment_id_reward": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "parameters": { + "type": "object", + "properties": { + "coin": { + "type": "object", + "properties": { + "exchange_ratio": { + "type": "number" + }, + "points_ratio": { + "type": "integer" + } + } + } + } + }, + "stock": { + "type": "null" + }, + "redeemed": { + "type": "null" + }, + "attributes": { + "type": "object", + "properties": {} + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "null", + "format": "date-time" + }, + "object": { + "type": "string" } }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "integer" + "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}/`", + "title": "Get Reward Details" + }, + "8_obj_export_object_points_expiration": { + "title": "Points Expirations Export Object", + "type": "object", + "description": "This is an object representing an export of points expirations. ", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the export." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Status of the export. Informs you whether the export has already been completed.", + "enum": [ + "SCHEDULED", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "enum": [ + "API", + "WEBSITE" + ] + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "enum": [ + "points_expiration" + ] + }, + "parameters": { + "type": "object", + "description": "List of fields and filters that were passed in the request body to create the export.", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combination of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_filter_campaign_id" + }, + { + "$ref": "#/components/schemas/8_req_filter_voucher_id" + } + ] + } + } + }, + "result": { + "type": "object", + "description": "Contains the URL of the CSV file.", + "properties": { + "url": { + "type": "string", + "description": "URL of the CSV file location." + } + } + }, + "user_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr", + "description": " The user_id identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`." + } + } + }, + "8_req_export_points_expirations": { + "title": "Points Expirations Export Request Body", + "type": "object", + "description": "Request body schema for creating points expirations. ", + "properties": { + "parameters": { + "type": "object", + "description": "List of fields and filters that were passed in the request body to create the export.", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_filter_campaign_id" + }, + { + "$ref": "#/components/schemas/8_req_filter_voucher_id" + } + ] + } + } + } + } + }, + "8_req_filter_campaign_id": { + "title": "Filter by campaign ID", + "type": "object", + "description": "Filter conditions set on the campaign ID.", + "properties": { + "campaign_id": { + "$ref": "#/components/schemas/8_req_filter_conditions" + }, + "junction": { + "type": "string", + "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.", + "enum": [ + "AND", + "OR" + ] + } + } + }, + "8_req_filter_voucher_id": { + "title": "Filter by voucher ID", + "type": "object", + "description": "Filter conditions set on the voucher ID.", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/8_req_filter_conditions" + }, + "junction": { + "type": "string", + "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.", + "enum": [ + "AND", + "OR" + ] + } + } + }, + "8_req_filter_junction": { + "title": "Filter by campaign ID", + "type": "object", + "description": "Filter conditions by campaign ID.", + "properties": { + "junction": { + "type": "string", + "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." + } + } + }, + "8_req_filter_conditions": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results.", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results.", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Specify the exact resource value." + }, + "$is_not": { + "type": "string", + "description": "Results should omit this value." + } + } + } + } + }, + "8_res_list_reward_assignments": { + "title": "List Reward Assignments", + "type": "object", + "description": "Response body schema for **GET** `/loyalties/{campaignId}/rewards`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty reward assignments in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of reward assignment objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of reward assignment objects.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of reward assignment objects." + } + } + }, + "8_res_list_loyalty_tiers": { + "title": "List Loyalty Tiers", + "type": "object", + "description": "Response body schema for listing loyalty tiers for a campaign using **GET** `/loyalties/{campaignId}/tiers`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + } + }, + "8_res_get_member_loyalty_tier": { + "title": "Get Member's Loyalty Tier Response Body", + "type": "object", + "description": "Response body schema for retrieving a member's loyalty tier for a campaign using **GET** `/loyalties/members/{memberId}/tiers`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object_member" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tiers." + } + } + }, + "8_req_create_reward_assignment": { + "title": "Create Reward Assignment Request Body", + "type": "array", + "description": "Request body schema for **POST** `/loyalties/{campaignId}/rewards`.", + "items": { + "type": "object", + "properties": { + "reward": { + "type": "string", + "example": "rew_2yGflHThU2yJwFECEFKrXBI2", + "description": "Unique reward ID." + }, + "parameters": { + "type": "object", + "description": "An object that defines the price of the reward in loyalty points.", + "properties": { + "loyalty": { + "type": "object", + "description": "Stores the points parameter.", + "properties": { + "points": { + "type": "integer", + "description": "Defines how many points are required to obtain the reward." + } + } + } + } + } + } + } + }, + "8_res_create_reward_assignment": { + "title": "Create Reward Assignment Response Body", + "type": "array", + "description": "Response body schema for **POST** `/loyalties/{campaignId}/rewards`.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "8_req_update_reward_assignment": { + "title": "Update Reward Assignment Request Body", + "type": "object", + "description": "Request body schema for **PUT** `/loyalties/{campaignId}/rewards/{assignmentId}`.", + "properties": { + "parameters": { + "type": "object", + "description": "An object that defines the price of the reward in loyalty points.", + "properties": { + "loyalty": { + "type": "object", + "description": "Stores the points parameter.", + "properties": { + "points": { + "type": "integer", + "description": "Defines how many points are required to obtain the reward." + } + } + } + } + } + } + }, + "8_res_list_loyalty_tier_earning_rules": { + "title": "List Loyalty Tier Earning Rules", + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty tier earning rules in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty tier earning rule objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier earning rules.", + "items": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + } + }, + "8_res_list_loyalty_tier_rewards": { + "title": "List Loyalty Tier Rewards", + "type": "object", + "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty tier rewards in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty tier reward objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier reward objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier reward objects." + } + } + }, + "8_res_list_members": { + "title": "List Members", + "type": "object", + "description": "Response body schema for **GET** `/loyalties/{campaignId}/members`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about members in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "vouchers", + "description": "Identifies the name of the attribute that contains the array of voucher objects." + }, + "vouchers": { + "type": "array", + "description": "Contains array of voucher objects representing loyalty cards, in other words, loyalty program members.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } + }, + "total": { + "type": "integer", + "description": "Total number of voucher objects." + } + } + }, + "8_req_add_member": { + "title": "Add Member Request Body", + "type": "object", + "description": "Request body schema for assigning a loyalty card to a customer using **POST** `/loyalties/{campaignId}/members`.", + "properties": { + "voucher": { + "type": "string", + "description": "Specify the loyalty card code that you would like to publish to a customer." + }, + "channel": { + "type": "string", + "description": "Specify the distribution channel." + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_customer_id_string" + }, + { + "$ref": "#/components/schemas/8_req_customer_id" + }, + { + "$ref": "#/components/schemas/8_req_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "metadata": { + "type": "string", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." } - }, - "$is": { - "type": "integer", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "integer", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$more_than": { - "type": "integer", - "description": "Value is more than the specified number." - }, - "$more_than_equal": { - "type": "integer", - "description": "Value is more than or equal to the specified number." - }, - "$less_than": { - "type": "integer", - "description": "Value is less than the specified number." - }, - "$less_than_equal": { - "type": "integer", - "description": "Value is less than or equal to the specified number." } - } - } - } - }, - "16_filter_conditions_array": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" + }, + "8_req_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer." } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" + } + }, + "8_req_customer_id_string": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify or the source ID.", + "type": "string" + }, + "8_req_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - }, - "$count": { - "type": "integer", - "description": "Value has exactly this number of elements." - }, - "$count_less": { - "type": "integer", - "description": "Value has less than this number of elements." - }, - "$count_more": { - "type": "integer", - "description": "Value has more than this number of elements." - }, - "$contains": { - "type": "string", - "description": "Array contains this element." } - } - } - } - }, - "16_filter_conditions_boolean": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." + }, + "8_res_get_member_activities": { + "title": "Get Member Activities", + "type": "object", + "description": "Response body schema for retrieving member activities.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about member activities in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "activities", + "description": "Identifies the name of the attribute that contains the array of event objects." + }, + "activities": { + "type": "array", + "description": "Contains array of event objects.", + "items": {} + }, + "total": { + "type": "integer", + "description": "Total number of event objects." + } } - } - } - } - }, - "16_filter_conditions_date": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$after": { - "type": "string", - "description": "Value is after this date. Value for this parameter is in ISO 8601 format." - }, - "$before": { - "type": "string", - "description": "Value is before this date. Value for this parameter is in ISO 8601 format." - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." + }, + "8_res_list_member_rewards": { + "title": "List Member Rewards", + "type": "object", + "description": "Response body schema for `/loyalties/members/{memberId}/rewards`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about member rewards in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty reward objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty reward objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty reward objects." + } } - } - } - } - }, - "16_filter_conditions_date_time": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$after": { - "type": "string", - "description": "Value is after this date. Value for this parameter is in ISO 8601 format.", - "format": "date-time" - }, - "$before": { - "type": "string", - "description": "Value is before this date. Value for this parameter is in ISO 8601 format.", - "format": "date-time" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." + }, + "8_res_get_points_expiration": { + "title": "Get Points Expiration Response Body", + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/members/{memberId}/points-expiration`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of loyalty points expiration buckets.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_points_bucket" + } + }, + "total": { + "type": "integer", + "description": "Total number of point expiration buckets." + } } - } - } - } - }, - "17_obj_async_action_object": { - "title": "Async Action Object", - "type": "object", - "description": "This is an object representing an asynchronous action.", - "x-tags": [ - "ASYNC ACTIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "aa_0adad13d6f057f088e", - "description": "Async action unique ID." - }, - "type": { - "type": "string", - "description": "Type of async action.", - "enum": [ - "CAMPAIGN.VOUCHERS_IMPORT", - "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "CAMPAIGN.VOUCHERS_UPDATE", - "CAMPAIGN.VOUCHERS_DELETE", - "CAMPAIGN.VOUCHERS_GENERATE", - "CAMPAIGNS.METADATA_KEY_PURGE", - "CUSTOMERS.IMPORT_CSV", - "CUSTOMERS.BULK_UPDATE", - "CUSTOMERS.METADATA_UPDATE", - "CUSTOMERS.METADATA_KEY_PURGE", - "PRODUCTS.BULK_UPDATE", - "PRODUCTS.METADATA_UPDATE", - "PRODUCTS.METADATA_KEY_PURGE", - "PRODUCTS.IMPORT_CSV", - "SKUS.IMPORT_CSV", - "VOUCHERS.IMPORT", - "VOUCHERS.IMPORT_CSV", - "VOUCHERS.BULK_UPDATE", - "VOUCHERS.METADATA_UPDATE", - "VOUCHERS.METADATA_KEY_PURGE", - "ORDERS.IMPORT", - "ORDERS.METADATA_KEY_PURGE" - ] - }, - "status": { - "type": "string", - "description": "Status of async action. Informs you whether the async action has already been completed.", - "enum": [ - "ENQUEUED", - "IN_PROGRESS", - "DONE", - "FAILED" - ] - }, - "result": { - "anyOf": [ - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_delete" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_generate" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_skus_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_metadata_key_purge" + }, + "9_req_create_customer": { + "type": "object", + "title": "Customer", + "description": "This is an object containing information about the customer.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service. \n\nPlease note that if you would like your data to sync based on the `source_id` of the customer, you need to define the `source_id` upfront. You will not be able to change or update the `source_id` later on." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } } - ] - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", - "example": "2022-06-23T11:21:45.578Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-06-23T11:21:46.795Z", - "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", - "format": "date-time" - }, - "request_id": { - "type": "string", - "example": "v-0b45cee140c3c9b5ca", - "description": "Unique request ID." - }, - "processing_time": { - "type": "integer", - "example": 1217, - "description": "The length of time it took to process the request in milliseconds." - }, - "progress": { - "type": "integer", - "description": "% progress to completion of the asynchronous action.", - "minimum": 0, - "maximum": 100 - }, - "object": { - "type": "string", - "default": "async_action", - "description": "The type of object represented by JSON. This object stores information about the `async_action`." - } - } - }, - "17_res_list_async_actions_GET": { - "description": "Response body schema for listing asynchronous actions. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action.\n\n| **Types by Context** |\n|:---|\n| **CAMPAIGN** |\n| CAMPAIGN.VOUCHERS_IMPORT
CAMPAIGN.VOUCHERS_IMPORT_CSV
CAMPAIGN.VOUCHERS_UPDATE
CAMPAIGN.VOUCHERS_DELETE
CAMPAIGN.VOUCHERS_GENERATE |\n| **CUSTOMERS** |\n| CUSTOMERS.IMPORT_CSV
CUSTOMERS.BULK_UPDATE
CUSTOMERS.METADATA_UPDATE
CUSTOMERS.METADATA_KEY_PURGE |\n| **PRODUCTS** |\n| PRODUCTS.BULK_UPDATE
PRODUCTS.METADATA_UPDATE
PRODUCTS.METADATA_KEY_PURGE
PRODUCTS.IMPORT_CSV
SKUS.IMPORT_CSV |\n| **VOUCHERS** |\n| VOUCHERS.IMPORT
VOUCHERS.IMPORT_CSV
VOUCHERS.BULK_UPDATE
VOUCHERS.METADATA_UPDATE
VOUCHERS.METADATA_KEY_PURGE |", - "type": "object", - "examples": [ - { - "object": "list", - "data_ref": "async_actions", - "async_actions": [ - { - "id": "aa_0ae2af6a38161f8c79", - "type": "CAMPAIGN.VOUCHERS_DELETE", - "status": "DONE", - "created_at": "2022-04-07T11:34:39.072Z", - "object": "async_action" - }, - { - "id": "aa_0ae27a55b696a4e0f0", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "created_at": "2022-04-07T07:42:44.442Z", - "object": "async_action" - }, - { - "id": "aa_0adad13d6f057f088e", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "created_at": "2022-04-01T08:54:35.196Z", - "object": "async_action" - }, - { - "id": "aa_0adacc81de057f084c", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "created_at": "2022-04-01T08:33:54.552Z", - "object": "async_action" + }, + "9_req_update_customer": { + "type": "object", + "title": "Customer object", + "description": "This is an object containing information about the customer.", + "properties": { + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } } - ] - } - ], - "title": "List Async Actions Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about asynchronous actions.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "async_actions", - "description": "Identifies the name of the JSON property that contains the array of asynchronous actions." - }, - "async_actions": { - "type": "array", - "description": "An array of async actions.", - "items": { + }, + "9_obj_customer_object": { "type": "object", - "additionalProperties": false, - "description": "Contains an async action definition.", + "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", + "title": "Customer Object", + "examples": [ + { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", + "source_id": "08dd9b5a", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "address": { + "city": "New York", + "state": "NY", + "line_1": "678 Main St", + "line_2": null, + "country": "USA", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 5, + "total_failed": 0, + "total_succeeded": 5, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 830 + } + }, + "orders": { + "total_amount": 94600, + "total_count": 5, + "average_amount": 18920, + "last_order_amount": 27500, + "last_order_date": "2022-09-15T11:11:36.630Z" + } + }, + "loyalty": { + "points": 830, + "referred_customers": 0, + "campaigns": { + "Loyalty Campaign - Webinar": { + "points": 830, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "age": 24, + "loyalty_customer": "true", + "acquisition_channel": "Facebook" + }, + "system_metadata": { + "consents": { + "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { + "date": "2022-11-22T15:48:50.219Z", + "value": true + } + } + }, + "created_at": "2022-09-15T10:33:46.388Z", + "updated_at": "2022-11-22T15:48:50.220Z", + "assets": { + "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" + }, + "object": "customer" + } + ], + "x-tags": [ + "CUSTOMERS API" + ], "properties": { "id": { "type": "string", - "description": "Async action unique ID.", - "example": "aa_0ae2af6a38161f8c79" + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_CSnYd37MXmrbS19XCrghjBsv" }, - "type": { + "source_id": { "type": "string", - "description": "Type of async action.", - "enum": [ - "CAMPAIGN.VOUCHERS_IMPORT", - "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "CAMPAIGN.VOUCHERS_UPDATE", - "CAMPAIGN.VOUCHERS_DELETE", - "CAMPAIGN.VOUCHERS_GENERATE", - "CUSTOMERS.IMPORT_CSV", - "CUSTOMERS.BULK_UPDATE", - "CUSTOMERS.METADATA_UPDATE", - "CUSTOMERS.METADATA_KEY_PURGE", - "PRODUCTS.BULK_UPDATE", - "PRODUCTS.METADATA_UPDATE", - "PRODUCTS.METADATA_KEY_PURGE", - "PRODUCTS.IMPORT_CSV", - "SKUS.IMPORT_CSV", - "VOUCHERS.IMPORT", - "VOUCHERS.IMPORT_CSV", - "VOUCHERS.BULK_UPDATE", - "VOUCHERS.METADATA_UPDATE", - "VOUCHERS.METADATA_KEY_PURGE" - ] + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service." }, - "status": { + "name": { "type": "string", - "description": "Status of async action. Informs you whether the async action has already been completed.", - "enum": [ - "ENQUEUED", - "IN_PROGRESS", - "DONE", - "FAILED" - ] + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate." + }, + "birthday": { + "type": "string", + "description": "Customer's birthday." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "summary": { + "type": "object", + "description": "Contains a summary of customer's redemption and order statistics.", + "properties": { + "redemptions": { + "type": "object", + "description": "Customer's redemptions statistics.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Total number of redemptions made by the customer." + }, + "total_failed": { + "type": "integer", + "description": "Total number of redemptions that failed." + }, + "total_succeeded": { + "type": "integer", + "description": "Total number of redemptions that succeeded." + }, + "total_rolled_back": { + "type": "integer", + "description": "Total number of redemptions that were rolled back for the customer." + }, + "total_rollback_failed": { + "type": "integer", + "description": "Total number of redemption rollbacks that failed." + }, + "total_rollback_succeeded": { + "type": "integer", + "description": "Total number of redemption rollbacks that succeeded." + }, + "gift": { + "type": "object", + "description": "Summary of gift card credits.", + "properties": { + "redeemed_amount": { + "type": "integer", + "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "amount_to_go": { + "type": "integer", + "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "loyalty_card": { + "type": "object", + "description": "Summary of loyalty points.", + "properties": { + "redeemed_points": { + "type": "integer", + "description": "Total number of loyalty points redeemed by the customer." + }, + "points_to_go": { + "type": "integer", + "description": "Sum of remaining available point balance across all loyalty cards." + } + } + } + } + }, + "orders": { + "type": "object", + "description": "Customer's order statistics.", + "properties": { + "total_amount": { + "type": "integer", + "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "total_count": { + "type": "integer", + "description": "Total number of orders made by the customer." + }, + "average_amount": { + "type": "integer", + "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_amount": { + "type": "integer", + "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_date": { + "type": "string", + "format": "date-time", + "example": "2022-08-30T11:51:08.029Z", + "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." + } + } + } + } + }, + "loyalty": { + "type": "object", + "description": "Summary of customer's loyalty information.", + "properties": { + "points": { + "type": "integer", + "description": "Sum of remaining available point balance across all loyalty cards." + }, + "referred_customers": { + "type": "integer", + "description": "Total number of customers referred by the customer." + }, + "campaigns": { + "type": "object", + "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", + "properties": { + "campaign_name": { + "type": "object", + "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", + "properties": { + "points": { + "type": "integer", + "description": "Remaining point balance in campaign." + }, + "loyalty_tier": { + "type": "string", + "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", + "description": "Customer's loyalty tier within the campaign." + }, + "referred_customers": { + "type": "integer", + "description": "Number of customers referred by the customer in campaign." + } + } + } + } + } + } + }, + "referrals": { + "type": "object", + "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", + "properties": { + "total": { + "type": "integer", + "description": "Total number of times this customer received a referral, i.e. was referred by another customer." + }, + "campaigns": { + "type": "array", + "description": "Contains an array of campaigns that served as the source of a referral for the customer.", + "items": { + "type": "object", + "description": "Contains information about the source of the referral.", + "properties": { + "campaign_id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_rRsfatlwN7unSeUIJDCYedal" + }, + "referrer_id": { + "type": "string", + "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + }, + "related_object_id": { + "type": "string", + "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." + }, + "related_object_type": { + "type": "string", + "description": "Related object type, i.e. `redemption`." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-08-30T10:19:39.196Z", + "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "system_metadata": { + "type": "object", + "description": "Object used to store system metadata information.", + "properties": { + "consents": { + "type": "object", + "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", + "properties": { + "consentId": { + "type": "object", + "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", + "example": "2022-05-10T08:50:10.338Z", + "format": "date-time" + }, + "value": { + "type": "boolean", + "description": "Accepted: `true`, Rejected: `false`" + } + } + } + } + }, + "source": { + "type": "string", + "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." + } + } }, "created_at": { "type": "string", - "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", - "example": "2022-04-07T07:42:44.442Z", + "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", + "example": "2022-08-30T06:32:07.380Z", "format": "date-time" }, "updated_at": { "type": "string", - "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", - "example": "2022-06-22T07:58:21.703Z", + "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", + "example": "2022-08-31T06:32:07.380Z", "format": "date-time" }, - "request_id": { - "type": "string", - "example": "v-0ba50a7feb4998490", - "description": "Unique request ID." - }, - "progress": { - "type": "integer", - "minimum": 0, - "maximum": 100, - "description": "% progress to completion of the asynchronous action." + "assets": { + "type": "object", + "description": "Contains information about the customer's cockpit.", + "properties": { + "cockpit_url": { + "type": "string", + "description": "Customer's cockpit URL address." + } + } }, "object": { "type": "string", - "default": "async_action", - "description": "The type of object represented by each nested object in the JSON async_actions array. This object stores information about the `async_action`." + "description": "The type of object represented by the JSON. This object stores information about the customer.", + "default": "customer" } } - } - } - } - }, - "17_res_obj_get_async_action_result_message": { - "title": "Message", - "type": "object", - "description": "Result schema with message.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - } - } - }, - "17_res_obj_get_async_action_result_message_failed": { - "title": "Message with Failed Array", - "type": "object", - "description": "Result schema with message and failed array.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": {} - } - } - }, - "17_res_obj_get_async_action_result_code_updated_found": { - "title": "Code Updated and Found", - "type": "object", - "description": "Result schema with an array of code, updated, and found parameters.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "9_obj_customer_object_email_parameter": { "type": "object", + "description": "This is an object representing a customer.", + "title": "Customer Object", + "examples": [ + { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", + "source_id": "08dd9b5a", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "address": { + "city": "New York", + "state": "NY", + "line_1": "678 Main St", + "line_2": null, + "country": "USA", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 5, + "total_failed": 0, + "total_succeeded": 5, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 830 + } + }, + "orders": { + "total_amount": 94600, + "total_count": 5, + "average_amount": 18920, + "last_order_amount": 27500, + "last_order_date": "2022-09-15T11:11:36.630Z" + } + }, + "loyalty": { + "points": 830, + "referred_customers": 0, + "campaigns": { + "Loyalty Campaign - Webinar": { + "points": 830, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "age": 24, + "loyalty_customer": "true", + "acquisition_channel": "Facebook" + }, + "system_metadata": { + "consents": { + "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { + "date": "2022-11-22T15:48:50.219Z", + "value": true + } + } + }, + "created_at": "2022-09-15T10:33:46.388Z", + "updated_at": "2022-11-22T15:48:50.220Z", + "assets": { + "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" + }, + "object": "customer" + } + ], + "x-tags": [ + "CUSTOMERS API" + ], "properties": { - "code": { + "id": { "type": "string", - "description": "Unique voucher code." + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_CSnYd37MXmrbS19XCrghjBsv" }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_import": { - "title": "CAMPAIGN.VOUCHERS_IMPORT", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "code": { + "name": { "type": "string", - "description": "Unique voucher code." + "description": "Customer's first and last name." }, - "reason": { + "description": { "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_import_csv": { - "title": "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "code": { + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { "type": "string", - "description": "Unique voucher code." + "description": "Customer's email address." }, - "row": { - "type": "integer", - "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." + "phone": { + "type": "string", + "description": "Customer's phone number." }, - "reason": { + "birthdate": { "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_update": { - "title": "CAMPAIGN.VOUCHERS_UPDATE", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_UPDATE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_delete": { - "title": "CAMPAIGN.VOUCHERS_DELETE", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_DELETE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_generate": { - "title": "CAMPAIGN.VOUCHERS_GENERATE", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_GENERATE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_campaign_metadata_key_purge": { - "title": "CAMPAIGNS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a CAMPAIGNS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_import_csv": { - "title": "CUSTOMERS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a CUSTOMERS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "source_id": { + "description": "Customer's birthdate." + }, + "birthday": { "type": "string", - "description": "Unique customer ID from your inventory system as indicated in the CSV file." + "description": "Customer's birthday." }, - "row": { - "type": "integer", - "description": "The CSV file row number where the customer is recorded. The row counter excludes the file headers row." + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } }, - "reason": { + "summary": { + "type": "object", + "description": "Contains a summary of customer's redemption and order statistics.", + "properties": { + "redemptions": { + "type": "object", + "description": "Customer's redemptions statistics.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Total number of redemptions made by the customer." + }, + "total_failed": { + "type": "integer", + "description": "Total number of redemptions that failed." + }, + "total_succeeded": { + "type": "integer", + "description": "Total number of redemptions that succeeded." + }, + "total_rolled_back": { + "type": "integer", + "description": "Total number of redemptions that were rolled back for the customer." + }, + "total_rollback_failed": { + "type": "integer", + "description": "Total number of redemption rollbacks that failed." + }, + "total_rollback_succeeded": { + "type": "integer", + "description": "Total number of redemption rollbacks that succeeded." + }, + "gift": { + "type": "object", + "description": "Summary of gift card credits.", + "properties": { + "redeemed_amount": { + "type": "integer", + "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "amount_to_go": { + "type": "integer", + "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "loyalty_card": { + "type": "object", + "description": "Summary of loyalty points.", + "properties": { + "redeemed_points": { + "type": "integer", + "description": "Total number of loyalty points redeemed by the customer." + }, + "points_to_go": { + "type": "integer", + "description": "Sum of remaining available point balance accross all loyalty cards." + } + } + } + } + }, + "orders": { + "type": "object", + "description": "Customer's order statistics.", + "properties": { + "total_amount": { + "type": "integer", + "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "total_count": { + "type": "integer", + "description": "Total number of orders made by the customer." + }, + "average_amount": { + "type": "integer", + "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_amount": { + "type": "integer", + "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_date": { + "type": "string", + "example": "2022-08-30T11:51:08.029Z", + "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." + } + } + } + } + }, + "loyalty": { + "type": "object", + "description": "Summary of customer's loyalty information.", + "properties": { + "points": { + "type": "integer" + }, + "referred_customers": { + "type": "integer", + "description": "Total number of customers referred by the customer." + }, + "campaigns": { + "type": "object", + "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", + "properties": { + "campaign_name": { + "type": "object", + "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", + "properties": { + "points": { + "type": "integer", + "description": "Remaining point balance in campaign." + }, + "loyalty_tier": { + "type": "string", + "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", + "description": "Customer's loyalty tier within the campaign." + }, + "referred_customers": { + "type": "integer", + "description": "Number of customers referred by the customer in campaign." + } + } + } + } + } + } + }, + "referrals": { + "type": "object", + "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", + "properties": { + "total": { + "type": "integer", + "description": "Total number of times this customer received a referral, i.e. was referred by another customer." + }, + "campaigns": { + "type": "array", + "description": "Contains an array of campaigns that served as the source of a referral for the customer.", + "items": { + "type": "object", + "description": "Contains information about the source of the referral.", + "properties": { + "campaign_id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_rRsfatlwN7unSeUIJDCYedal" + }, + "referrer_id": { + "type": "string", + "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + }, + "related_object_id": { + "type": "string", + "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." + }, + "related_object_type": { + "type": "string", + "description": "Related object type, i.e. `redemption`." + }, + "date": { + "type": "string", + "example": "2022-08-30T10:19:39.196Z", + "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "system_metadata": { + "type": "object", + "description": "Object used to store system metadata information.", + "properties": { + "consents": { + "type": "object", + "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", + "properties": { + "consentId": { + "type": "object", + "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", + "example": "2022-05-10T08:50:10.338Z", + "format": "date-time" + }, + "value": { + "type": "boolean", + "description": "Accepted: `true`, Rejected: `false`" + } + } + } + } + }, + "source": { + "type": "string", + "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." + } + } + }, + "created_at": { "type": "string", - "description": "Detailed failure cause for the customer import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_customers_bulk_update": { - "title": "CUSTOMERS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a CUSTOMERS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "source_id": { + "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", + "example": "2022-08-30T06:32:07.380Z", + "format": "date-time" + }, + "updated_at": { "type": "string", - "description": "Unique customer `source_id`." + "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", + "example": "2022-08-31T06:32:07.380Z", + "format": "date-time" }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "assets": { + "type": "object", + "description": "Contains information about the customer's cockpit.", + "properties": { + "cockpit_url": { + "type": "string", + "description": "Customer's cockpit URL address." + } + } }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the customer.", + "default": "customer" + }, + "email_unsubscribed": { + "type": "boolean" } } - } - }, - "done_count": { - "type": "integer", - "description": "Number or resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_metadata_update": { - "title": "CUSTOMERS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a CUSTOMERS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "9_res_list_customers": { "type": "object", + "title": "List Customers Response Body", + "description": "Response body schema for **GET** `/customers`.", "properties": { - "source_id": { + "object": { "type": "string", - "description": "Unique customer `source_id`." + "default": "list", + "description": "The type of object represented by JSON. This object stores information about customers in a dictionary." }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "data_ref": { + "type": "string", + "default": "customers", + "description": "Identifies the name of the attribute that contains the array of customer objects." }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." + "customers": { + "type": "array", + "description": "Contains array of customer objects.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of customers." } } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_metadata_key_purge": { - "title": "CUSTOMERS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a CUSTOMERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_bulk_update": { - "title": "PRODUCTS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a PRODUCTS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "9_res_list_customer_activities": { "type": "object", + "title": "List Customer Activities Response Body", + "description": "Request body schema for `/customers/{customerId}/activities`.", "properties": { - "source_id": { + "object": { "type": "string", - "description": "Unique product `source_id`." + "default": "list", + "description": "The type of object represented by JSON. This object stores information about customer activities in a dictionary." }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of customer activity objects." }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." + "data": { + "type": "array", + "description": "Array of customer activity objects.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_activity_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of customer activities." } } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_metadata_update": { - "title": "PRODUCTS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a PRODUCTS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "22_obj_webhooks": { "type": "object", + "title": "Webhooks", + "description": "Data object model for a webhook.\n\n\nredemption.succeeded \nredemption.failed \nredemption.rollback.succeeded \nredemption.rollback.failed \npublication.succeeded \nvoucher.published \nvoucher.updated \nvoucher.deleted \nvoucher.created \nVoucher.enabled \nvoucher.disabled \nvoucher.loyalty_card.points_added \nvoucher.gift.balance_added \ncampaign.enabled \ncampaign.deleted \ncampaign.created \ncampaign.updated \ncampaign.disabled \ncampaign.vouchers.generation.completed \nbusiness_validation_rule.assignment.created \nbusiness_validation_rule.assignment.deleted \nbusiness_validation_rule.created \nbusiness_validation_rule.deleted \nbusiness_validation_rule.updated \ncustomer.created \ncustomer.deleted \ncustomer.rewarded \ncustomer.rewarded.loyalty_points \ncustomer.consents.revoked \ncustomer.consents.given ", + "x-tags": [ + "WEBHOOKS" + ], "properties": { - "source_id": { + "id": { "type": "string", - "description": "Unique product `source_id`." + "example": "event_m7MXf3zPf1n51IoUM8XHpP0w", + "description": "Unique event ID." }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "object": { + "type": "string", + "default": "event", + "description": "The type of object represented by JSON. This object stores information about events in a dictionary." }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." + "webhook_id": { + "type": "string", + "example": "wh_K7hpwSVDmKaxmBsDn0EpCvDy", + "description": "Unique webhook ID." + }, + "project_id": { + "type": "string", + "example": "proj_z7id5", + "description": "Unique Voucherify project ID." + }, + "created_at": { + "type": "string", + "example": "2022-11-30T16:53:30.434Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the webhook was created in ISO 8601 format." + }, + "type": { + "type": "string", + "enum": [ + "redemption.succeeded", + "redemption.failed", + "redemption.rollback.succeeded", + "redemption.rollback.failed", + "publication.succeeded", + "voucher.published", + "voucher.updated", + "voucher.deleted", + "voucher.created", + "Voucher.enabled", + "voucher.disabled", + "voucher.loyalty_card.points_added", + "voucher.gift.balance_added", + "campaign.enabled", + "campaign.deleted", + "campaign.created", + "campaign.updated", + "campaign.disabled", + "campaign.vouchers.generation.completed", + "business_validation_rule.assignment.created", + "business_validation_rule.assignment.deleted", + "business_validation_rule.created", + "business_validation_rule.deleted", + "business_validation_rule.updated", + "customer.created", + "customer.deleted", + "customer.rewarded", + "customer.rewarded.loyalty_points", + "customer.consents.revoked", + "customer.consents.given" + ] + }, + "data": { + "$ref": "#/components/schemas/22_obj_webhook_object_data" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a webhook. The metadata object stores all custom attributes assigned to the webhook. It can be useful for storing additional information about the webhook in a structured format.", + "properties": { + "source": { + "type": "string", + "description": "The origin of the webhook.", + "enum": [ + "API" + ] + } + } } } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_metadata_key_purge": { - "title": "PRODUCTS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a PRODUCTS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources updated successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_import_csv": { - "title": "PRODUCTS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a PRODUCTS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "description": "Contains the details regarding a CSV file line item failed import.", - "properties": { - "row": { - "type": "integer", - "description": "The CSV file row number where the product definition is recorded. The row counter excludes the file headers row." + }, + "22_obj_webhook_object_data": { + "title": "Webhook Object", + "description": "Webhook event data object schema.", + "anyOf": [ + { + "$ref": "#/components/schemas/22_obj_event_redemption_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_failed" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_rollback_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_rollback_failed" + }, + { + "$ref": "#/components/schemas/22_obj_event_publication_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_published" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_enabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_disabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_loyalty_card_points_added" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_gift_balance_added" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_enabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_disabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_vouchers_generation_completed" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_deleted" }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the product import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_skus_import_csv": { - "title": "SKUS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a SKUS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result.", - "example": "2 sku(s) imported successfully, 6 failed." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "description": "Contains the details regarding a CSV file line item failed import.", - "properties": { - "row": { - "type": "integer", - "description": "The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.", - "example": 2 + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_created" }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the SKU import.", - "example": "Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]" + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_rewarded" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_rewarded_loyalty_points" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_consents_given" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_consents_revoked" } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_import": { - "title": "VOUCHERS.IMPORT", - "type": "object", - "description": "Result schema for a VOUCHERS.IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "description": "If any records failed during the process, this array shows the failure details.", - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_import_csv": { - "title": "VOUCHERS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a VOUCHERS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { + ] + }, + "22_obj_event_redemption_succeeded": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `redemption.succeeded`.", + "type": "object" + }, + "22_obj_event_redemption_failed": { + "title": "Redemption Failed", + "description": "Event data object schema for `redemption.failed`.", + "type": "object" + }, + "22_obj_event_redemption_rollback_failed": { + "title": "Redemption Rollback Failed", + "description": "Event data object schema for `redemption.rollback.failed`.", + "type": "object" + }, + "22_obj_event_redemption_rollback_succeeded": { + "title": "Redemption Rollback Succeeded", + "description": "Event data object schema for `redemption.rollback.succeeded`.", + "type": "object" + }, + "22_obj_event_publication_succeeded": { + "title": "Publication Succeeded", + "description": "Event data object schema for `publication.succeeded`.", + "type": "object" + }, + "22_obj_event_voucher_published": { + "title": "Voucher Published", + "description": "Event data object schema for `voucher.published`.", + "type": "object" + }, + "22_obj_event_voucher_updated": { + "title": "Voucher Updated", + "description": "Event data object schema for `voucher.updated`.", + "type": "object" + }, + "22_obj_event_voucher_deleted": { + "title": "Voucher Deleted", + "description": "Event data object schema for `voucher.deleted`.", + "type": "object" + }, + "22_obj_event_voucher_created": { + "title": "Voucher Created", + "description": "Event data object schema for `voucher.created`.", + "type": "object" + }, + "22_obj_event_voucher_enabled": { + "title": "Voucher Enabled", + "description": "Event data object schema for `voucher.enabled`.", + "type": "object" + }, + "22_obj_event_voucher_disabled": { + "title": "Voucher Disabled", + "description": "Event data object schema for `voucher.disabled`.", + "type": "object" + }, + "22_obj_event_voucher_loyalty_card_points_added": { + "title": "Voucher Loyalty Card Points Added", + "description": "Event data object schema for `voucher.loyalty_card.points_added`.", "type": "object", "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." + "object": { + "$ref": "#/components/schemas/1_obj_voucher_object" }, - "row": { - "type": "integer", - "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." + "related_object": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object" } } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_bulk_update": { - "title": "VOUCHERS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a VOUCHERS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "22_obj_event_voucher_gift_balance_added": { + "title": "Voucher Gift Balance Added", + "description": "Event data object schema for `voucher.gift.balance_added`.", + "type": "object" + }, + "22_obj_event_campaign_enabled": { + "title": "Campaign Enabled", + "description": "Event data object schema for `campaign.enabled`.", + "type": "object" + }, + "22_obj_event_campaign_deleted": { + "title": "Campaign Deleted", + "description": "Event data object schema for `campaign.deleted`.", "type": "object", "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "object": { + "$ref": "#/components/schemas/2_obj_campaign_object" }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." + "campaign": { + "$ref": "#/components/schemas/2_obj_campaign_object" } } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_metadata_update": { - "title": "VOUCHERS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a VOUCHERS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { + }, + "22_obj_event_campaign_created": { + "title": "Campaign Created", + "description": "Event data object schema for `campaign.created`.", + "type": "object" + }, + "22_obj_event_campaign_updated": { + "title": "Campaign Updated", + "description": "Event data object schema for `campaign.updated`.", + "type": "object" + }, + "22_obj_event_campaign_disabled": { + "title": "Campaign Disabled", + "description": "Event data object schema for `campaign.disabled`.", + "type": "object" + }, + "22_obj_event_campaign_vouchers_generation_completed": { + "title": "Campaign Vouchers Generation Completed", + "description": "Event data object schema for `campaign.vouchers.generation.completed`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_assignment_created": { + "title": "Business Validation Rule Assignment Created", + "description": "Event data object schema for `business_validation_rule.assignment.created`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_assignment_deleted": { + "title": "Business Validation Rule Assignment Deleted", + "description": "Event data object schema for `business_validation_rule.assignment.deleted`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_created": { + "title": "Business Validation Rule Created", + "description": "Event data object schema for `business_validation_rule.created`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_deleted": { + "title": "Business Validation Rule Deleted", + "description": "Event data object schema for `business_validation_rule.deleted`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_updated": { + "title": "Business Validation Rule Updated", + "description": "Event data object schema for `business_validation_rule.updated`.", + "type": "object" + }, + "22_obj_event_customer_created": { + "title": "Customer Created", + "description": "Event data object schema for `customer.created`.", + "type": "object" + }, + "22_obj_event_customer_deleted": { + "title": "Customer Deleted", + "description": "Event data object schema for `customer.deleted`.", + "type": "object" + }, + "22_obj_event_customer_rewarded": { + "title": "Customer Rewarded", + "description": "Event data object schema for `customer.rewarded`.", + "type": "object" + }, + "22_obj_event_customer_rewarded_loyalty_points": { + "title": "Customer Rewarded Loyalty Points", + "description": "Event data object schema for `customer.rewarded.loyalty_points`.", "type": "object", "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." + "object": { + "$ref": "#/components/schemas/9_obj_customer_object" }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_metadata_key_purge": { - "title": "VOUCHERS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a VOUCHERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_orders_import": { - "title": "ORDERS.IMPORT", - "type": "object", - "description": "Result schema for a ORDERS.IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "description": "If any records failed during the process, this array shows the failure details.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique order source ID." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_orders_metadata_key_purge": { - "title": "ORDERS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a ORDERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "18_res_list_consents_GET": { - "description": "Response body schema for listing consents.", - "type": "object", - "examples": [ - { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" + "related_object": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" - } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object" }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" - } - ], - "total": 2 - } - } - ], - "title": "List Consents Response Body", - "properties": { - "groups": { - "type": "object", - "description": "Contains marketing permission groups' definitions.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "Stores information about marketing permission groups." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of marketing permission groups." - }, - "data": { - "type": "array", - "description": "An array of marketing permission groups.", - "items": { + "voucher": { "type": "object", - "additionalProperties": false, - "description": "Contains a marketing permission group's definition.", "properties": { "id": { - "type": "string", - "example": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "description": "Unique group ID." - }, - "name": { - "type": "string", - "description": "Marketing permission group name." + "type": "string" }, - "description": { - "type": "string", - "description": "Marketing permission group category." + "code": { + "type": "string" }, - "consents": { - "type": "array", - "description": "List of consents that are assigned to the group.", - "items": { - "type": "string" + "loyalty_card": { + "type": "object", + "properties": { + "points": { + "type": "integer" + }, + "balance": { + "type": "integer" + } } }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-04-13T09:12:47.743Z", - "description": "Timestamp representing the date and time when the group was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-05-14T09:11:27.037Z", - "description": "Timestamp representing the date and time when the group was updated in ISO 8601 format." - }, - "object": { - "type": "string", - "default": "consent_group", - "description": "Stores information about a marketing permission group." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of groups." - } - } - }, - "consents": { - "type": "object", - "description": "Contains opt-in consents' definitions.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "Stores information about opt-in consents." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of opt-in consents." - }, - "data": { - "type": "array", - "description": "An array of consents.", - "items": { - "type": "object", - "additionalProperties": false, - "description": "Contains an opt-in consent definition.", - "properties": { - "id": { - "type": "string", - "example": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "description": "Unique consent ID." - }, - "name": { - "type": "string", - "description": "Consent name." - }, - "description": { + "type": { "type": "string", - "description": "Consent description." + "default": "LOYALTY_CARD" }, - "category": { - "type": "string", - "description": "Consent category." + "campaign": { + "type": "string" }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-04-13T09:11:27.037Z", - "description": "Timestamp representing the date and time when the consent was created in ISO 8601 format." + "campaign_id": { + "type": "string" }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-05-14T09:11:27.037Z", - "description": "Timestamp representing the date and time when the consent was updated in ISO 8601 format." + "is_referral_code": { + "type": "boolean" }, - "object": { + "holder_id": { "type": "string", - "default": "consent", - "description": "Stores information about an opt-in consent." + "example": "cust_o3ffuQSwM0vlxeJJoMqiOLMI" } } + }, + "campaign": { + "type": "string" + }, + "earning_rule": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" } - }, - "total": { - "type": "integer", - "description": "Total number of consents." } - } - } - } - }, - "20_res_list_categories": { - "type": "object", - "title": "List Categories Response Body", - "description": "Response schema for **GET** `/categories`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about categories in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of category objects.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of categories." - } - } - }, - "20_obj_category_object": { - "type": "object", - "title": "Category Object", - "description": "This is an object representing a category.", - "x-tags": [ - "CATEGORIES API" - ], - "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", - "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", - "example": "2022-07-14T10:45:13.156Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-16T10:52:08.094Z", - "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "category", - "description": "The type of object represented by the JSON. This object stores information about the category." - } - }, - "examples": [ - { - "id": "cat_0b60cfe7d0d7ddbb55", - "name": "Update", - "hierarchy": 1, - "created_at": "2022-07-14T10:45:13.156Z", - "updated_at": "2022-08-16T11:03:54.727Z", - "object": "category" - } - ] - }, - "20_req_update_categories_categoryId": { - "type": "object", - "title": "Update Category Request Body", - "description": "Request schema for updating a category using **PUT** `/categories/{categoryId}`.", - "properties": { - "name": { - "type": "string", - "description": "Category name." - }, - "hierarchy": { - "type": "integer", - "description": "Category hierarchy." - } - }, - "required": [ - "name", - "hierarchy" - ] - }, - "20_req_create_category": { - "type": "object", - "title": "Create Category Request Body", - "description": "Request schema for creating a category using **POST** `/categories`.", - "properties": { - "name": { - "type": "string", - "description": "Category name." - }, - "hierarchy": { - "type": "integer", - "description": "Category hierarchy." - } - }, - "required": [ - "name", - "hierarchy" - ] - }, - "20_res_create_category": { - "type": "object", - "title": "Category Object", - "description": "This is an object representing a newly created 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", - "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", - "example": "2022-07-14T10:45:13.156Z", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "category", - "description": "The type of object represented by the JSON. This object stores information about the category." - } - } - }, - "21_obj_metadata_schema_object": { - "type": "object", - "title": "Metadata Schema Object", - "description": "This is an object representing a metadata schema.", - "properties": { - "id": { - "type": "string", - "description": "Unique metadata schema ID.", - "example": "ms_OF36L2rk4EqhdxvZs56IW9iE" - }, - "related_object": { - "type": "string", - "description": "The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.", - "enum": [ - "campaign", - "customer", - "earning_rule", - "loyalty_tier", - "order", - "order_item", - "product", - "promotion_tier", - "publication", - "redemption", - "reward", - "voucher" - ] - }, - "properties": { - "description": "Contains the metadata definitions. There can be many properties within this object.", - "anyOf": [ - { - "properties": { - "custom_property_name": { - "type": "object", - "description": "Custom property name. This is defined in **Project Settings** > **Metadata Schema** in the Dashboard.", - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "object", - "date", - "datetime", - "geopoint", - "boolean", - "image_url" - ] - }, - "array": { - "type": "boolean", - "description": "Indicates whether the definition is an array." - }, - "optional": { - "type": "boolean", - "description": "Indicates whether this definition is optional or not optional for the resource." - }, - "objectType": { - "type": [ - "string", - "null" - ], - "description": "Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object." - }, - "eq": { - "type": "array", - "description": "Array of possible values when the setting for `is equal to any of` in the Dashboard is defined explicitly.", - "items": {} - }, - "ne": { - "type": "array", - "description": "Array of values that are not allowed when the setting for `is not equal to any of` in the Dashboard is defined explicitly.", - "items": {} - }, - "lt": { - "type": "integer", - "description": "A property of `number` type must have `less than` this value." - }, - "lte": { - "type": "integer", - "description": "A property of `number` type must be `less than or equal` to this value." - }, - "gt": { - "type": "integer", - "description": "A property of `number` type must be `greater than` this value." - }, - "gte": { - "type": "integer", - "description": "A property of `number` type must be `greater than or equal` to this value." - }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the definition was deleted from the schema." - }, - "maxLength": { - "type": "integer", - "description": "Value for maximum length when the setting for `has maximum length of` in the Dashboard is defined explicitly." - }, - "minLength": { - "type": "integer", - "description": "Value indicating minimum length when the setting for `has minimum length of` in the Dashboard is defined explicitly." - }, - "exactLength": { - "type": "integer", - "description": "Value indicating exact length when the setting for `has exact length of` in the Dashboard is defined explicitly." - } - } + }, + "22_obj_event_customer_consents_revoked": { + "title": "Customer Consents Revoked", + "description": "Event data object schema for `customer.consents.revoked`.", + "type": "object" + }, + "22_obj_event_customer_consents_given": { + "title": "Customer Consents Given", + "description": "Event data object schema for `customer.consents.given`.", + "type": "object" + }, + "9_obj_customer_activity_object": { + "type": "object", + "title": "Customer Activity Object", + "description": "This is an object representing customer activity. \n\nThis is a general object which presents moments from customers' activity. There are all types of different events that customers perform during their journey once they participate in Promotions. Events describe moments when customers redeem coupons and earn points or rewards. The list of all types of activities is listed below.\n\nThe details describing the activity are collected in a property named `data`. In this object, software integrators will find all further information explaining the event context. \n\nCustomer Activity Object is a type of [Event](ref:track-custom-event) which is our way of letting you know when something interesting happens in your project. When an interesting event concerning an individual customer occurs, we create a new Customer Activity object. For example, when a code is published to a customer, we create a `customer.publication.succeeded` event.\n\n| **Event types (definition in progress)** |\n|:---|\n| customer.confirmed |\n| customer.created |\n| customer.updated |\n| customer.deleted |\n| customer.referred |\n| customer.custom_event |\n| customer.segment.entered |\n| customer.segment.left |\n| customer.sms.sent |\n| customer.sms.failed |\n| customer.email.sent |\n| customer.email.failed |\n| customer.activecampaign.sent |\n| customer.activecampaign.failed |\n| customer.braze.sent |\n| customer.braze.failed |\n| customer.mailchimp.sent |\n| customer.mailchimp.failed |\n| customer.intercom.sent |\n| customer.intercom.failed |\n| customer.rewarded |\n| customer.rewarded.loyalty_points |\n| customer.voucher.gift.balance_added |\n| customer.voucher.loyalty_card.points_added |\n| customer.voucher.loyalty_card.points_transferred |\n| customer.publication.succeeded |\n| customer.publication.failed |\n| customer.redemption.succeeded |\n| customer.redemption.failed |\n| customer.redemption.rollback.succeeded |\n| customer.redemption.rollback.failed |\n| customer.consents.given |\n| customer.consents.revoked |", + "x-tags": [ + "CUSTOMERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique event ID, assigned by Voucherify.", + "example": "evcus_0c150c51730c6b60b1" + }, + "type": { + "type": "string", + "description": "Event type.", + "enum": [ + "customer.confirmed", + "customer.created", + "customer.updated", + "customer.deleted", + "customer.referred", + "customer.custom_event", + "customer.segment_entered", + "customer.segment.left", + "customer.sms.sent", + "customer.sms.failed", + "customer.email.sent", + "customer.email.failed", + "customer.activecampaign.sent", + "customer.braze.sent", + "customer.mailchimp.sent", + "customer.intercom.sent", + "customer.intercom.failed", + "customer.rewarded", + "customer.rewarded.loyalty_points", + "customer.voucher.gift.balance_added", + "customer.voucher.loyalty_card.points_added", + "customer.voucher.loyalty_card.points_transferred", + "customer.publication.succeeded", + "customer.publication.failed", + "customer.redemption.succeeded", + "customer.redemption.failed", + "customer.redemption.rollback.succeeded", + "customer.redemption.rollback.failed", + "customer.consents.given", + "customer.consents.revoked" + ] + }, + "data": { + "type": "array", + "description": "Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data" } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.", + "example": "2022-08-30T09:14:07.660Z", + "format": "date-time" + } + } + }, + "9_obj_customer_activity_object_data": { + "title": "Customer Activity Data Object", + "description": "Event data object schema.", + "anyOf": [ + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_confirmed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_created" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_updated" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_deleted" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_referred" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_custom_event" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_entered" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_left" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded_loyalty_points" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_given" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_revoked" + } + ] + }, + "9_obj_customer_activity_object_data_customer_email_unsubscribed": { + "title": "Email Unsubscribed", + "description": "Email unsubscribed", + "type": "object", + "properties": { + "email_unsubscribed": { + "type": "boolean" } } - ], - "type": "object" - }, - "allow_defined_only": { - "type": "boolean", - "description": "Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.\t" - }, - "created_at": { - "type": "string", - "example": "2021-12-03T13:33:44.556Z", - "description": "Timestamp representing the date and time when the metadata schema was created in ISO 8601 format.\t", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-11T08:05:30.695Z", - "description": "Timestamp representing the date and time when the metadata schema was updated in ISO 8601 format.\t", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "metadata_schema", - "description": "The type of object represented by the JSON. This object stores information about the metadata schema." - } - }, - "x-tags": [ - "METADATA SCHEMAS API" - ], - "examples": [ - { - "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", - "related_object": "earning_rule", - "properties": { - "channel_id": { - "type": "string", - "array": true, - "optional": true, - "objectType": null, - "exactLength": 5 - }, - "channel_name": { - "eq": [ - "instagram", - "facebook", - "google", - "twitter", - "linkedin", - "website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + }, + "9_obj_customer_activity_object_data_customer_confirmed": { + "title": "Customer Confirmed", + "description": "Event data object schema for `customer.confirmed`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + }, + "unconfirmed_customer": { + "type": "string", + "example": "ucust_1qa70mVfYkl11Ab0ZxDPdWNa" + } } }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:09:59.970Z", - "updated_at": "2022-08-25T13:11:15.704Z", - "object": "metadata_schema" - }, - { - "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", - "related_object": "campaign", - "properties": { - "region": { - "eq": [ - "EMEA", - "AMER", - "APAC" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_created": { + "title": "Customer Created", + "description": "Event data object schema for `customer.created`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } } }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:12:58.447Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "age": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "city_id": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_updated": { + "title": "Customer Updated", + "description": "Event data object schema for `customer.updated`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } } }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.889Z", - "updated_at": "2022-09-12T07:34:49.163Z", - "object": "metadata_schema" - }, - { - "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", - "related_object": "loyalty_tier", - "properties": { - "level_name": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "audience_restricted": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_deleted": { + "title": "Customer Deleted", + "description": "Event data object schema for `customer.deleted`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } } }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:14:54.954Z", - "updated_at": "2022-08-25T13:15:24.436Z", - "object": "metadata_schema" - }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "card": { - "eq": [ - "Visa", - "MasterCard", - "Other" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "currency": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "ne": [ - 1, - 2, - 18, - 22 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "store_city": { - "eq": [ - "Hampden", - "San Francisco", - "Warsaw" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_referred": { + "title": "Customer Referred", + "description": "Event data object schema for `customer.referred`.", + "type": "object", + "properties": { + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "referrer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "custom_event": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:47.575Z", - "updated_at": "2022-10-25T10:05:18.978Z", - "object": "metadata_schema" - }, - { - "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", - "related_object": "order_item", - "properties": { - "manufacturer_id": { - "gte": 15, - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:03.167Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "vendor": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "category": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_custom_event": { + "title": "Custom Event", + "description": "Event data object schema for `customer.custom_event`.", + "type": "object", + "properties": { + "event": { + "type": "object" + }, + "loyalty": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "referral": { + "type": "object" + }, + "event_schema": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.298Z", - "updated_at": "2022-07-14T15:53:29.226Z", - "object": "metadata_schema" - }, - { - "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", - "related_object": "promotion_tier", - "properties": { - "level": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_segment_entered": { + "title": "Segment Entered", + "description": "Event data object schema for `customer.segment.entered`.", + "type": "object", + "properties": { + "segment": { + "type": "object" + }, + "customer": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:04.937Z", - "updated_at": "2022-09-23T08:51:46.266Z", - "object": "metadata_schema" - }, - { - "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", - "related_object": "publication", - "properties": { - "file_uploaded": { - "type": "image_url", - "array": false, - "optional": true, - "objectType": null - }, - "publication_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_segment_left": { + "title": "Segment Left", + "description": "Event data object schema for `customer.segment.left`.", + "type": "object", + "properties": { + "segment": { + "type": "object" + }, + "customer": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:35.534Z", - "updated_at": "2022-09-12T10:26:31.135Z", - "object": "metadata_schema" - }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "redemption_location": { - "type": "object", - "array": false, - "optional": true, - "objectType": "Location" + "9_obj_customer_activity_object_data_customer_sms_sent": { + "title": "SMS Sent", + "description": "Event data object schema for `customer.sms.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_sms_failed": { + "title": "SMS Failed", + "description": "Event data object schema for `customer.sms.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_email_sent": { + "title": "Email Sent", + "description": "Event data object schema for `customer.email.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_email_failed": { + "title": "Email Failed", + "description": "Event data object schema for `customer.email.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_activecampaign_sent": { + "title": "ActiveCampaign Sent", + "description": "Event data object schema for `customer.activecampaign.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_activecampaign_failed": { + "title": "ActiveCampaign Failed", + "description": "Event data object schema for `customer.activecampaign.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_braze_sent": { + "title": "Braze Sent", + "description": "Event data object schema for `customer.braze.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_braze_failed": { + "title": "Braze Failed", + "description": "Event data object schema for `customer.braze.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_mailchimp_sent": { + "title": "Mailchimp Sent", + "description": "Event data object schema for `customer.mailchimp.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_mailchimp_failed": { + "title": "Mailchimp Failed", + "description": "Event data object schema for `customer.mailchimp.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_intercom_sent": { + "title": "Intercom Sent", + "description": "Event data object schema for `customer.intercom.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_intercom_failed": { + "title": "Intercom Failed", + "description": "Event data object schema for `customer.intercom.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_rewarded": { + "title": "Customer Rewarded", + "description": "Event data object schema for `customer.rewarded`.", + "type": "object", + "properties": { + "holder": { + "type": "object" + }, + "reward": { + "type": "object" + }, + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "custom_event": { + "type": "object" + }, + "referral_tier": { + "type": "object" + }, + "customer_event": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.794Z", - "updated_at": "2022-08-25T13:19:50.497Z", - "object": "metadata_schema" - }, - { - "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", - "related_object": "reward", - "properties": { - "reward_type": { - "eq": [ - "MATERIAL", - "PAY-WITH-POINTS", - "DISCOUNT-COUPON", - "GIFT-CARD-CREDITS", - "LOYALTY POINTS" - ], - "type": "string", - "array": false, - "optional": false, - "objectType": null + "9_obj_customer_activity_object_data_customer_rewarded_loyalty_points": { + "title": "Customer Rewarded Loyalty Points", + "description": "Event data object schema for `customer.rewarded.loyalty_points`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "earning_rule": { + "type": "object" + }, + "loyalty_tier": { + "type": "object" + } } }, - "allow_defined_only": true, - "created_at": "2022-08-25T13:07:13.689Z", - "updated_at": "2022-08-25T13:08:26.696Z", - "object": "metadata_schema" - }, - { - "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", - "related_object": "voucher", - "properties": { - "lang": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "marketing_text": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "ProductionVoucherCodeMetaData": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null + "9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added": { + "title": "Gift Voucher Balance Added", + "description": "Event data object schema for `customer.voucher.gift.balance_added`.", + "type": "object", + "properties": { + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:23.994Z", - "updated_at": "2022-09-19T14:13:30.590Z", - "object": "metadata_schema" - } - ] - }, - "21_res_list_metadata_shemas": { - "title": "List Metadata Schemas Response Body", - "type": "object", - "description": "Response schema for listing metadata schemas using **GET** `/metadata-schemas`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about metadata schemas in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", - "default": "schemas" - }, - "schemas": { - "type": "array", - "description": "Array of metadata schema objects.", - "items": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of metadata schemas." - } - }, - "examples": [ - { - "object": "list", - "data_ref": "schemas", - "schemas": [ - { - "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", - "related_object": "Payment", - "properties": { - "payment_tax": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "payment_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } + "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added": { + "title": "Loyalty Card Points Added", + "description": "Event data object schema for `customer.voucher.loyalty_card.points_added`.", + "type": "object", + "properties": { + "balance": { + "type": "object" }, - "allow_defined_only": true, - "created_at": "2022-03-07T11:01:01.747Z", - "updated_at": "2022-03-07T11:01:44.785Z", - "object": "metadata_schema" - }, - { - "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", - "related_object": "campaign", - "properties": { - "Store": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - }, - "locale": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_tag": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_time_tag": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "deleted": true, - "optional": true, - "objectType": null - }, - "height_customer_number": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_country_string": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } + "voucher": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2021-12-03T13:33:44.556Z", - "updated_at": "2022-07-26T13:57:42.288Z", - "object": "metadata_schema" - }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "birth_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "CRM_created_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "customer_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } + "campaign": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.894Z", - "updated_at": "2022-07-14T15:15:34.928Z", - "object": "metadata_schema" - }, - { - "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", - "related_object": "earning_rule", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "minLength": 6, - "objectType": null - } + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred": { + "title": "Loyalty Card Points Transferred", + "description": "Event data object schema for `customer.voucher.loyalty_card.points_transferred`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_publication_succeeded": { + "title": "Publication Succeeded", + "description": "Event data object schema for `customer.publication.succeeded`.", + "type": "object", + "properties": { + "campaign": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:54:07.980Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", - "related_object": "loyalty_tier", - "properties": { - "has_funds": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } + "customer": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:22:16.685Z", - "updated_at": "2022-07-27T08:55:01.628Z", - "object": "metadata_schema" - }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "Payment": { - "type": "object", - "array": false, - "deleted": true, - "optional": true, - "objectType": "Payment" - }, - "day_of_week": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "number_of_store_visits": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } + "publication": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_publication_failed": { + "title": "Publication Failed", + "description": "Event data object schema for `customer.publication.failed`.", + "type": "object", + "properties": { + "campaign": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.798Z", - "updated_at": "2022-04-20T06:47:10.350Z", - "object": "metadata_schema" - }, - { - "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", - "related_object": "order_item", - "properties": { - "Size": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "Color": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Thickness": { - "eq": [ - "Thin", - "Medium", - "Thick" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } + "customer": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-03-11T13:32:55.029Z", - "updated_at": "2022-05-23T13:46:01.463Z", - "object": "metadata_schema" - }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "color": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "origin": { - "type": "string", - "array": false, - "optional": true, - "minLength": 1, - "objectType": null - }, - "product_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_date_property": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_number_property": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_boolean_property": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_datetime_property": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } + "publication": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_succeeded": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `customer.redemption.succeeded`.", + "type": "object", + "properties": { + "order": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.880Z", - "updated_at": "2022-07-14T15:46:47.994Z", - "object": "metadata_schema" - }, - { - "id": "ms_th8YHt9yFYY1yAA99XOasT5W", - "related_object": "promotion_tier", - "properties": { - "has_budget": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } + "holder": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:21.523Z", - "updated_at": "2022-07-27T08:54:42.909Z", - "object": "metadata_schema" - }, - { - "id": "ms_Z7niydc0OpGjDRL4yB40niXn", - "related_object": "publication", - "properties": { - "year": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } + "voucher": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:23:49.715Z", - "updated_at": "2022-04-19T10:28:24.568Z", - "object": "metadata_schema" - }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } + "campaign": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.890Z", - "updated_at": "2022-07-26T14:58:24.546Z", - "object": "metadata_schema" - }, - { - "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", - "related_object": "reward", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "objectType": null, - "exactLength": 4 - } + "customer": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:53:32.257Z", - "updated_at": "2022-07-27T08:53:48.542Z", - "object": "metadata_schema" - }, - { - "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", - "related_object": "voucher", - "properties": { - "unit": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "Region": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "CATEGORY": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "active_on_calendar_month": { - "eq": [ - 1, - 2, - 3, - 5, - 7, - 9, - 10, - 11, - 12 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - } + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_failed": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `customer.redemption.failed`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded": { + "title": "Redemption Rollback Succeeded", + "description": "Event data object schema for `customer.redemption.rollback.succeeded`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:01.281Z", - "updated_at": "2022-06-22T07:22:09.577Z", - "object": "metadata_schema" + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + }, + "redemption_rollback": { + "type": "object" + } } - ], - "total": 13 - } - ] - }, - "22_res_list_locations": { - "title": "List Locations Response Body", - "type": "object", - "description": "Response schema for listing locations using **GET** `/locations`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about locations in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Array of location objects.", - "items": { - "$ref": "#/components/schemas/22_obj_location_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of locations." - }, - "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 end date filter) to get more records returned in the results." - } - }, - "examples": [ - { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } + }, + "9_obj_customer_activity_object_data_customer_redemption_rollback_failed": { + "title": "Redemption Rollback Failed", + "description": "Event data object schema for `customer.redemption.rollback.failed`.", + "type": "object", + "properties": { + "order": { + "type": "object" }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - }, - { - "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", - "object": "location", - "name": "New York", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - -74.016167, - 40.703186 - ], - [ - -74.008687, - 40.750656 - ], - [ - -73.943597, - 40.851838 - ], - [ - -73.928559, - 40.845285 - ], - [ - -73.936152, - 40.8356 - ], - [ - -73.934298, - 40.810015 - ], - [ - -73.92711, - 40.795145 - ], - [ - -73.978623, - 40.710432 - ], - [ - -74.013201, - 40.701619 - ], - [ - -74.016167, - 40.703186 - ] - ] - ] - } + "holder": { + "type": "object" }, - "created_at": "2022-07-15T05:37:45.299Z", - "updated_at": null - }, - { - "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", - "object": "location", - "name": "Germany", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:51.303908897065064,10.222253628401518", - "radius": "192.37 km" - } + "campaign": { + "type": "object" }, - "created_at": "2022-07-14T15:51:39.265Z", - "updated_at": null - }, - { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], - [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 - ] - ] - ] - } + "customer": { + "type": "object" }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null - } - ], - "total": 4, - "has_more": false - } - ] - }, - "22_obj_location_object": { - "title": "Location object", - "type": "object", - "description": "This is an object representing a location.", - "x-tags": [ - "LOCATIONS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique location ID, assigned by the Voucherify API.", - "example": "loc_NoMGXmHO9OUs7iz9mGWpamma" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about a `location`.", - "default": "location" - }, - "name": { - "type": "string", - "description": "Location name." - }, - "shape": { - "type": "object", - "description": "Defines the shape and boundaries of the location.", - "anyOf": [ - { - "$ref": "#/components/schemas/22_obj_location_object_shape_circle" - }, - { - "$ref": "#/components/schemas/22_obj_location_object_shape_polygon" + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + }, + "redemption_rollback": { + "type": "object" + } } - ] - }, - "created_at": { - "type": "string", - "example": "2022-02-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the location was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-03-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the location was updated in ISO 8601 format.", - "format": "date-time" - } - } - }, - "22_obj_location_object_shape_circle": { - "title": "Circle", - "type": "object", - "description": "This is an object representing a circular shape.", - "properties": { - "type": { - "type": "string", - "description": "The type of shape being defined is a `circle`.", - "default": "circle" - }, - "format": { - "type": "string", - "description": "The location is defined in terms of a `distance` object.", - "default": "distance" - }, - "distance": { - "type": "object", - "title": "Distance", - "description": "Defines the parameters for the circle.", - "properties": { - "center": { - "type": "string", - "description": "Center of the circle identified by GPS coordinates in decimal degrees.", - "example": "geo:40.79372699823857,-74.15092132694554" - }, - "radius": { - "type": "string", - "description": "Defines the radius of the circle." + }, + "9_obj_customer_activity_object_data_customer_consents_given": { + "title": "Consents Given", + "description": "Event data object schema for `customer.consents.given`.", + "type": "object", + "properties": { + "consents": { + "type": "object" + }, + "customer": { + "type": "object" + } } - } - } - } - }, - "22_obj_location_object_shape_polygon": { - "title": "Polygon", - "type": "object", - "description": "This is an object representing a polygon.", - "properties": { - "type": { - "type": "string", - "description": "The type of shape being defined is a `polygon`.", - "default": "polygon" - }, - "format": { - "type": "string", - "description": "The location is defined in terms of a `geojson` object.", - "default": "geojson" - }, - "distance": { - "type": "object", - "title": "Geojson", - "description": "Defines the parameters for the polygon.", - "properties": { - "type": { - "type": "string", - "description": "Type of geojson coordinates, i.e. `Polygon`.", - "default": "Polygon" - }, - "coordinates": { - "type": "array", - "description": "Contains array of GeoJSON coordinate arrays.", - "items": { - "$ref": "#/components/schemas/22_geojson_array" + }, + "9_obj_customer_activity_object_data_customer_consents_revoked": { + "title": "Consents Given", + "description": "Event data object schema for `customer.consents.revoked`.", + "type": "object", + "properties": { + "consents": { + "type": "object" + }, + "customer": { + "type": "object" } } - } - } - } - }, - "22_geojson_array": { - "title": "GeoJSON coordinate array.", - "type": "array", - "description": "GeoJSON coordinate array.", - "items": { - "$ref": "#/components/schemas/22_geojson_coordinates" - } - }, - "22_geojson_coordinates": { - "title": "GeoJSON coordinate.", - "type": "array", - "description": "GeoJSON coordinate.", - "items": { - "type": "integer" - } - }, - "22_filter_updated_at": { - "type": "object", - "title": "Updated at", - "properties": { - "updated_at": { - "$ref": "#/components/schemas/16_filter_conditions_date_time" - } - }, - "description": "A filter on the list based on the object `updated_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[updated_at][before]=2017-09-08T13:52:18.227Z`" - }, - "22_filter_created_at": { - "type": "object", - "title": "Created at", - "properties": { - "created_at": { - "$ref": "#/components/schemas/16_filter_conditions_date_time" - } - }, - "description": "A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`" - }, - "22_filter_name": { - "type": "object", - "title": "Name", - "properties": { - "name": { - "$ref": "#/components/schemas/16_filter_conditions_string" - } - }, - "description": "A filter on the list based on the name field." - }, - "22_filter_id": { - "type": "object", - "title": "ID", - "properties": { - "id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - } - }, - "description": "A filter on the list based on the id of the location." - }, - "23_obj_qualification_object": { - "title": "Qualification object", - "type": "object", - "description": "This is an object representing a qualification.", - "x-tags": [ - "QUALIFICATIONS API" - ], - "properties": { - "redeemables": { - "$ref": "#/components/schemas/23_obj_qualification_redeemables" - }, - "tracking_id": { - "type": "string", - "description": "This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID." - }, - "order": { - "type": "object", - "description": "The order object sent in the request.", - "$ref": "#/components/schemas/23_obj_order_object" - }, - "stacking_rules": { - "$ref": "#/components/schemas/23_obj_qualification_object_stacking_rules" - } - } - }, - "23_obj_order_object": { - "type": "object", - "title": "Order object", - "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", - "x-tags": [ - "ORDERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { + }, + "customers_permanent_deletion_response_body": { "type": "object", + "title": "Customer Permanent Deletion Response Body", + "description": "Response body schema for `/customers/{customerId}/permanent-deletion`.", "properties": { - "object": { + "id": { "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." + "description": "Unique permanent deletion object ID.", + "example": "del_mgzqZNwUnwnt1Ddw6phEG90Q" }, - "product_id": { + "created_at": { "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "example": "2022-09-02T17:55:47.865Z", + "description": "Timestamp representing the date and time when the customer was requested to be deleted in ISO 8601 format.", + "format": "date-time" }, - "sku_id": { + "related_object_id": { "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." + "example": "cust_m557pDDl4IGXexkU6KOQ2Dwi", + "description": "Unique customer ID that is being deleted." }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "related_object": { + "type": "string", + "description": "Object being deleted.", + "default": "customer" }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + "status": { + "type": "string", + "description": "Deletion status.", + "default": "DONE" }, - "product": { + "data_json": { "type": "object", - "description": "This object stores more information about the related product.", + "description": "Statistics summarizing the number of related information that was deleted.", + "required": [ + "events", + "customer_events", + "daily_events", + "segments", + "orders", + "order_events", + "customer" + ], "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." + "events": { + "type": "integer", + "description": "Number of events deleted." }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" + "customer_events": { + "type": "integer", + "description": "Number of customer events deleted." }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." + "daily_events": { + "type": "integer", + "description": "Number of daily events deleted." }, - "price": { + "segments": { "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "description": "Number of segments deleted." }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." + "orders": { + "type": "integer", + "description": "Number of orders deleted." }, - "sku": { - "type": "string", - "description": "SKU name." + "order_events": { + "type": "integer", + "description": "Number of order events deleted." }, - "price": { + "customer": { "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + "description": "Number of customers deleted.", + "default": 1 } } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "23_obj_qualification_object_stacking_rules": { - "type": "object", - "title": "Examine Qualification Stacking Rules", - "description": "Defines stacking rules for the redeemables.", - "properties": { - "redeemables_limit": { - "type": "integer", - "description": "Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is `30`.", - "default": 30 - }, - "applicable_redeemables_limit": { - "type": "integer", - "description": "Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is `5`.", - "default": 5 - } - } - }, - "23_req_create_qualification": { - "type": "object", - "title": "Examine Qualification Request Body", - "description": "Request body schema for examining a qualification`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/23_req_create_qualification_customer_id" - }, - { - "$ref": "#/components/schemas/23_req_create_qualification_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/23_req_create_qualification_order_id" - }, - { - "$ref": "#/components/schemas/23_req_create_qualification_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"redeemable\"] | - Returns the redeemables' metadata. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "items": { + }, + "object": { "type": "string", - "enum": [ - "redeemable", - "category" - ] + "description": "The type of object represented by JSON.", + "default": "pernament_deletion" } }, - "limit": { - "type": "integer", - "description": "The maximum number of redeemables to be returned in the API request. The actual number of returned redeemables will be determined by the API. The default value is set to 5, and the maximum value is 50.", - "maximum": 50 - }, - "starting_after": { - "type": "string", - "example": "2021-09-08T13:52:18.227Z", - "format": "date-time", - "description": "Curser used for paging." - }, - "filters": { - "description": "A set of fiters to return only a specific category or type of redeemable.", - "anyOf": [ - { - "$ref": "#/components/schemas/23_obj_filter_resource_type" - }, - { - "$ref": "#/components/schemas/23_obj_filter_category_id" - } - ] - } - } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "mode": { - "type": "string", - "description": "Defines which resources Voucherify will use. Currently, `BASIC` is supported." - }, - "scenario": { - "type": "string", - "description": "Defines the scenario Voucherify should consider during the qualification process.\n\n- `ALL` - Scenario that returns all redeemables available for the customer in one API request.\n- `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile.\n- `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only.\n- `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s).\n- `PROMOTION_STACKS` - returns the applicable promotion stacks.\n- `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s).", - "enum": [ - "ALL", - "CUSTOMER_WALLET", - "AUDIENCE_ONLY", - "PRODUCTS", - "PRODUCTS_DISCOUNT", - "PROMOTION_STACKS", - "PRODUCTS_BY_CUSTOMER", - "PRODUCTS_DISCOUNT_BY_CUSTOMER" - ] - } - } - }, - "23_req_create_qualification_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } - } - }, - "23_req_create_qualification_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } - } - }, - "23_req_create_qualification_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." - } - } - }, - "23_req_create_qualification_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption of this request." - } - } - }, - "23_obj_filter_resource_type": { - "description": "Filter conditions set on the resource `type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", - "title": "Filter by type", - "type": "object", - "properties": { - "resource_type": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "23_obj_filter_category_id": { - "description": "Filter conditions set on the resource `category_id`.", - "title": "Filter by category ID", - "type": "object", - "properties": { - "category_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "23_obj_qualification_redeemables": { - "title": "Redeemables", - "type": "object", - "description": "List or redeemables for examine qualification.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. Default is `list`." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of qualified redeemables." - }, - "data": { - "type": "array", - "description": "Array of qualified redeemables.", - "items": { - "allOf": [] - } - }, - "total": { - "type": "integer", - "example": 5, - "description": "The number of redeemables returned in the API request." - }, - "has_more": { - "type": "boolean", - "description": "As results are always limited, the `has_more` flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results." - } - } - }, - "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." - }, - "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": { + "required": [ + "id", + "created_at", + "related_object_id", + "related_object", + "status", + "data_json", + "object" + ] + }, + "customers_update_metadata_in_bulk_request_body": { "type": "object", + "title": "Update Customers' Metadata in bulk Request Body", + "description": "Request body schema for `/customers/metadata/async`.", + "properties": { + "source_ids": { + "type": "array", + "description": "An array of customer `source_id`'s.", + "items": { + "type": "string" + } + }, + "metadata": { + "type": "object", + "description": "Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + } + }, + "required": [ + "source_ids", + "metadata" + ] + }, + "customers_update_in_bulk_request_body": { + "type": "array", + "title": "Update Customers in bulk Request Body", + "description": "Request body schema for `/customers/bulk/async`.", + "items": { + "$ref": "#/components/schemas/customers_update_in_bulk_item_request_body" + } + }, + "customers_update_in_bulk_item_request_body": { + "title": "Update Customers in bulk Request Body", + "description": "Request body schema for `/customers/bulk/async`.", "properties": { - "id": { + "source_id": { "type": "string", - "description": "Unique loyalty points bucket ID." + "description": "Unique customer source ID." }, - "voucher_id": { - "type": "string", - "description": "Unique parent loyalty card ID." + "name": { + "type": [ + "string", + "null" + ], + "description": "Customer's first and last name." }, - "campaign_id": { - "type": "string", - "description": "\nUnique parent campaign ID." + "description": { + "type": [ + "string", + "null" + ], + "description": "An arbitrary string that you can attach to a customer object." }, - "bucket": { - "type": "object", - "required": [ - "total_points" + "email": { + "type": [ + "string", + "null" ], - "description": "Defines the number of points stored in the given loyalty points bucket.", + "description": "Customer's email address." + }, + "phone": { + "type": [ + "string", + "null" + ], + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", "properties": { - "total_points": { - "type": "integer", - "description": "Total number of points in the loyalty points bucket." + "city": { + "type": [ + "string", + "null" + ], + "description": "City" + }, + "state": { + "type": [ + "string", + "null" + ], + "description": "State" + }, + "line_1": { + "type": [ + "string", + "null" + ], + "description": "First line of address." + }, + "line_2": { + "type": [ + "string", + "null" + ], + "description": "Second line of address." + }, + "country": { + "type": [ + "string", + "null" + ], + "description": "Country." + }, + "postal_code": { + "type": [ + "string", + "null" + ], + "description": "Postal code." } } }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate; format `YYYY-MM-DD`." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } + }, + "required": [ + "source_id" + ] + }, + "9_req_update_customers_consents": { + "type": "object", + "title": "Update Customer Consents Request Body", + "description": "Request body schema for **PUT** `/customers/{customerId}/consents`.", + "properties": { + "consent_id": { + "type": "boolean", + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not." + }, + "unsubscribed": { + "type": "boolean", + "description": "To deny all consents, use `unsubscribed` as a consent identifier and `true` as a value." + } + } + }, + "10_obj_order_object": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", + "x-tags": [ + "ORDERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, "created_at": { "type": "string", - "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format.", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", "format": "date-time" }, "status": { "type": "string", - "description": "Loyalty points bucket point status." + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] }, - "expires_at": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." + } + } + }, + "customer_id": { "type": "string", - "format": "date-time", - "description": "Date when the number of points defined in the bucket object are due to expire." + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" }, - "updated_at": { + "referrer_id": { "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty points bucket object was updated in ISO 8601 format." + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." }, "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." + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "oneOf": [ + { + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" + }, + { + "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" + } + ] } - }, - "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": [ - { - "$ref": "#/components/schemas/EarningRuleBase" - }, - { - "type": "object", - "properties": { - "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", - "default": true, - "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." - } - }, - "required": [ - "updated_at", - "active" - ] - } - ] - }, - "LoyaltiesDisableEarningRulesResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" - }, - { - "type": "object", - "properties": { - "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", - "default": false, - "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." - } - }, - "required": [ - "updated_at", - "active" - ] - } - ] - }, - "EarningRuleBase": { - "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format." - }, - "loyalty": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleFixed" - }, - { - "$ref": "#/components/schemas/EarningRuleProportional" - } - ] - }, - "event": { - "$ref": "#/components/schemas/EarningRuleEvent", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card." - }, - "custom_event": { - "type": "object", - "properties": { - "schema_id": { - "type": "string" - } - }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - }, - "required": [ - "id" - ] - }, - "source": { - "type": "object", - "required": [ - "object_id", - "object_type" - ], - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", - "enum": [ - "campaign" - ] - } - } - }, - "object": { - "type": "string", - "enum": [ - "earning_rule" - ], - "description": "The type of object represented by JSON. Default is earning_rule." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify." - }, - "start_date": { - "type": "string", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." } }, - "required": [ - "duration", - "interval" - ] - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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 - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - }, - "required": [ - "id", - "created_at", - "loyalty", - "source", - "object", - "automation_id", - "metadata" - ] - }, - "EarningRuleEvent": { - "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged", - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left" - ] - }, - "EarningRuleFixed": { - "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "FIXED" - ], - "description": "The number of points to be added to the loyalty card." - }, - "points": { - "type": "integer", - "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." - } - } - }, - "EarningRuleProportionalOrder": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" - } - ], - "title": "Order" - }, - "EarningRuleProportionalOrderAmount": { - "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_AMOUNT" - ], - "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" - }, - "order": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderTotalAmount": { - "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_TOTAL_AMOUNT" - ], - "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" - }, - "order": { - "type": "object", - "required": [ - "total_amount" - ], - "properties": { - "total_amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + "10_obj_order_object_no_discount_calculations": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique identifier that represents the product or SKU from your inventory system." + }, + "related_object": { + "type": "string", + "description": "Reference to the object containing details of the related product. This can either be a `product` or `sku`.", + "enum": [ + "product", + "sku" + ] + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + } } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderMetadata": { - "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_METADATA" - ], - "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" - }, - "order": { - "type": "object", - "required": [ - "metadata" - ], - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the order metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "Order metadata property." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderItemsQuantity": { - "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_QUANTITY" - ], - "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" - }, - "order_items": { - "type": "object", - "required": [ - "quantity" - ], - "properties": { - "quantity": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." + } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalOrderItemsAmount": { - "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_AMOUNT" - ], - "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" - }, - "order_items": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + }, + "10_obj_order_object_unstacked_redemptions": { + "type": "object", + "title": "Unstacked Redemption", + "description": "Redemption object representing a single redemption.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "enum": [ + "voucher", + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the related object that defines the incentive." + }, + "related_object_parent_id": { + "type": "string", + "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign." + } } } } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalOrderItemsSubtotalAmount": { - "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_SUBTOTAL_AMOUNT" - ], - "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)" - }, - "order_items": { - "type": "object", - "required": [ - "subtotal_amount" - ], - "properties": { - "subtotal_amount": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." + }, + "10_obj_order_object_stacked_redemptions": { + "type": "object", + "title": "Stacked Redemption", + "description": "Redemption object representing a stacked redemption.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique parent redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of multiple incentives.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "default": "redemption" + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the parent redemption.", + "example": "r_0ba186c4824e4881e1" + }, + "stacked": { + "type": "array", + "description": "Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.", + "items": { + "type": "string" + } + } } } } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalCustomerMetadata": { - "title": "Customer Metadata", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)" - }, - "customer": { - "type": "object", - "required": [ - "metadata" - ], - "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "Customer metadata property." + }, + "10_res_list_orders": { + "type": "object", + "title": "List Orders Response Body", + "description": "Response body schema representing **GET** `/orders`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about orders in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "orders", + "description": "Identifies the name of the attribute that contains the array of order objects." + }, + "orders": { + "type": "array", + "description": "Contains array of order objects.", + "items": { + "$ref": "#/components/schemas/10_obj_order_object" } + }, + "total": { + "type": "integer", + "description": "Total number of orders." } } - } - } - }, - "required": [ - "type", - "calculation_type", - "customer" - ] - }, - "EarningRuleProportionalCustomEvent": { - "title": "Custom Event", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOM_EVENT_METADATA" - ], - "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." - }, - "custom_event": { - "type": "object", - "required": [ - "metadata" - ], - "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "\nCustom event metadata property." - } + }, + "10_req_create_order": { + "type": "object", + "title": "Order", + "description": "Request body schema for creating an order.", + "properties": { + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" } } - } - } - }, - "required": [ - "type", - "calculation_type", - "custom_event" - ] - }, - "EarningRuleProportional": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrder" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" - } - ], - "title": "Calculate points proportionally" - }, - "EarningRuleProportionalOrderItems": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" - } - ], - "title": "Order Items" - }, - "LoyaltiesListMemberRewardsRequestQuery": { - "title": "Loyalties List Member Rewards Request Query", - "type": "object", - "properties": { - "affordable_only": { - "type": "string" - }, - "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", - "pattern": "list", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON." - }, - "data_ref": { - "type": "string", - "pattern": "data", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of transaction objects." - }, - "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" - }, - "balance": { - "type": "string" - }, - "next_expiration_date": { - "type": "string" - }, - "next_expiration_points": { - "type": "string" + }, + "10_req_update_order": { + "type": "object", + "title": "Update Order Request Body", + "description": "Request body schema for **PUT** `/orders/{orderId}`.", + "properties": { + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + }, + "customer_id": { + "type": "string", + "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "description": "Unique customer ID of the customer making the purchase." + }, + "referrer_id": { + "type": "string", + "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "description": "Unique referrer ID." + } } - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ] - }, - "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": [ - "string", - "null" - ], - "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." - }, - "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": [ - "string", - "null" - ], - "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." - }, - "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": "Contains the detailed information about the transaction.", - "properties": { - "balance": { + }, + "10_req_create_order_export": { + "type": "object", + "title": "Create Order Export Request Body", + "description": "Request body schema for **POST** `/orders/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/16_obj_export_order", + "description": "Contains the parameters that define the data to be exported." + } + } + }, + "10_req_orders_import": { + "type": "array", + "title": "Import Orders Request Body", + "description": "Request body schema for POST `/orders/import`.", + "items": { "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", "properties": { - "type": { + "source_id": { "type": "string", - "pattern": "loyalty_card", - "enum": [ - "loyalty_card" - ], - "description": "The type of voucher whose balance is being adjusted due to the transaction." + "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." }, - "total": { - "type": "integer", - "description": "The available points prior to the transaction." - }, - "object": { + "status": { "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." + "description": "The order status. One of `CREATED`, `PAID`, `CANCELED`, `FULFILLED`." }, - "balance": { + "amount": { "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are subtracted from the loyalty card." + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." }, - "related_object": { + "metadata": { "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." - } + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + } + } + } + }, + "10_req_orders_customer_object": { + "type": "object", + "title": "Customer", + "description": "This is an object containing information about the customer.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer that will be linked to the order; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address" + }, + "line_2": { + "type": "string", + "description": "Second line of address" + }, + "country": { + "type": "string", + "description": "Country" + }, + "postal_code": { + "type": "string", + "description": "Postal code" } } }, - "required": [ - "type", - "total", - "object", - "points", - "balance", - "related_object" - ] - }, - "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." + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer." + } + } + }, + "10_req_orders_referrer_object": { + "type": "object", + "title": "Referrer", + "description": "This is an ojbect containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer that will be linked to the order as the referrer; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Referrer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a referrer object." + }, + "email": { + "type": "string", + "description": "Referrer's email address." + }, + "phone": { + "type": "string", + "description": "Referrer's phone number." + }, + "address": { + "type": "object", + "description": "Referrer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address" + }, + "line_2": { + "type": "string", + "description": "Second line of address" + }, + "country": { + "type": "string", + "description": "Country" + }, + "postal_code": { + "type": "string", + "description": "Postal code" + } } }, - "required": [ - "id", - "source_id" - ] + "birthdate": { + "type": "string", + "description": "Referrer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Referrer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a referrer." + } + } + }, + "10_req_orders_items_array": { + "type": "array", + "title": "Items Array", + "description": "Array of items applied to the order.", + "items": { + "$ref": "#/components/schemas/10_req_orders_order_item" + } + }, + "10_req_orders_order_item": { + "type": "object", + "title": "Order Item", + "description": "This object represents an order line item.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "related_object": { + "type": "string", + "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." + }, + "product_id": { + "type": "string", + "description": "A unique product ID assigned by Voucherify.", + "example": "prod_0a7e62db1fca8322a2" + }, + "sku_id": { + "type": "string", + "description": "A unique SKU ID assigned by Voucherify.", + "example": "sku_0a41e31c7b41c28358" + }, + "quantity": { + "type": "integer", + "description": "The quantity of the particular item in the cart." + }, + "price": { + "type": "integer", + "description": "The unit price of the item." + }, + "amount": { + "type": "integer", + "description": "The total amount of the order item (`price` * `quantity`)." + }, + "product": { + "$ref": "#/components/schemas/10_req_orders_order_item_product" + }, + "sku": { + "$ref": "#/components/schemas/10_req_orders_order_item_sku" + } + } + }, + "10_req_orders_order_item_product": { + "type": "object", + "title": "Product", + "description": "An object containing details of the related product.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "name": { + "type": "string", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Product price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format." + }, + "override": { + "type": "boolean", + "description": "The override set to true is used to store the product information in the system. If product does not exist, it will be created with the use of `source_id`; if it does exist, the provided values for the `name`, `price`, and `metadata` will replace those already stored in the system." + } + } + }, + "10_req_orders_order_item_sku": { + "type": "object", + "title": "SKU", + "description": "An object containing details of the related SKU.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "sku": { + "type": "string", + "description": "The SKU name." + }, + "price": { + "type": "integer", + "description": "SKU price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format." + }, + "override": { + "type": "boolean", + "description": "The override is used to store the SKU in the system. If the SKU does not exist, it will be created with the use of `source_id`. Additionally, if the SKU does not exist, you are required to set the parent `product_id` that it belongs to. Set the parent `product_id` one level above, i.e. at the item level. If the parent product does not exist in Voucherify, i.e. does not have a unique `product_id`, then define the product object one level above, i.e. at the item level and make sure to also include the override as `true` for the product." + } + } + }, + "10_obj_order_item_object": { + "title": "Order Item Object", + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } }, - "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." + "description": "This is an object representing an order item. \n\nOrder Items are always specified within the [order object](ref:get-order). They can be related either to [products](list-products) or [SKUs](ref:list-skus-in-product). \n\nProduct/SKU details sent within an order item will be used on top of Product/SKU already stored in the system during the [Redeem Voucher](ref:redeem-voucher), [Validate Voucher](ref:validate-voucher), [Validate Promotions](ref:validate-promotions) and [Redeem Promotion](ref:redeem-promotion) requests.", + "x-tags": [ + "ORDERS API" + ] + }, + "11_obj_product_object": { + "type": "object", + "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.", + "title": "Product Object", + "x-tags": [ + "PRODUCTS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0b1da8105693710357" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID from your inventory system." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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" } }, - "required": [ - "id", - "type" - ] + "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", + "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", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the `product`.", + "default": "product" + }, + "skus": { + "$ref": "#/components/schemas/11_res_get_product_skus_object" + } + } + }, + "11_req_create_product": { + "type": "object", + "description": "Request schema for **POST** `/products`.", + "title": "Create Product Request Body", + "properties": { + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_req_update_products_metadata_in_bulk": { + "type": "object", + "description": "Request schema for **POST** `/products/metadata/async`.", + "title": "Update Products' Metadata in Bulk Request Body", + "properties": { + "source_ids": { + "type": "array", + "description": "Array of unique product source IDs.", + "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." + } }, - "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": [ + "source_ids", + "metadata" + ] + }, + "11_req_update_product": { + "type": "object", + "description": "Request schema for **PUT** `/products/{productId}`.", + "title": "Update Product Request Body", + "properties": { + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_req_update_product_bulk": { + "type": "object", + "description": "Request schema for **POST** `/products/bulk/async`.", + "title": "Update Product Request Body", + "properties": { + "source_id": { + "type": "string", + "description": "Unique product source ID from your inventory system.", + "example": "test_prod_id_1" + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_res_list_products": { + "type": "object", + "description": "Response body schema representing **GET** `/products`.", + "title": "Product Object", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about products in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of product objects.", + "default": "products" + }, + "products": { + "type": "array", + "description": "Contains array of product objects.", + "items": { + "$ref": "#/components/schemas/11_obj_list_products_product_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of product objects." + } + } + }, + "11_obj_list_products_product_object": { + "type": "object", + "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.", + "title": "Product Object", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0b1da8105693710357" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the product.", + "default": "product" + }, + "skus": { + "type": "object", + "description": "Contains a list of related child SKUs.", + "properties": { + "data": { + "type": "array", + "description": "Contains a list of SKU objects.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" } + }, + "total": { + "type": "number", + "description": "Total number of SKUs." } } + } + } + }, + "11_res_get_product_skus_object": { + "type": "object", + "description": "Contains information about child SKUs.", + "title": "SKUs object", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of SKUs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of SKUs.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of SKUs in the product." + } + } + }, + "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." }, - "required": [ - "id", - "source" - ] - }, - "segment": { - "type": "object", - "description": "Contains information about the segment.", - "properties": { - "id": { - "type": "string" - }, - "name": { + "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" } }, - "required": [ - "id", - "name" - ] + "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" + } }, - "loyalty_tier": { - "type": "object", - "description": "Contains information about the loyalty tier.", - "properties": { - "id": { - "type": "string" - }, - "name": { + "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.", + "title": "Product Object", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID.", + "example": "prod_f1r5Tpr0DuC7" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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" } }, - "required": [ - "id", - "name" - ] - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID." - } + "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." }, - "required": [ - "id" - ] - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID." - } + "image_url": { + "type": "string", + "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" }, - "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." - } + "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" }, - "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." - } + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" }, - "required": [ - "id", - "name" - ] - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID." + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the `product`.", + "default": "product" + } + } + }, + "11_obj_sku_object": { + "title": "SKU Object", + "type": "object", + "description": "This is an object representing a product SKU. \n\nThe SKU (acronym from Stock Keeping Unit) is tightly related to the [product object](ref:get-product). It reflects its different variants. One product can have many SKUs which are characterized and differentiated by varying values of the parent product `attributes`.", + "x-tags": [ + "PRODUCTS API" + ], + "examples": [ + { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", + "price": 1300, + "currency": "USD", + "attributes": { + "size": "XS", + "color": "blue", + "ranking": 1 }, - "name": { - "type": "string", - "description": "Reward name." - } + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" + } + ], + "properties": { + "id": { + "type": "string", + "example": "sku_0b1621b319d248b79f", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "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." + "source_id": { + "type": "string", + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "product_id": { + "type": "string", + "example": "prod_0b15f6b9f650c16990", + "description": "The parent product's unique ID." + }, + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency.", + "example": "USD" + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + }, + "created_at": { + "type": "string", + "example": "2022-05-17T10:36:30.187Z", + "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "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" + }, + "object": { + "type": "string", + "default": "sku", + "description": "The type of object represented by JSON. This object stores information about the `SKU`." + } } - } - }, - "related_transaction_id": { - "type": [ - "string", - "null" - ], - "description": "The related transaction ID on the receiving card." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format.\n\n" - } - }, - "required": [ - "id", - "source_id", - "voucher_id", - "campaign_id", - "source", - "reason", - "type", - "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" + }, + "11_req_create_sku": { + "title": "SKU Object", + "type": "object", + "description": "Request body schema for **POST** `/products/{productId}/skus", + "properties": { + "source_id": { + "type": "string", + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency.", + "example": "USD" + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." } - }, - "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 - } - } - } + } + }, + "product_collections_sku_in_collection": { + "title": "SKU in Collection", + "type": "object", + "description": "This is an object representing a SKU in product collection.", + "properties": { + "id": { + "type": "string", + "example": "sku_0b1621b319d248b79f", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": [ + "string", + "null" + ], + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "product_id": { + "type": "string", + "example": "prod_0b15f6b9f650c16990", + "description": "The parent product's unique ID." + }, + "sku": { + "type": [ + "string", + "null" + ], + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "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": { + "type": "object", + "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", + "null" + ], + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + }, + "created_at": { + "type": "string", + "example": "2022-05-17T10:36:30.187Z", + "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "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" + }, + "object": { + "type": "string", + "default": "sku", + "description": "The type of object represented by JSON. This object stores information about the `SKU`." + }, + "product": { + "type": "object", + "description": "Stores information about the parent product.", + "required": [ + "id", + "source_id", + "name", + "price", + "attributes", + "metadata", + "object" + ], + "properties": { + "id": { + "type": "string", + "example": "prod_f15Tpr0DuC7", + "description": "Unique product ID." + }, + "source_id": { + "type": [ + "string", + "null" + ], + "example": "productSourceID11", + "description": "A unique product ID from your inventory system." + }, + "name": { + "type": [ + "string", + "null" + ], + "example": "Shirts", + "description": "Unique user-defined product name." + }, + "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 SKL 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." + }, + "object": { + "type": "string", + "default": "product", + "description": "The type of object represented by the object. This object stores information about the parent `product`." } } } - } - } - }, - "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." - } + "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", + "type": "object", + "description": "Request body schema for **PUT** `/products/{productId}/skus/{skuId}`.", + "properties": { + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency." + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." } - }, - "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." + "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", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about products and SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of products and SKUs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of products and SKUs.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/product_collections_product_in_collection" + }, + { + "$ref": "#/components/schemas/product_collections_sku_in_collection" + } + ] } + }, + "total": { + "type": "integer", + "description": "Total number of products & SKUs in the product collection." } - } - } - } - }, - "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": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "11_res_products_productId_skus": { + "type": "object", + "description": "Response body schema for **GET** `/products/{productID}/skus`.", + "title": "List SKUs in Product Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of SKUs.", + "default": "skus" + }, + "skus": { + "type": "array", + "description": "A dictionary that contains an array of SKUs.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" } + }, + "total": { + "type": "integer", + "description": "Total number of SKUs in the product." } } - } - } - }, - "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." + }, + "product_collections_static_collection": { + "type": "object", + "title": "Static Product Collection", + "description": "Schema model for a `STATIC` product collection.", + "properties": { + "type": { + "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", + "enum": [ + "STATIC" + ] + }, + "products": { + "description": "Defines a set of products for a `STATIC` product collection type.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "prod_0a41bcf807c5fcaaf6", + "description": "The product ID." + }, + "product_id": { + "type": "string", + "description": "Product ID for SKUs." + }, + "object": { + "enum": [ + "sku", + "product" + ], + "description": "Denotes the type of object represented by the ID." + } + }, + "required": [ + "id", + "object" + ] } } - } - } - } - }, - "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" + "required": [ + "type", + "products" + ] + }, + "product_collections_dynamic_collection": { + "type": "object", + "title": "Dynamic Product Collection", + "description": "Schema model for an `AUTO_UPDATE` product collection.", + "properties": { + "type": { + "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" + ] + }, + "filter": { + "type": "object", + "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" + } + } } }, - "url": { - "type": "string", - "description": "The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications" - } + "required": [ + "type", + "filter" + ] }, - "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." + "product_collections_list_response_body": { + "type": "object", + "title": "List Product Collections Response Body", + "description": "Response body schema for **GET** `/product-collections`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about product collections.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the JSON property that contains the array of product collections." + }, + "data": { + "description": "A dictionary that contains an array of product collections and their details.", + "type": "array", + "items": { + "$ref": "#/components/schemas/product_collections_collection_item" + } + }, + "total": { + "type": "integer", + "description": "Total number of product collections." + } }, - "redemption_entries": { - "type": "array", - "items": { - "type": "string" + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "13_obj_validation_rule_object": { + "title": "Validation Rule Object", + "type": "object", + "description": "This is an object representing a validation rule. \n\nThis entity stores the rules used to limit resources in Voucherify. The validation rule can be assigned to resources such as a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)\n\nYou can configure the Validation Rule to include your own custom error messages which are going to be returned from the API upon a validation / redemption failure. You can read more [here](ref:errors#custom-error-messages-with-validation-rules).", + "x-tags": [ + "VALIDATION RULES API" + ], + "properties": { + "id": { + "type": "string", + "example": "val_eR1c41hu0vUU", + "description": "Unique validation rule ID." + }, + "name": { + "type": "string", + "description": "Custom, unique name for set of validation rules.", + "example": "Business Validation Rule" + }, + "rules": { + "type": "object", + "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", + "properties": { + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
customer.metadata* \n**Order** |order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** | sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive | order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n\n*Requires the `property` field to be defined." + }, + "property": { + "type": [ + "string", + "null" + ], + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n customer_metadata
custom_event_metadata
order_items_metadata
order_metadata
product_metadata
redemption_metadata" + }, + "conditions": { + "type": "object", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n**Condition (key)** | **Definition** | **Does not support Types** \n--- | --- | ---\n $is | A property is a predefined value. | \n $is_not | A property is not a predefined value. | \n $in | A property either one value in a predefined list of values. | \n $less_than | A property is less than a predefined value. | boolean \n $less_than_or_equal | A property is less than or equal to a predefined value. | boolean \n $more_than | A property is more than a predefined value. | boolean \n $more_than_or_equal | A property is more than or equal to a predefined value. | boolean \n $starts_with | A property starts with the predefined sequence of characters. | boolean, number \n $ends_with | A property ends with the predefined sequence of characters. | boolean, number \n $contains | A property contains the predefined sequence of characters. | boolean, number \n $timeframe | | boolean, number \n $dow | | boolean, string \n $count | | boolean, string \n $count_more | | boolean, string \n $count_less | | boolean, string ", + "properties": { + "$one_of_voucherify_conditions": { + "type": "array", + "description": "Contains a set of conditions for the rule.", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] + } + } + } + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } + } + }, + "logic": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + } + }, + "logic": { + "type": "string", + "example": "(1 and 2) and (3)", + "description": "Defines the logic between the rules." + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." + }, + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } + } + }, + "created_at": { + "type": "string", + "example": "2022-03-23T07:44:00.444Z", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-04-26T08:35:54.960Z", + "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "basic", + "advanced", + "complex" + ], + "description": "Type of validation rule." + }, + "context_type": { + "type": "string", + "enum": [ + "earning_rule.order.paid", + "earning_rule.custom_event", + "earning_rule.customer.segment.entered", + "campaign.discount_coupons", + "campaign.discount_coupons.discount.apply_to_order", + "campaign.discount_coupons.discount.apply_to_items", + "campaign.discount_coupons.discount.apply_to_items_proportionally", + "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", + "campaign.discount_coupons.discount.fixed.apply_to_items", + "campaign.gift_vouchers", + "campaign.gift_vouchers.gift.apply_to_order", + "campaign.gift_vouchers.gift.apply_to_items", + "campaign.referral_program", + "campaign.referral_program.discount.apply_to_order", + "campaign.referral_program.discount.apply_to_items", + "campaign.referral_program.discount.apply_to_items_proportionally", + "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", + "campaign.referral_program.discount.fixed.apply_to_items", + "campaign.promotion", + "campaign.promotion.discount.apply_to_order", + "campaign.promotion.discount.apply_to_items", + "campaign.promotion.discount.apply_to_items_proportionally", + "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", + "campaign.promotion.discount.fixed.apply_to_items", + "campaign.loyalty_program", + "campaign.lucky_draw", + "voucher.discount_voucher", + "voucher.discount_voucher.discount.apply_to_order", + "voucher.discount_voucher.discount.apply_to_items", + "voucher.discount_voucher.discount.apply_to_items_proportionally", + "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", + "voucher.discount_voucher.discount.fixed.apply_to_items", + "voucher.gift_voucher", + "voucher.gift_voucher.gift.apply_to_order", + "voucher.gift_voucher.gift.apply_to_items", + "voucher.loyalty_card", + "voucher.lucky_draw_code", + "distribution.custom_event", + "reward_assignment.pay_with_points", + "global" + ], + "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + }, + "object": { + "type": "string", + "default": "validation_rules", + "description": "The type of object represented by JSON. This object stores information about the validation rule." } - }, - "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`" + "13_req_create_validation_rule": { + "title": "Create Validation Rule Request Body", + "type": "object", + "description": "Request body schema for **POST** `/validation-rules`.", + "properties": { + "name": { + "type": "string", + "description": "Custom, unique name for the set of validation rules.", + "example": "Business Validation Rule" + }, + "rules": { + "type": "object", + "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", + "properties": { + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n| **Name** |\n|:---|\n| **Customer** |\n| customer.segment
customer.metadata* |\n| **Order** |\n| order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** |\n| campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |\n| redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** |\n| product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** |\n| sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** |\n| publication.redeemable_by_linked_customer |\n| **Custom Event** |\n| custom_event.metadata* |\n| **Order items** |\n| order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive |\n| order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n*Requires the `property` field to be defined." + }, + "property": { + "type": [ + "string", + "null" + ], + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" + }, + "conditions": { + "type": "object", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", + "properties": { + "$one_of_voucherify_conditions": { + "type": "array", + "description": "Contains a set of conditions for the rule.", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] + } + } + } + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } + } + }, + "logic": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + } + }, + "logic": { + "type": "string", + "example": "(1 and 2) and (3)", + "description": "Defines the logic between the rules." + } } - } - }, - "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`" + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." + }, + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } } } } - } - }, - "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" + }, + "13_res_list_validation_rules": { + "description": "Response body schema for listing validation rules. \n\nThis entity stores the [validation rules](ref:get-validation-rule) used to limit your resources.", + "type": "object", + "title": "List Validation Rules Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about validation rules.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of validation rules.", + "default": "data" + }, + "data": { + "type": "array", + "uniqueItems": true, + "description": "An array of validation rules.", + "items": { + "type": "object", + "description": "Stores information about the validation rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique validation rule ID.", + "example": "val_F4Artfc4HQIq" + }, + "name": { + "type": "string", + "description": "Custom, unique name for the set of validation rules." + }, + "rules": { + "type": "object", + "description": "A set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", + "properties": { + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
customer.metadata* \n**Order** |order.amount
order.items.count
order.items.price_any
order.items.price_each
order.items.metadata_any
order.items.metadata_each
order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
campaign.orders.amount
campaign.redemptions.count
campaign.redemptions.count.daily
campaign.redemptions.count.monthly
campaign.redemptions.customers_count
campaign.redemptions.customers_count.daily
campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
redemption.count.daily
redemption.count.monthly
redemption.count.per_customer
redemption.count.per_customer.daily
redemption.count.per_customer.monthly
redemption.api_key
redemption.count.per_api_key
redemption.user.login
redemption.count.per_user
redemption.metadata*
redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
product.price
product.quantity
product.discount_applicable
product.metadata*
product.metadata.aggregated_quantity
product.metadata.aggregated_amount
product.metadata.discount_applicable
product.metadata.match_all |\n| **SKU** | sku.id
sku.price
sku.quantity
sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
order.items.any
order.items.none
order.items.cheapest
order.items.most_expensive | order.items.quantity
order.items.aggregated_quantity
order.items.price
order.items.aggregated_amount
order.items.metadata* | \n\n\n*Requires the `property` field to be defined." + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } + } + }, + "logic": { + "type": "string" + } + } + }, + "property": { + "type": "string", + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" + }, + "conditions": { + "type": "array", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + } + }, + "logic": { + "type": "string", + "description": "Defines the logic between the rules.", + "example": "(1 and 2) and (3)" + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." + }, + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "example": "2022-04-07T07:42:44.442Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-05-09T07:42:44.442Z", + "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "basic", + "advanced", + "complex" + ], + "description": "Type of validation rule." + }, + "context_type": { + "type": "string", + "enum": [ + "earning_rule.order.paid", + "earning_rule.custom_event", + "earning_rule.customer.segment.entered", + "campaign.discount_coupons", + "campaign.discount_coupons.discount.apply_to_order", + "campaign.discount_coupons.discount.apply_to_items", + "campaign.discount_coupons.discount.apply_to_items_proportionally", + "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", + "campaign.discount_coupons.discount.fixed.apply_to_items", + "campaign.gift_vouchers", + "campaign.gift_vouchers.gift.apply_to_order", + "campaign.gift_vouchers.gift.apply_to_items", + "campaign.referral_program", + "campaign.referral_program.discount.apply_to_order", + "campaign.referral_program.discount.apply_to_items", + "campaign.referral_program.discount.apply_to_items_proportionally", + "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", + "campaign.referral_program.discount.fixed.apply_to_items", + "campaign.promotion", + "campaign.promotion.discount.apply_to_order", + "campaign.promotion.discount.apply_to_items", + "campaign.promotion.discount.apply_to_items_proportionally", + "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", + "campaign.promotion.discount.fixed.apply_to_items", + "campaign.loyalty_program", + "campaign.lucky_draw", + "voucher.discount_voucher", + "voucher.discount_voucher.discount.apply_to_order", + "voucher.discount_voucher.discount.apply_to_items", + "voucher.discount_voucher.discount.apply_to_items_proportionally", + "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", + "voucher.discount_voucher.discount.fixed.apply_to_items", + "voucher.gift_voucher", + "voucher.gift_voucher.gift.apply_to_order", + "voucher.gift_voucher.gift.apply_to_items", + "voucher.loyalty_card", + "voucher.lucky_draw_code", + "distribution.custom_event", + "reward_assignment.pay_with_points", + "global" + ], + "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + }, + "assignments_count": { + "description": "The number of instances the validation rule has been assigned to different types of redeemables.", + "type": "integer" + }, + "object": { + "type": "string", + "default": "validation_rules", + "description": "The type of object represented by each nested object in the JSON `data` array. This object stores information about the validation rules." + } } - }, - "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." + "total": { + "type": "integer", + "description": "Total number of validation rules in the project." + } } }, - "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." - } + "13_obj_validation_rule_assignment_object": { + "title": "Validation Rule Assignment Object", + "type": "object", + "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", + "x-tags": [ + "VALIDATION RULES API" + ], + "properties": { + "id": { + "type": "string", + "example": "asgm_74F7QZoYbUoljwQO", + "description": "Validation rule assignment ID." + }, + "rule_id": { + "type": "string", + "example": "val_4j7DCRm2IS59", + "description": "Validation rule ID." + }, + "related_object_id": { + "type": "string", + "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", + "description": "The resource ID to which the validation rule was assigned." + }, + "related_object_type": { + "type": "string", + "description": "The type of resource to which the validation rule was assigned.", + "enum": [ + "voucher", + "campaign", + "earning_rule", + "reward_assignment", + "promotion_tier", + "distribution" + ] }, - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + "created_at": { + "type": "string", + "example": "2022-02-17T08:18:15.085Z", + "description": "Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "validation_rules_assignment", + "description": "The type of object represented by the ID." + } } }, - "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." + "13_res_validation-rules_validationRuleId_assignments": { + "type": "object", + "description": "Validation Rule Assignments", + "title": "Validation Rule Assignments", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about validation rule assignments.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of validation rule assignments.", + "items": { + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" } }, - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + "total": { + "type": "integer", + "description": "Total number of validation rule assignments." + } } }, - "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." - } + "13_req_create_validation_rule_assignments": { + "description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.", + "title": "Create Validation Rule Assignments Request Body", + "oneOf": [ + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_voucher" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_campaign" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_promotion_tier" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_earning_rule" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_reward" }, - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_distribution" + } + ] + }, + "13_req_create_validation_rule_assignments_voucher": { + "type": "object", + "description": "Assign a validation rule to a voucher.", + "title": "Voucher", + "properties": { + "voucher": { + "type": "string", + "description": "Unique voucher ID or code to which you would like to assign the validation rule to.", + "example": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" + } } }, - "required": [ - "exported_object" - ] - }, - { - "title": "Export Order", - "properties": { - "exported_object": { - "type": "string", - "enum": [ - "order" - ], - "description": "The type of object to be exported." + "13_req_create_validation_rule_assignments_campaign": { + "type": "object", + "description": "Assign a validation rule to a campaign.", + "title": "Campaign", + "properties": { + "campaign": { + "type": "string", + "description": "Unique campaign ID or name to which you would like to assign the validation rule to.", + "example": "camp_HXsR22VUMC4hN4DR7eAhCalp" + } + } + }, + "13_req_create_validation_rule_assignments_promotion_tier": { + "type": "object", + "description": "Assign a validation rule to a promotion tier.", + "title": "Promotion Tier", + "properties": { + "promotion_tier": { + "type": "string", + "description": "Unique promotion tier ID to which you would like to assign the validation rule to.", + "example": "promo_Vet0vCNyyo5pOddHfu2X3FCB" + } + } + }, + "13_req_create_validation_rule_assignments_earning_rule": { + "type": "object", + "description": "Assign a validation rule to an earning rule.", + "title": "Earning Rule", + "properties": { + "earning_rule": { + "type": "string", + "description": "Unique earning rule ID to which you would like to assign the validation rule to.", + "example": "ern_CfvQ4vWEKD4kHTxghdY8YJGs" + } + } + }, + "13_req_create_validation_rule_assignments_reward": { + "type": "object", + "description": "Assign a validation rule to a reward.", + "title": "Reward", + "properties": { + "related_object_id": { + "type": "string", + "description": "Unique reward assignment ID, i.e. rewa_6VSWcXjfm5PuZlfeuZxl5JZT. This is the first parameter to be sent for a validation rule assignment to be assigned to a reward assignment. The prerequisites for assigning a validation rule to a reward assignment are: \n1. Define a loyalty campaign. \n2. Connect a reward with the campaign. \n3. Retrieve a reward assignment ID for the reward assigned to the loyalty campaign. \n4. And finally you can use this endpoint to assign a validation rule to the particular reward assignment.", + "example": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT" + }, + "related_object_type": { + "type": "string", + "description": "This is the second parameter that needs to be sent in order to properly assign a validation rule to a reward assignment.", + "example": "reward_assignment", + "default": "reward_assignment", + "enum": [ + "reward_assignment" + ] + } + } + }, + "13_req_create_validation_rule_assignments_distribution": { + "type": "object", + "description": "Assign a validation rule to a distribution.", + "title": "Distribution", + "properties": { + "distribution": { + "type": "string", + "description": "Unique distribution ID to which you would like to assign the validation rule to.", + "example": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + } + } + }, + "14_obj_segment_object": { + "title": "Customer Segment Object", + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "seg_1wc52c5z6r1kQ81brO8j9Hk2", + "description": "Unique segment ID." + }, + "name": { + "type": "string", + "description": "Segment name." + }, + "created_at": { + "type": "string", + "example": "2022-05-12T13:01:56.896Z", + "description": "Timestamp representing the date and time when the segment was created in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "auto-update", + "static" + ], + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers)." + }, + "filter": { + "type": [ + "object", + "null" + ], + "description": "Defines a set of criteria for an `auto-update` segment type. " + }, + "initial_sync_status": { + "type": "string", + "enum": [ + "IN_PROGRESS", + "DONE" + ] + }, + "object": { + "type": "string", + "default": "segment", + "description": "The type of object represented by JSON. This object stores information about the customer segment." + } }, - "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" + "description": "This is an object representing a customer segment.", + "x-tags": [ + "SEGMENTS API" + ] + }, + "14_req_create_segment": { + "title": "Create Customer Segment Request Body", + "description": "Request body schema for **POST** `/segments`.", + "oneOf": [ + { + "$ref": "#/components/schemas/14_req_create_segment_static" + }, + { + "$ref": "#/components/schemas/14_req_create_segment_dynamic" + } + ] + }, + "14_req_create_segment_static": { + "title": "Static Customer Segment", + "type": "object", + "description": "Request body schema for creating a static customer segment in **POST** `/segments`.", + "properties": { + "name": { + "type": "string", + "description": "Segment name." + }, + "type": { + "type": "string", + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", + "default": "static" + }, + "customers": { + "type": "array", + "description": "Array of customer IDs.", + "items": {} + } + } + }, + "14_req_create_segment_dynamic": { + "title": "Dynamic Customer Segment", + "type": "object", + "description": "Request body schema for creating a dynamic customer segment in **POST** `/segments`.", + "properties": { + "name": { + "type": "string", + "description": "Segment name." + }, + "type": { + "type": "string", + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", + "default": "auto-update" + }, + "filter": { + "type": "object", + "description": "Defines a set of criteria for an `auto-update` segment type." + } + } + }, + "14_res_customers_customerId_segments": { + "type": "object", + "title": "List Segments for Customer Response Body", + "description": "Response body schema for `/customers/{customerId}/segments`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about customer segments.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of segment IDs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of segment IDs and names.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique segment ID.", + "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" + }, + "name": { + "type": "string", + "description": "Segment name." + }, + "object": { + "type": "string", + "description": "The type of object represented by the ID.", + "default": "segment" + } } - }, - "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." + "total": { + "type": "integer", + "description": "Total number of segments the customer belongs to." + } } }, - "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" + "15_obj_event_object": { + "title": "Event Object", + "type": "object", + "description": "This is an object representing an event. \n\nVoucherify distinguishes two types of events - custom and internal. Both are presented in the same Event structure. \n\n## Custom Events\n\nCustom Events are actions taken by your customers. They’re best suited for tracking high-value customer interactions with your application. Logging a custom event can trigger any number of distributions, and enables the segmentation filters around the recency and frequency of that event.\n\nWith Custom Event metadata field, Voucherify allows you to set properties on custom events. These properties can then be used for further qualifying trigger conditions, increasing personalization in messaging, and generating more sophisticated analytics through raw data export.\n\nThe Custom Events are directly linked to the customers' resources from Voucherify. It means that each event gets a connection to a customer. \n\n\n> #### An example \n>\n> If an e-commerce application wanted to send a message to a user when he/she abandons their cart, the custom event could additionally improve its target audience and allow for increased distribution personalization by adding a Custom Event of the `value` of customers’ order.\n\n## Internal Voucherify Events \n\nMoreover, Events are our way of letting you know when something interesting happens in your project. When an interesting event occurs, we create a new Event object. For example, when a redemption succeeds, we create a `redemption.succeeded` event.\n\nNote that many API requests may cause multiple events to be created. For example, if you create a new redemption for a new customer not existing yet in Voucherify, you will receive both a `customer.created` event and a `redemption.succeeded` event.\n\nThe events occur when the state of another API resource changes and the state of that resource at the time of the change is embedded in the data field of the event. \n\n| **Types of internal events** |\n|:---|\n| **Campaign** |\n| campaign.validation_rules.created
campaign.created
campaign.disabled
campaign.export_mailchimp_scheduled
campaign.export_mailchimp_done
campaign.validation_rules.deleted
campaign.validation_rules.updated
campaign.updated
campaign.deleted
campaign.export_mailchimp_failed
campaign.enabled |\n| **Voucher** |\n| voucher.validation.succeeded
voucher.updated
voucher.enabled
voucher.gift.balance_added
voucher.validation_rules.updated
voucher.published
voucher.validation_rules.deleted
voucher.disabled
voucher.validation.failed
voucher.validation_rules.created
voucher.deleted
voucher.created |\n| **Redemption** |\n| redemption.succeeded
redemption.failed
redemption.rollback.failed
redemption.rollback.succeeded |\n| **Customer** |\n| customer.rewarded
customer.rewarded.loyalty_points
customer.sms.sent
customer.email.failed
customer.deleted
customer.created
customer.updated
customer.segment.left
customer.sms.failed
customer.segment.entered
customer.email.sent |\n| **Order** |\n| order.canceled
order.created
order.updated
order.paid |\n| **Product** |\n| product.updated
product.created
product.deleted |\n| **SKU** |\n| sku.updated
sku.created
sku.deleted |\n| **Distribution** |\n| distribution.sms.failed
distribution.sms.sent
distribution.email.sent
distribution.email.failed |\n| **Export** |\n| export.done
export.scheduled
export.failed
export.deleted | \n\n## Webhooks \n\nVoucherify also has a separate system for sending the event objects directly to an endpoint at your end (server). We called that mechanism webhooks. They are managed in your project settings. \n\n| **Attribute** | **Description** | **Example** |\n|:---|:---|:---|\n| `id`
string | | event_xjGas2mI2PduFFPL2NAcFeHkHfLn3H |\n| `object`
string | Type of the object represented by JSON. Value is `event`. | |\n| `created_at`
string, ISO 8601 date format | Time at which the object was created. | 2016-11-16T14:14:31Z |\n| `type`
string | Description of the event | view_pricing_page
redemption.succeeded |\n| `data.object`
object | The object containing data associated with the event. It can be a `customer`, `redemption` or any other type of object which is a source of the event. In this object structure, you can also find a property `related_object` which contains values presenting any other resource connected to the event.

For Custom Event the structure of child attributes is constant:

- customer (`object`) - The object presenting a profile of the related customer who performed an action.

- metadata (`object`) - A set of key/value pairs that you can attach to a custom event object. It can be useful for storing additional information about the event in a structured format. | \"data\": { \"object\": { \"customer\": { \"id\": \"cust_OtHDKrv5sJrjd8aYBYZ6AOIF\", \"name\": \"Gustav Purpleson\", \"object\": \"customer\", \"source_id\": \"gustav@purpleson.com\", \"created_at\": 1510834859417, \"updated_at\": 1510835106559 }, \"metadata\": { \"lang\": \"en\", \"test\": true, \"page\": \"http://main.io\" } } } |\n| `metadata`
object | A set of key/value pairs that Voucherify attaches to a custom event object. It is a set of additional system information about the event in a structured format. | |\n\n\n```json\n{\n \"id\": \"event_ehkvgZFgSePlb95SH3JJulkApy9Kg9\",\n \"object\": \"event\",\n \"created_at\": \"2017-11-16T14:45:34.181Z\",\n \"type\": \"redemption.succeeded\",\n \"data\": {\n \"object\": {\n \"id\": \"r_mist0IpebikTaRdxiOGI2IhL\",\n \"date\": \"2017-11-16T14:45:32.733Z\",\n \"order\": {\n \"id\": \"ord_AhDlR13vQE5ino95P2NIABBN\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"sku_id\": null,\n \"quantity\": 1,\n \"source_id\": null,\n \"product_id\": \"iphone8\"\n }\n ],\n \"amount\": 50000,\n \"object\": \"order\",\n \"status\": \"CREATED\",\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": null,\n \"referrer\": null,\n \"source_id\": null,\n \"created_at\": \"2017-11-16T14:45:32.023Z\",\n \"updated_at\": null,\n \"discount_amount\": 2000\n },\n \"object\": \"redemption\",\n \"result\": \"SUCCESS\",\n \"voucher\": {\n \"code\": \"2017-goX-aH\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"object\": \"voucher\",\n \"campaign\": \"SteffenTest\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 2000\n },\n \"is_referral_code\": false\n },\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": {\n \"city\": \"London1\"\n },\n \"customer_id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"tracking_id\": \"track_3tM7KR57bbeIRtMcvpKYr2aAOrCpYBDZ\",\n \"related_object_type\": \"voucher\"\n },\n \"previous_attributes\": {}\n },\n \"metadata\": {\n \"source\": \"API\"\n }\n}\n```\n\n## Customisable Campaign Events \n\nAs part of campaign creation, users can configure webhooks triggered when specific activities appear within a campaign's lifetime. Those webhooks get configurable names and the users implement them in Voucherify Dashboard as part of the campaign creation process.\n\nThis type of webhooks can be configured for the following actions: \n\n| **Action** |\n|:---|\n| **Referral Program** |\n| Referrer rewarded
Referral code assigned
Customer referred |\n| **Loyalty Campaign** |\n| Loyalty card assigned
Points earned
Points redeemed | \n\nPayloads of customizable webhooks:\n\n### Referral Program\n\n\n```json\n{\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:09:57.765Z\",\n \"type\": \"referral_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"is_referral_code\": true,\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 1,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:00:08.306Z\",\n \"updated_at\": \"2021-11-12T11:09:40.671Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null,\n \"last_order_date\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:09:57.749Z\",\n \"updated_at\": \"2021-11-12T11:09:58.620Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null,\n \"value\": \"$10.00\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:09:57.765Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:49.723Z\",\n \"type\": \"referrer_rewarded_webhook\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/k\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1+tdyBGQeM+ZONM/k\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 1,\n \"campaigns\": {\n \"Referral Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 1\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:09:57.749Z\",\n \"updated_at\": \"2021-01-24T11:19:41.513Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_9Y7nwUx3BaU3cHqBVbd0TEtS2ENiFZhJ\",\n \"created_at\": \"2021-01-24T11:19:40.317Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"test_referrer__01\",\n \"metadata\": {},\n \"channel\": \"Automation\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"dOzJ84Ky\",\n \"vouchers\": [\n {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/kBdZ\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BtdyBGQeM%2BZONM%2FkBdZ\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\"\n ],\n \"campaign_name\": \"Bonus Cards\",\n \"gift\": {\n \"amount\": 0,\n \"balance\": 0\n },\n \"loyalty_card\": null,\n \"discount\": null,\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"is_referral_code\": true,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_Fuzc1rngCCuKRDfBXBjUwl5j\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-01-24T11:19:43.883Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"reward_assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"source_id\": \"event_0a26b3d269013fc79e\",\n \"source_type\": \"redemption_event\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"type\": \"GIFT_VOUCHER\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"object\": \"reward\",\n \"name\": \"Credits - 5$\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"reward_id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"related_object_id\": \"rrt_NWk1WYi1sZs3Epjvvd5a9JZx\",\n \"related_object_type\": \"referral_tier\",\n \"created_at\": \"2021-01-24T11:00:08.471Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"event_0a26b3d269013fc79e\",\n \"type\": \"redemption_event\"\n },\n \"balance\": {\n \"amount\": 500\n }\n },\n \"created_at\": \"2021-01-24T11:19:49.723Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:41.101Z\",\n \"type\": \"referee_invited\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": \"2021-01-24T11:09:40.671Z\",\n \"created_at\": \"2021-01-24T11:00:08.306Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"type\": \"customer.referred\",\n \"created_at\": \"2021-01-24T11:19:34.223Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {}\n },\n \"metadata_json\": {\n \"is_rewarded\": true,\n \"source\": null\n },\n \"automation_id\": null,\n \"group_id\": \"v-0a26b3d24b032c4871\"\n }\n },\n \"metadata\": {}\n}\n```\n\n### Loyalty Campaign \n\n\n```json\n{\n \"id\": \"evcus_0a26b89763051ed721\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"type\": \"loyalty_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 0,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:40:19.724Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"value\": 0\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b89763051ed721\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:40:18.125Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b9290fc4891587\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:42:51.380Z\",\n \"type\": \"points_earned\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 220\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": \"2021-11-12T11:42:50.332Z\",\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": {\n \"distr_naR4rx0AgM1baWZkFm1kfHn7A9\": {\n \"date\": \"2021-11-12T11:40:21.957Z\"\n },\n \"distr_pnfPKLDAxUpiPi3ZsuMrygtYNN\": {\n \"date\": \"2021-11-12T11:42:50.332Z\"\n }\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n }\n },\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": null,\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": null,\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 220\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 220,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 220,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:47.393Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b9290fc4891587\",\n \"type\": \"customer.rewarded.loyalty_points\",\n \"created_at\": \"2021-11-12T11:42:47.359Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:40.635Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n },\n \"balance\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n }\n },\n \"metadata_json\": {\n \"source\": \"Automation\"\n },\n \"automation_id\": \"auto_McXM3rjWcPwaNU5ndIIP13jX\",\n \"group_id\": \"v-0a26b921779d7eebcb\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json \n{\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:53:09.910Z\",\n \"type\": \"points_redeemed\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 1,\n \"total_failed\": 0,\n \"total_succeeded\": 1,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 218,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 218,\n \"referred_customers\": 0\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:53:07.582Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_aFszQ4kOtT1Hori8Wl1i0az1sFQN3CRv\",\n \"created_at\": \"2021-11-12T11:53:03.172Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"Loyal_customer__01\",\n \"metadata\": {},\n \"channel\": \"API\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"xUgBLQck\",\n \"vouchers\": [\n {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\"\n ],\n \"campaign_name\": \"20% discount\",\n \"gift\": null,\n \"loyalty_card\": null,\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 218\n },\n \"type\": \"LOYALTY_CARD\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_uATcoUjIp3VJNgT5TZT5NMaT\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-11-12T11:53:06.025Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"reward_assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"source_id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"source_type\": \"redemption\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"object\": \"reward\",\n \"name\": \"20% discount\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"reward_id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"related_object_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"related_object_type\": \"campaign\",\n \"parameters\": {\n \"loyalty\": {\n \"points\": 2\n }\n },\n \"created_at\": \"2021-11-12T11:39:05.504Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"type\": \"redemption\"\n },\n \"balance\": null\n },\n \"created_at\": \"2021-11-12T11:53:09.910Z\"\n }\n },\n \"metadata\": {}\n}\n```", + "x-tags": [ + "EVENTS API" + ] + }, + "15_req_track_custom_event": { + "title": "Track Custom Event Request Body", + "type": "object", + "description": "Request schema for tracking a custom event.", + "properties": { + "event": { + "type": "string", + "description": "Event name. This is the same name that you used to define a custom event in the **Dashboard** > **Project Settings** > **Event Schema**." + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "type": "object" + }, + "referral": { + "type": "object", + "description": "If a **conversion event** for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event. ", + "properties": { + "code": { + "type": "string", + "description": "A code through which a new visitor has been referred to a service." + }, + "referrer_id": { + "type": "string", + "description": "Unique ID of the referring person - it is optional and not required if the referral **code** is provided.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } + } + }, + "loyalty": { + "type": "object", + "description": "If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.", + "properties": { + "code": { + "type": "string", + "description": "Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the `event` parameter of the request payload gets sent along with this loyalty card code." } - }, - "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." + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the **Dashboard** > **Project Settings** > **Event Schema** > **Edit particular event** > **Metadata property definition**." + } } }, - "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" + "15_res_track_custom_event": { + "title": "Track Custom Event Request Body", + "type": "object", + "description": "Request schema for tracking a custom event.", + "properties": { + "object": { + "type": "string", + "default": "event", + "description": "The object represented is an `event`." + }, + "type": { + "type": "string", + "description": "The event name." + }, + "customer": { + "type": "object", + "description": "An empty customer object." + }, + "referral": { + "type": "null", + "description": "A `null` referral object." + }, + "loyalty": { + "type": "null", + "description": "A `null` loyalty object." + } + } + }, + "16_obj_export_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\nThe `/exports` endpoint allows you to retrieve Voucherify objects such as [vouchers](ref:get-voucher), [redemptions](ref:list-redemptions), [publications](ref:list-publications), [customers](ref:get-customer), and [orders](ref:get-order) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can [get](ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported and `filter` out the relevant data\n\n\n```json\n{\n \"fields\": [\n \"code\",\n \"voucher_type\"\n ],\n \"filters\": {\n \"categories\": {\n \"conditions\": {\n \"$in\": [\n \"postman\"\n ]\n }\n }\n }\n}\n```\n\n\n## Fields values\nHere is a list of the fields you can export for particular objects. \n| **Object** | **Fields** |\n|:---|:---|\n| voucher | 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
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
metadata
metadata.X *where X is the name of a particular metadata property* |\n| redemption | 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
metadata.X *where X is the name of a particular metadata property* |\n| publication | voucher_code
customer_id
customer_source_id
date
channel
campaign
is_winner
metadata
metadata.X *where X is the name of a particular metadata property* |\n| customer | 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
birthdate
birthday
metadata
metadata.X *where X is the name of a particular metadata property* |\n| order | id
source_id
status
created_at
updated_at
amount
discount_amount
items_discount_amount
total_discount_amount
total_amount
customer_id
referrer_id
metadata
metadata.X *where X is the name of a particular metadata property* |\n| points expiration | id
campaign_id
voucher_id
expires_at
status
points |\n\n\n## Pagination and example request\nVoucherify allows you to specify the timeframe for the records you want to retrieve. Thanks to this mechanism it should be easy to implement a pagination mechanism. See the example of request body: \n\n\n```json Export Redemption Example\n{\n \"exported_object\": \"redemption\",\n \"parameters\": {\n \"order\": \"-created_at\",\n \"fields\": [\n \"id\",\n \"object\",\n \"date\",\n \"voucher_code\",\n \"customer_id\",\n \"result\"\n ],\n \"filters\": {\n \"junction\": \"and\",\n \"created_at\": {\n \"conditions\": {\n \"$after\": [\n \"2018-05-30T22:00:00.000Z\"\n ],\n \"$before\": [\n \"2018-06-29T22:00:00.000Z\"\n ]\n }\n }\n }\n }\n}\n```\n\nAn export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "x-tags": [ + "EXPORTS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "enum": [ + "API", + "WEBSITE" + ] + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "enum": [ + "order", + "voucher", + "publication", + "redemption", + "customer", + "points_expiration", + "voucher_transactions" + ] + }, + "parameters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_export_order" + }, + { + "$ref": "#/components/schemas/16_obj_export_voucher" + }, + { + "$ref": "#/components/schemas/16_obj_export_publication" + }, + { + "$ref": "#/components/schemas/16_obj_export_redemption" + }, + { + "$ref": "#/components/schemas/16_obj_export_customer" + }, + { + "$ref": "#/components/schemas/16_obj_export_points_expiration" + }, + { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + } + ] + }, + "result": { + "type": "object", + "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](ref:download-export) method." } - }, - "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." + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } } }, - "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" + "16_res_list_exports": { + "description": "Response schema for listing exports.", + "type": "object", + "title": "List Exports Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about exports.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of exports.", + "default": "exports" + }, + "exports": { + "type": "array", + "uniqueItems": true, + "description": "An array of export objects.", + "items": { + "$ref": "#/components/schemas/16_obj_export_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of exports." + } } - ] - } - ] - }, - "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." + }, + "16_req_create_export_POST": { + "description": "Request schema for creating an export.", + "type": "object", + "title": "Create Export Request Body", + "properties": { + "exported_object": { + "type": "string", + "description": "The type of object to be exported.", + "enum": [ + "order", + "voucher", + "publication", + "redemption", + "customer", + "points_expiration", + "voucher_transactions" + ] + }, + "parameters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_export_order" + }, + { + "$ref": "#/components/schemas/16_obj_export_voucher" + }, + { + "$ref": "#/components/schemas/16_obj_export_publication" + }, + { + "$ref": "#/components/schemas/16_obj_export_redemption" + }, + { + "$ref": "#/components/schemas/16_obj_export_customer" + }, + { + "$ref": "#/components/schemas/16_obj_export_points_expiration" + }, + { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + } + ] + } } }, - "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" + "16_obj_export_order": { + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data.", + "title": "order", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at", + "updated_at", + "-updated_at", + "status", + "-status" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |", + "items": { + "type": "string" + } + }, + "filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_order_status" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_source_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_total_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_discount_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_total_discount_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_items_discount_amount" + } + ] + } } - ] - } - ], - "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" + }, + "16_obj_export_voucher": { + "description": "List of available fields and filters that can be exported with a voucher along with the sorting order of the returned data.", + "title": "voucher", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] + }, + "fields": { + "type": "array", + "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", + "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", + "metadata" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
`GIFT_VOUCHER`: amount left to spend
`LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| metadata | Returns all voucher metadata. | Response will include all voucher metadata. |\n| metadata.X | Where X is the name of a particular voucher metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |\n", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `categories`\n\n - `vouchers`\n\n - `type`\n\n - `holder_id`\n\n - `is_referral_code`\n\n - `published_for_customer_id`\n\n - `validity_timeframe`\n\n - `category_ids`" } - }, - "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" + }, + "16_obj_export_publication": { + "description": "List of available fields and filters that can be exported with a publication along with the sorting order of the returned data.", + "title": "publication", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at", + "channel", + "-channel" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "voucher_code", + "customer_id", + "customer_source_id", + "date", + "channel", + "campaign", + "is_winner", + "metadata" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Returns all publication metadata. | Response will include all publication metadata. |\n| metadata.X | Where X is the name of a particular publication metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `failure_code`\n\n - `result`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `voucher_type`\n\n - `is_referral_code`\n\n - `parent_object_id`\n\n - `related_object_id`\n\n - `source_id`", + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_publication_failure_code" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_result" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_customer_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_campaign_name" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_voucher_type" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_is_referral_code" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_parent_object_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_related_object_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_source_id" + } + ] } - }, - "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" + "16_obj_export_redemption": { + "description": "List of available fields and filters that can be exported with a redemption along with the sorting order of the returned data.", + "title": "redemption", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Returns all redemption metadata. | Response will include all redemption metadata. |\n| metadata.X | Where X is the name of a particular redemption metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `voucher_code`\n\n - `related_object_id`\n\n - `related_object_parent_id`\n\n - `parent_redemption_id`\n\n - `failure_code`\n\n - `result`\n\n - `object`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `user_login`" } - }, - "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" + "16_obj_export_customer": { + "description": "List of available fields and filters that can be exported with a customer along with the sorting order of the returned data.", + "title": "customer", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "name", + "-name", + "id", + "-id", + "email", + "-email", + "source_id", + "-source_id", + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | |\n| loyalty_referred_customers | How many customers were referred by this customer. | |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| birthdate | Customer's birthdate. | 2022-04-29 |\n| metadata | Returns all customer metadata. | Response will include all customer metadata. |\n| metadata.X | Where X is the name of a particular customer metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `name` (string)\n\n - `email` (string)\n\n - `phone` (string)\n\n - `metadata` (json)\n\n - `metadata.X` (?)\n\n - `address` (json)\n\n - `address.state` (string)\n\n - `address.country` (string)\n\n - `address.postal_code` (string)\n\n - `birthday` (string - date-time)\n\n - `birthdate` (string date-time)\n\n - `created_at` (date)\n\n - `source_id` (string)\n\n - `system.metadata` (json)\n\n - `system.metadata.source` (string)\n\n - `system.metadata.consents.unsubscribed` (boolean)\n\n - `loyalty_points` (json)\n\n - `loyalty` (json)\n\n - `summary.orders.total_amount` (json)\n\n - `summary.orders.last_order_date` (date)\n\n - `summary.orders.last_order_amount` (json)\n\n - `summary.redemptions.gift.redeemed_amount` (integer)\n\n - `summary.redemptions.total_succeeded` (integer)\n\n - `events.cart_abandoned.last_occurred` (integer)\n\n - `events.newsletter_subscribed.count` (integer)\n\n - `events.sign_up.last_occurred` (integer)" } - }, - "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" + "16_obj_export_points_expiration": { + "description": "List of available fields and filters that can be exported with points expirations along with the sorting order of the returned data.", + "title": "points expiration", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ] + ], + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `campaign_id`\n\n - `voucher_id`", + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_points_expiration_campaign_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_points_expiration_voucher_id" + } + ] } - }, - "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" + "16_obj_export_gift_card_transactions": { + "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.", + "title": "gift card transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "items": { + "type": "string" + } + }, + "filters": { + "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id" } - }, - "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" + "16_obj_export_loyalty_card_transactions": { + "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", + "title": "loyalty card transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "items": { + "type": "string" + } + }, + "filters": { + "$ref": "#/components/schemas/16_obj_filter_loyalty_card_transactions_voucher_id" } - }, - "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" + "16_obj_filter_publication_failure_code": { + "description": "Filter conditions set on the publication `failure_code`. Available options are:\n\n - `not_found`,\n\n - `no_voucher_suitable_for_publication`\n\n - `voucher_already_published`\n\n - `duplicate_source_id`\n\n - `too_many_vouchers_requested`", + "title": "Filter by failure code", + "type": "object", + "properties": { + "failure_code": { + "$ref": "#/components/schemas/16_filter_conditions_string" }, - { - "title": "number", - "type": "number" + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_result": { + "description": "Filter conditions set on the publication `result`. Available options are:\n\n - `SUCCESS`\n\n - `FAILURE`", + "title": "Filter by result", + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/16_filter_conditions_string" }, - { - "title": "object", - "type": "object" + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } - ] - } - }, - { - "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" + } }, - { + "16_obj_filter_publication_customer_id": { + "description": "Filter conditions set on the publication `customer_id`.", + "title": "Filter by customer ID", "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" + "customer_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } - } - ] - } - }, - "LoyaltiesCreateTiersResponseBody": { - "title": "Loyalties Create Tiers Response Body", - "x-stoplight": { - "id": "ix7g5mnuwqsp6" - }, - "type": "array", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "LoyaltiesGetRewardAssignmentResponseBody": { - "$ref": "#/components/schemas/RewardAssignment", - "x-stoplight": { - "id": "fnbbaq9l1l9it" - } - }, - "LoyaltiesGetRewardDetailsResponseBody": { - "$ref": "#/components/schemas/Reward", - "x-stoplight": { - "id": "44hds9u0hhukf" - } - }, - "LoyaltiesListTiersRequestQuery": { - "title": "Loyalties List Tiers Request Query", - "x-stoplight": { - "id": "d5sluzqkxu8km" - }, - "type": "object", - "properties": { - "limit": { - "type": "integer", - "minimum": 1, - "multipleOf": 100, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - "page": { - "type": "integer", - "description": "Which page of results to return." - }, - "order": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ], - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - } - }, - "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { - "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", - "x-stoplight": { - "id": "zs0z1cyyzac9u" - }, - "type": "object", - "properties": { - "limit": { - "type": "integer", - "minimum": 1, - "multipleOf": 100, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - "page": { - "type": "integer", - "description": "Which page of results to return." - } - } - }, - "LoyaltiesGetTierResponseBody": { - "$ref": "#/components/schemas/LoyaltyTier", - "x-stoplight": { - "id": "hzcsijl2b4d5o" - } - }, - "LoyaltiesListTiersResponseBody": { - "title": "Loyalties List Tiers Response Body", - "x-stoplight": { - "id": "kw06g2szvv479" - }, - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "description": "This is an object representing a loyalty tier. Loyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "LoyaltiesListMemberLoyaltyTiersResponseBody": { - "title": "Loyalties List Member Loyalty Tiers Response Body", - "x-stoplight": { - "id": "s3zpgud510xl6" - }, - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "EarningRule": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" - }, - { - "type": "object", - "properties": { - "validation_rule_id": { - "type": [ - "string", - "null" - ], - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.\n\n- `true` indicates an active earning rule\n- `false` indicates an inactive earning rule" + }, + "16_obj_filter_publication_campaign_name": { + "description": "Filter conditions set on the publication `campaign_name`.", + "title": "Filter by campaign name", + "type": "object", + "properties": { + "campaign_name": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } }, - "required": [ - "validation_rule_id", - "updated_at", - "active" - ] - } - ] - }, - "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { - "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", - "x-stoplight": { - "id": "i180zbh3ffwaa" - }, - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of earning rule objects." - }, - "data": { - "type": "array", - "description": "Contains array of earning rule objects.", - "items": { - "$ref": "#/components/schemas/EarningRule" - } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "LoyaltyTierBase": { - "title": "Loyalty Tier Base", - "x-stoplight": { - "id": "3af9422223696" - }, - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "earning_rules": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MappingPoints" + "16_obj_filter_publication_voucher_type": { + "description": "Filter conditions set on the publication `voucher_type`.", + "title": "Filter by voucher type", + "type": "object", + "properties": { + "voucher_type": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } }, - "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" + "16_obj_filter_publication_is_referral_code": { + "description": "Filter conditions set on the publication `is_referral_code`.", + "title": "Filter if the code is a referral code", + "type": "object", + "properties": { + "is_referral_code": { + "$ref": "#/components/schemas/16_filter_conditions_boolean" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } }, - "description": "Contains a list of reward IDs and their points mapping for the given reward." - }, - "points": { - "type": "object", - "description": "Defines range of loyalty tier in points.", - "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." - }, - "to": { - "type": "integer", - "description": "Top points threshold value." + "16_obj_filter_publication_parent_object_id": { + "description": "Filter conditions set on the publication `parent_object_id`, which is the parent campaigns unique ID assigned by Voucherify.", + "title": "Filter by parent object ID", + "type": "object", + "properties": { + "parent_object_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - }, - "required": [ - "name", - "points" - ] - }, - "LoyaltyTier": { - "allOf": [ - { - "$ref": "#/components/schemas/LoyaltyTierBase" - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID." - }, - "campaign_id": { - "type": "string", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in points.", - "required": [ - "points" - ], - "properties": { - "points": { - "type": "object", - "description": "Defines range of loyalty tier in points.", - "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." - }, - "to": { - "type": "integer", - "description": "Top points threshold value." - } - } - } + }, + "16_obj_filter_publication_related_object_id": { + "description": "Filter conditions set on the publication `related_object_id`.", + "title": "Filter by related object ID", + "type": "object", + "properties": { + "related_object_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } - }, - "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" - } + } + }, + "16_obj_filter_publication_source_id": { + "description": "Filter conditions set on the publication `source_id`.", + "title": "Filter by publication source ID", + "type": "object", + "properties": { + "source_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" }, - "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." + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } }, - "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", - "description": "Request body schema for importing data using a CSV file.", - "format": "binary", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "File path." - } - }, - "required": [ - "file" - ] - }, - "a_res_async_actions": { - "type": "object", - "title": "Asynchronous Actions", - "description": "Response to requests that are processed asynchronously.", - "additionalProperties": false, - "examples": [ - { - "async_action_id": "aa_0a875d56c805df6601" - } - ], - "properties": { - "async_action_id": { - "type": "string", - "example": "aa_0a875d56c805df6601", - "description": "The ID of the scheduled asynchronous action." - } - }, - "required": [ - "async_action_id" - ] - }, - "error": { - "title": "error", - "type": "object", - "properties": {}, - "discriminator": { - "propertyName": "key", - "mapping": { - "not_enough_codes": "not_enough_codes" - } - }, - "description": "Short error response", - "examples": [] - }, - "e_error": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "error": { - "type": "object", - "description": "Contains custom user-defined error message translation.", - "properties": { - "message": { - "type": "string", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + "16_obj_filter_order_status": { + "description": "Filter conditions set on the order `status`.", + "title": "Filter by status", + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_source_id": { + "description": "Filter conditions set on the order `source_id`.", + "title": "Filter by order source ID", + "type": "object", + "properties": { + "source_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_amount": { + "description": "Filter conditions set on the order `amount`.", + "title": "Filter by order amount", + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - } - }, - "e_error_expanded": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Unique resource ID that can be used in another endpoint to get more details.", - "example": "rf_0c5d710a87c8a31f86" - }, - "resource_type": { - "type": "string", - "description": "The resource type.", - "example": "redemption" - }, - "error": { - "type": "object", - "description": "Contains custom user-defined error message translation.", - "properties": { - "message": { - "type": "string", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + }, + "16_obj_filter_order_total_amount": { + "description": "Filter conditions set on the order `total_amount`.", + "title": "Filter by order total amount", + "type": "object", + "properties": { + "total_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - } - }, - "e_error_no_translation": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_integration_key": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - } - } - }, - "e_400_missing_param": { - "description": "Error: Bad Request → Missing Parameters", - "type": "object", - "title": "Missing Parameters", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_param", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing required parameter", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Parameter 'custom_event.schema_id' is required", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96c19b1a41c03999", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_not_enough_source_ids": { - "description": "Error: Bad Request → Missing Parameters", - "type": "object", - "title": "Not Enough Source ID's", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_enought_source_ids", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Not enough source_ids", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Specify at least 1 source_id", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96c19b1a41c03999", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_payload": { - "title": "Invalid Payload", - "type": "object", - "description": "Error: Bad Request → Invalid Payload", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_payload", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid payload", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_balance": { - "title": "Invalid Balance", - "type": "object", - "description": "Error: Bad Request → Invalid Balance", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_balance", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_resource_in_use": { - "title": "Resource in use", - "type": "object", - "description": "Error: Bad Request - Resource in use", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "resource_in_use", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Resource in use", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "related_object_ids": { - "type": "array", - "description": "Name or ID of the resources that are related.", - "items": { - "type": "string", - "example": "rewa_5WV7H3y2lT3GGl03Xjw29IEc" - } - }, - "related_object_type": { - "type": "string", - "description": "Specifies the type of resource that is related." - } - } - }, - "e_400_invalid_export_fields": { - "title": "Invalid Export Fields", - "type": "object", - "description": "Error: Bad Request → Invalid Export Fields", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_export_fields", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid Export", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_voucher": { - "title": "Invalid Voucher", - "type": "object", - "description": "Error: Bad Request → Invalid Voucher", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_voucher", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid Voucher", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_validation_rules": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code.", - "default": 400 - }, - "key": { - "type": "string", - "default": "invalid_validation_rules", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - } - }, - "title": "Invalid Validation Rules", - "description": "Error: Bad Request → Invalid Validation Rules" - }, - "e_400_not_enough_codes": { - "title": "Not Enough Codes", - "type": "object", - "description": "Error: Bad Request → Not enough codes", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_enough_codes", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Not enough codes", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Specify at least 1 code in codes.", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_metadata_validation_failed": { - "title": "Metadata Validation Failed", - "type": "object", - "description": "Error: Bad Request → Metadata validation failed", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "metadata_validation_failed", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Metadata validation failed", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Ranking: must be a number (actual value is 'true')", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_missing_reward": { - "title": "Missing Reward", - "type": "object", - "description": "Error: Bad Request → Missing Reward", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_reward", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing reward", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "A reward is required when redeeming a LOYALTY_CARD", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." - }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." - }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "Missing reward = please add one.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + }, + "16_obj_filter_order_discount_amount": { + "description": "Filter conditions set on the order `discount_amount`.", + "title": "Filter by order discount amount", + "type": "object", + "properties": { + "discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - } - }, - "e_400_missing_order": { - "title": "Missing Order", - "type": "object", - "description": "Error: Bad Request → Missing Order", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_order", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing order", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "An order is required when redeeming a LOYALTY_CARD", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." - }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." - }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "Missing order = please add one.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + }, + "16_obj_filter_order_total_discount_amount": { + "description": "Filter conditions set on the order `total_discount_amount`.", + "title": "Filter by order total discount amount", + "type": "object", + "properties": { + "total_discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - } - }, - "e_400_loyalty_card_points_exceeded": { - "title": "Loyalty Card Points Exceeded", - "type": "object", - "description": "Error: Bad Request → Loyalty Card Points Exceeded", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "loyalty_card_points_exceeded", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "loyalty card points exceeded", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "SoAm6kbC", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." - }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." - }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "There are not enough loyalty points on the card.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + }, + "16_obj_filter_order_items_discount_amount": { + "description": "Filter conditions set on the order `items_discount_amount`.", + "title": "Filter by order items discount amount", + "type": "object", + "properties": { + "items_discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } } - } - } - } - }, - "e_403_wrong_api_endpoint": { - "title": "Wrong API Endpoint", - "type": "object", - "description": "Error: Forbidden → Wrong API Endpoint", - "properties": { - "code": { - "type": "integer", - "default": 403, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "wrong_api_endpoint", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Wrong API endpoint", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Given project is bound to different API endpoint, you should use: https://api.voucherify.io", - "description": "A human-readable message providing more details about the error." - } - } - }, - "e_404_not_found": { - "description": "Error: Not Found", - "type": "object", - "title": "Not Found", - "properties": { - "code": { - "type": "integer", - "default": 404, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_found", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Resource not found", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96cd820301c0483a", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Name or ID of the resource that was not found." - }, - "resource_type": { - "type": "string", - "description": "Specifies the type of resource that was not found." - } - } - }, - "e_409_duplicate_found": { - "title": "Duplicated Resource", - "type": "object", - "description": "Error: Conflict → Duplicated resource found", - "properties": { - "code": { - "type": "integer", - "default": 409, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_found", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicated resource found", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Name or ID of the resource that already exists." - }, - "resource_type": { - "type": "string", - "description": "Specifies the type of resource that already exists." - } - } - }, - "e_400_duplicate_key": { - "title": "Duplicated Key", - "type": "object", - "description": "Error: Conflict → Duplicated key found", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_key", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicate codes", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_duplicate_source_id": { - "title": "Duplicate Source ID", - "type": "object", - "description": "Error: Conflict → Duplicate source_id found", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_source_id", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicate source_id", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "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" + }, + "16_obj_filter_points_expiration_campaign_id": { + "description": "Filter conditions set on`the `campaign_id`.", + "title": "Filter by campaign ID", + "type": "object", + "properties": { + "campaign_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_points_expiration_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_gift_card_transactions_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_loyalty_card_transactions_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_filter_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.", + "title": "Logical Operator Between Filters", + "type": "string", + "enum": [ + "AND", + "OR" + ] + }, + "16_filter_conditions_string": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + } + } + } + } + }, + "16_filter_conditions_number": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "integer" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "integer" + } + }, + "$is": { + "type": "integer", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "integer", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$more_than": { + "type": "integer", + "description": "Value is more than the specified number." + }, + "$more_than_equal": { + "type": "integer", + "description": "Value is more than or equal to the specified number." + }, + "$less_than": { + "type": "integer", + "description": "Value is less than the specified number." + }, + "$less_than_equal": { + "type": "integer", + "description": "Value is less than or equal to the specified number." + } + } + } + } + }, + "16_filter_conditions_array": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + }, + "$count": { + "type": "integer", + "description": "Value has exactly this number of elements." + }, + "$count_less": { + "type": "integer", + "description": "Value has less than this number of elements." + }, + "$count_more": { + "type": "integer", + "description": "Value has more than this number of elements." + }, + "$contains": { + "type": "string", + "description": "Array contains this element." + } + } + } } - ] - } - ] - }, - "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": { + }, + "16_filter_conditions_boolean": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "16_filter_conditions_date": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$after": { + "type": "string", + "description": "Value is after this date. Value for this parameter is in ISO 8601 format." + }, + "$before": { + "type": "string", + "description": "Value is before this date. Value for this parameter is in ISO 8601 format." + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "16_filter_conditions_date_time": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$after": { + "type": "string", + "description": "Value is after this date. Value for this parameter is in ISO 8601 format.", + "format": "date-time" + }, + "$before": { + "type": "string", + "description": "Value is before this date. Value for this parameter is in ISO 8601 format.", + "format": "date-time" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "17_obj_async_action_object": { + "title": "Async Action Object", "type": "object", + "description": "This is an object representing an asynchronous action.", + "x-tags": [ + "ASYNC ACTIONS API" + ], "properties": { "id": { - "type": "string" + "type": "string", + "example": "aa_0adad13d6f057f088e", + "description": "Async action unique ID." }, - "product_id": { - "type": "string" + "type": { + "type": "string", + "description": "Type of async action.", + "enum": [ + "CAMPAIGN.VOUCHERS_IMPORT", + "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "CAMPAIGN.VOUCHERS_UPDATE", + "CAMPAIGN.VOUCHERS_DELETE", + "CAMPAIGN.VOUCHERS_GENERATE", + "CAMPAIGNS.METADATA_KEY_PURGE", + "CUSTOMERS.IMPORT_CSV", + "CUSTOMERS.BULK_UPDATE", + "CUSTOMERS.METADATA_UPDATE", + "CUSTOMERS.METADATA_KEY_PURGE", + "PRODUCTS.BULK_UPDATE", + "PRODUCTS.METADATA_UPDATE", + "PRODUCTS.METADATA_KEY_PURGE", + "PRODUCTS.IMPORT_CSV", + "SKUS.IMPORT_CSV", + "VOUCHERS.IMPORT", + "VOUCHERS.IMPORT_CSV", + "VOUCHERS.BULK_UPDATE", + "VOUCHERS.METADATA_UPDATE", + "VOUCHERS.METADATA_KEY_PURGE", + "ORDERS.IMPORT", + "ORDERS.METADATA_KEY_PURGE" + ] }, - "object": { + "status": { + "type": "string", + "description": "Status of async action. Informs you whether the async action has already been completed.", "enum": [ - "sku", - "product" + "ENQUEUED", + "IN_PROGRESS", + "DONE", + "FAILED" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_delete" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_generate" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_skus_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_metadata_key_purge" + } ] + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", + "example": "2022-06-23T11:21:45.578Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-06-23T11:21:46.795Z", + "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", + "format": "date-time" + }, + "request_id": { + "type": "string", + "example": "v-0b45cee140c3c9b5ca", + "description": "Unique request ID." + }, + "processing_time": { + "type": "integer", + "example": 1217, + "description": "The length of time it took to process the request in milliseconds." + }, + "progress": { + "type": "integer", + "description": "% progress to completion of the asynchronous action.", + "minimum": 0, + "maximum": 100 + }, + "object": { + "type": "string", + "default": "async_action", + "description": "The type of object represented by JSON. This object stores information about the `async_action`." } - }, - "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": { - "req_vouchers_metadata_1": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726" - ], - "metadata": { - "lang": "en", - "authorized_internally": true - } - } - }, - "req_vouchers_metadata_2": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726", - "PROMO-CODE888" - ], - "metadata": { - "lang": "en", - "authorized_internally": true - } - } - }, - "res_async_actions": { - "value": { - "async_action_id": "aa_0ab2df092385be5ca5" - } - } - } - }, - "paths": { - "/v1/voucher-object": { - "get": { - "operationId": "voucher-object", - "tags": [ - "VOUCHERS API" - ], - "summary": "Voucher Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Voucher Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "17_res_list_async_actions_GET": { + "description": "Response body schema for listing asynchronous actions. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action.\n\n| **Types by Context** |\n|:---|\n| **CAMPAIGN** |\n| CAMPAIGN.VOUCHERS_IMPORT
CAMPAIGN.VOUCHERS_IMPORT_CSV
CAMPAIGN.VOUCHERS_UPDATE
CAMPAIGN.VOUCHERS_DELETE
CAMPAIGN.VOUCHERS_GENERATE |\n| **CUSTOMERS** |\n| CUSTOMERS.IMPORT_CSV
CUSTOMERS.BULK_UPDATE
CUSTOMERS.METADATA_UPDATE
CUSTOMERS.METADATA_KEY_PURGE |\n| **PRODUCTS** |\n| PRODUCTS.BULK_UPDATE
PRODUCTS.METADATA_UPDATE
PRODUCTS.METADATA_KEY_PURGE
PRODUCTS.IMPORT_CSV
SKUS.IMPORT_CSV |\n| **VOUCHERS** |\n| VOUCHERS.IMPORT
VOUCHERS.IMPORT_CSV
VOUCHERS.BULK_UPDATE
VOUCHERS.METADATA_UPDATE
VOUCHERS.METADATA_KEY_PURGE |", + "type": "object", + "examples": [ + { + "object": "list", + "data_ref": "async_actions", + "async_actions": [ + { + "id": "aa_0ae2af6a38161f8c79", + "type": "CAMPAIGN.VOUCHERS_DELETE", + "status": "DONE", + "created_at": "2022-04-07T11:34:39.072Z", + "object": "async_action" + }, + { + "id": "aa_0ae27a55b696a4e0f0", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "created_at": "2022-04-07T07:42:44.442Z", + "object": "async_action" + }, + { + "id": "aa_0adad13d6f057f088e", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "created_at": "2022-04-01T08:54:35.196Z", + "object": "async_action" + }, + { + "id": "aa_0adacc81de057f084c", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "created_at": "2022-04-01T08:33:54.552Z", + "object": "async_action" + } + ] + } + ], + "title": "List Async Actions Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about asynchronous actions.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "async_actions", + "description": "Identifies the name of the JSON property that contains the array of asynchronous actions." + }, + "async_actions": { + "type": "array", + "description": "An array of async actions.", + "items": { + "type": "object", + "additionalProperties": false, + "description": "Contains an async action definition.", + "properties": { + "id": { + "type": "string", + "description": "Async action unique ID.", + "example": "aa_0ae2af6a38161f8c79" + }, + "type": { + "type": "string", + "description": "Type of async action.", + "enum": [ + "CAMPAIGN.VOUCHERS_IMPORT", + "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "CAMPAIGN.VOUCHERS_UPDATE", + "CAMPAIGN.VOUCHERS_DELETE", + "CAMPAIGN.VOUCHERS_GENERATE", + "CUSTOMERS.IMPORT_CSV", + "CUSTOMERS.BULK_UPDATE", + "CUSTOMERS.METADATA_UPDATE", + "CUSTOMERS.METADATA_KEY_PURGE", + "PRODUCTS.BULK_UPDATE", + "PRODUCTS.METADATA_UPDATE", + "PRODUCTS.METADATA_KEY_PURGE", + "PRODUCTS.IMPORT_CSV", + "SKUS.IMPORT_CSV", + "VOUCHERS.IMPORT", + "VOUCHERS.IMPORT_CSV", + "VOUCHERS.BULK_UPDATE", + "VOUCHERS.METADATA_UPDATE", + "VOUCHERS.METADATA_KEY_PURGE" + ] + }, + "status": { + "type": "string", + "description": "Status of async action. Informs you whether the async action has already been completed.", + "enum": [ + "ENQUEUED", + "IN_PROGRESS", + "DONE", + "FAILED" + ] + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", + "example": "2022-04-07T07:42:44.442Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", + "example": "2022-06-22T07:58:21.703Z", + "format": "date-time" + }, + "request_id": { + "type": "string", + "example": "v-0ba50a7feb4998490", + "description": "Unique request ID." + }, + "progress": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "description": "% progress to completion of the asynchronous action." + }, + "object": { + "type": "string", + "default": "async_action", + "description": "The type of object represented by each nested object in the JSON async_actions array. This object stores information about the `async_action`." + } + } + } } } - } - } - } - } - }, - "/v1/vouchers": { - "get": { - "operationId": "list-vouchers", - "tags": [ - "VOUCHERS API" - ], - "summary": "List Vouchers", - "description": "Returns a list of your vouchers. By default, the vouchers are returned sorted by creation date, with the most recent vouchers appearing first. A maximum of 10 vouchers are returned in the response.\n\nWhen you get a list of vouchers, you can optionally specify query parameters to customize the amount of vouchers returned per call using `limit`, which page of vouchers to return using `page`, sort the vouchers using the `order` query parameter and more.\n\nThis method will return an error when trying to return a limit of more than 100 vouchers.\n", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/category" - }, - { - "in": "query", - "name": "campaign_id", - "description": "Limit search results to vouchers within the specified campaign", - "schema": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3" - } - }, - { - "$ref": "#/components/parameters/customer" - }, - { - "$ref": "#/components/parameters/campaign" - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary that contains an array of vouchers. Each entry in the array is a separate voucher object. If no more vouchers are available (query parameter `page` incremented over and above the voucher count), the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_GET" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "vouchers", - "vouchers": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - }, - { - "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "code": "AmountDiscount", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 400, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-01T00:00:00.000Z", - "expiration_date": "2022-10-31T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-12T07:51:02.145Z", - "updated_at": "2022-09-19T08:29:12.566Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/AmountDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AmountDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - ], - "total": 2 + "17_res_obj_get_async_action_result_message": { + "title": "Message", + "type": "object", + "description": "Result schema with message.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + } + } + }, + "17_res_obj_get_async_action_result_message_failed": { + "title": "Message with Failed Array", + "type": "object", + "description": "Result schema with message and failed array.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": {} + } + } + }, + "17_res_obj_get_async_action_result_code_updated_found": { + "title": "Code Updated and Found", + "type": "object", + "description": "Result schema with an array of code, updated, and found parameters.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." + }, + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_import": { + "title": "CAMPAIGN.VOUCHERS_IMPORT", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_import_csv": { + "title": "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "row": { + "type": "integer", + "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } } } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." } } - } - } - } - } - }, - "/v1/vouchers/{code}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "7fjWdr" - }, - "in": "path", - "name": "code", - "description": "A unique **code** that identifies the voucher.", - "required": true - } - ], - "get": { - "operationId": "get-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Get Voucher", - "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "17_res_obj_get_async_action_result_campaign_vouchers_update": { + "title": "CAMPAIGN.VOUCHERS_UPDATE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_UPDATE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Card": { - "value": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": null, - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 55000, - "balance": 44700, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2022-08-29T09:37:20.185Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Amount Discount": { - "value": { - "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "code": "AMOUNTDISCOUNTUSINGFORMULA", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 400, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-01T00:00:00.000Z", - "expiration_date": "2022-10-31T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-12T07:51:02.145Z", - "updated_at": "2022-09-19T08:29:12.566Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_tO5AuzXIkkNPTC50", - "rule_id": "val_5h0wc453_2", - "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "related_object_type": "voucher", - "created_at": "2022-09-19T08:27:59.160Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_delete": { + "title": "CAMPAIGN.VOUCHERS_DELETE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_DELETE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_generate": { + "title": "CAMPAIGN.VOUCHERS_GENERATE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_GENERATE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_metadata_key_purge": { + "title": "CAMPAIGNS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a CAMPAIGNS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_import_csv": { + "title": "CUSTOMERS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a CUSTOMERS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique customer ID from your inventory system as indicated in the CSV file." }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" + "row": { + "type": "integer", + "description": "The CSV file row number where the customer is recorded. The row counter excludes the file headers row." }, - "object": "voucher" + "reason": { + "type": "string", + "description": "Detailed failure cause for the customer import." + } } - }, - "Percent Discount": { - "value": { - "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "code": "PercentDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 3, - "percent_off_formula": "CUSTOMER_METADATA(\"age\")", - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-15T10:20:46.467Z", - "updated_at": "2022-09-15T10:43:51.116Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_EuYasM5fyDR9G2r4", - "rule_id": "val_0k19OQHjNZRT", - "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "related_object_type": "voucher", - "created_at": "2022-09-15T10:20:46.460Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 3, - "object": "list", - "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_customers_bulk_update": { + "title": "CUSTOMERS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a CUSTOMERS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique customer `source_id`." }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "object": "voucher" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } } - }, - "Fixed Discount": { - "value": { - "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", - "code": "FixedDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ORDER", - "fixed_amount": 200, - "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" - } + } + }, + "done_count": { + "type": "integer", + "description": "Number or resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_metadata_update": { + "title": "CUSTOMERS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a CUSTOMERS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique customer `source_id`." }, - "is_referral_code": false, - "created_at": "2022-09-15T12:46:55.818Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "redemption": { - "quantity": null, - "redeemed_quantity": 5, - "object": "list", - "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_metadata_key_purge": { + "title": "CUSTOMERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a CUSTOMERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_bulk_update": { + "title": "PRODUCTS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a PRODUCTS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique product `source_id`." }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "object": "voucher" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } } - }, - "Unit Discount": { - "value": { - "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", - "code": "UnitDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", - "unit_type": "sku_0b661e41eccd35a8e9", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" - }, - "barcode": { - "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-15T13:36:27.838Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_metadata_update": { + "title": "PRODUCTS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a PRODUCTS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique product `source_id`." }, - "redemption": { - "quantity": null, - "redeemed_quantity": 5, - "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_metadata_key_purge": { + "title": "PRODUCTS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a PRODUCTS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources updated successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_import_csv": { + "title": "PRODUCTS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a PRODUCTS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "description": "Contains the details regarding a CSV file line item failed import.", + "properties": { + "row": { + "type": "integer", + "description": "The CSV file row number where the product definition is recorded. The row counter excludes the file headers row." }, - "object": "voucher" + "reason": { + "type": "string", + "description": "Detailed failure cause for the product import." + } } - }, - "Multiple Unit Discount": { - "value": { - "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", - "code": "UnitDiscountUsingFormulaForMultipleProductVariants", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 3, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "unit_type": "sku_0b661e41fc8d35a8f7", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 4, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", - "unit_type": "sku_0b661e41fc8d35a8f6", - "effect": "ADD_NEW_ITEMS" - } - ] + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_skus_import_csv": { + "title": "SKUS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a SKUS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result.", + "example": "2 sku(s) imported successfully, 6 failed." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "description": "Contains the details regarding a CSV file line item failed import.", + "properties": { + "row": { + "type": "integer", + "description": "The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.", + "example": 2 }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" - } + "reason": { + "type": "string", + "description": "Detailed failure cause for the SKU import.", + "example": "Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]" + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_import": { + "title": "VOUCHERS.IMPORT", + "type": "object", + "description": "Result schema for a VOUCHERS.IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "description": "If any records failed during the process, this array shows the failure details.", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_import_csv": { + "title": "VOUCHERS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a VOUCHERS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." }, - "is_referral_code": false, - "created_at": "2022-09-16T05:44:50.722Z", - "updated_at": "2022-09-19T09:25:17.303Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "row": { + "type": "integer", + "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." }, - "redemption": { - "quantity": null, - "redeemed_quantity": 3, - "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_bulk_update": { + "title": "VOUCHERS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a VOUCHERS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "object": "voucher" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } } - }, - "Free Shipping": { - "value": { - "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", - "code": "FreeShipping", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" - }, - "barcode": { - "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" - } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_metadata_update": { + "title": "VOUCHERS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a VOUCHERS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." }, - "is_referral_code": false, - "created_at": "2022-09-16T07:19:53.945Z", - "updated_at": "2022-09-16T07:26:35.361Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_metadata_key_purge": { + "title": "VOUCHERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a VOUCHERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_orders_import": { + "title": "ORDERS.IMPORT", + "type": "object", + "description": "Result schema for a ORDERS.IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "description": "If any records failed during the process, this array shows the failure details.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique order source ID." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_orders_metadata_key_purge": { + "title": "ORDERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a ORDERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "18_res_list_consents_GET": { + "description": "Response body schema for listing consents.", + "type": "object", + "examples": [ + { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" + } + ], + "total": 2 + }, + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" }, - "object": "voucher" + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" + } + ], + "total": 2 + } + } + ], + "title": "List Consents Response Body", + "properties": { + "groups": { + "type": "object", + "description": "Contains marketing permission groups' definitions.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "Stores information about marketing permission groups." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of marketing permission groups." + }, + "data": { + "type": "array", + "description": "An array of marketing permission groups.", + "items": { + "type": "object", + "additionalProperties": false, + "description": "Contains a marketing permission group's definition.", + "properties": { + "id": { + "type": "string", + "example": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "description": "Unique group ID." + }, + "name": { + "type": "string", + "description": "Marketing permission group name." + }, + "description": { + "type": "string", + "description": "Marketing permission group category." + }, + "consents": { + "type": "array", + "description": "List of consents that are assigned to the group.", + "items": { + "type": "string" + } + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-04-13T09:12:47.743Z", + "description": "Timestamp representing the date and time when the group was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-05-14T09:11:27.037Z", + "description": "Timestamp representing the date and time when the group was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "default": "consent_group", + "description": "Stores information about a marketing permission group." + } + } + } + }, + "total": { + "type": "integer", + "description": "Total number of groups." + } + } + }, + "consents": { + "type": "object", + "description": "Contains opt-in consents' definitions.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "Stores information about opt-in consents." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of opt-in consents." + }, + "data": { + "type": "array", + "description": "An array of consents.", + "items": { + "type": "object", + "additionalProperties": false, + "description": "Contains an opt-in consent definition.", + "properties": { + "id": { + "type": "string", + "example": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "description": "Unique consent ID." + }, + "name": { + "type": "string", + "description": "Consent name." + }, + "description": { + "type": "string", + "description": "Consent description." + }, + "category": { + "type": "string", + "description": "Consent category." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-04-13T09:11:27.037Z", + "description": "Timestamp representing the date and time when the consent was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-05-14T09:11:27.037Z", + "description": "Timestamp representing the date and time when the consent was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "default": "consent", + "description": "Stores information about an opt-in consent." + } + } + } + }, + "total": { + "type": "integer", + "description": "Total number of consents." } } } } - } - }, - "404": { - "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "20_res_list_categories": { + "type": "object", + "title": "List Categories Response Body", + "description": "Response schema for **GET** `/categories`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about categories in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of category objects.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of categories." + } + } + }, + "20_obj_category_object": { + "type": "object", + "title": "Category Object", + "description": "This is an object representing a category.", + "x-tags": [ + "CATEGORIES API" + ], + "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", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-16T10:52:08.094Z", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "category", + "description": "The type of object represented by the JSON. This object stores information about the category." + } + }, + "examples": [ + { + "id": "cat_0b60cfe7d0d7ddbb55", + "name": "Update", + "hierarchy": 1, + "created_at": "2022-07-14T10:45:13.156Z", + "updated_at": "2022-08-16T11:03:54.727Z", + "object": "category" + } + ] + }, + "20_req_update_categories_categoryId": { + "type": "object", + "title": "Update Category Request Body", + "description": "Request schema for updating a category using **PUT** `/categories/{categoryId}`.", + "properties": { + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + } + }, + "required": [ + "name", + "hierarchy" + ] + }, + "20_req_create_category": { + "type": "object", + "title": "Create Category Request Body", + "description": "Request schema for creating a category using **POST** `/categories`.", + "properties": { + "name": { + "type": "string", + "description": "Category name." }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "request_id": "v-0bb3403b9a158c87b2", - "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "resource_type": "voucher" - } - } + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." } - } - } - } - } - }, - "put": { - "operationId": "update-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Voucher", - "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_PUT" }, - "examples": { - "Percent Discount": { - "value": { - "category": "Second", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "amount_limit": 1800, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-02-01T00:00:00Z", - "expiration_date": "2023-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT2H", - "interval": "P3D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" - } - } - }, - "Gift Card": { - "value": { - "category": "Existing Customers", - "gift": { - "amount": 20000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z", - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" - } - } + "required": [ + "name", + "hierarchy" + ] + }, + "20_res_create_category": { + "type": "object", + "title": "Category Object", + "description": "This is an object representing a newly created category.", + "properties": { + "id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify." }, - "Loyalty Card": { - "value": { - "category": "Existing Customers", - "loyalty_card": { - "points": 20000 - }, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" - } - } + "name": { + "type": "string", + "description": "Category name." }, - "Amount Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "amount_off": 2000, - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." }, - "Fixed Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "type": "FIXED", - "fixed_amount": 2000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" }, - "Unit Discount": { - "value": { - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - } - } + "object": { + "type": "string", + "default": "category", + "description": "The type of object represented by the JSON. This object stores information about the category." } } - } - } - }, - "responses": { - "200": { - "description": "Returns the voucher object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "21_obj_metadata_schema_object": { + "type": "object", + "title": "Metadata Schema Object", + "description": "This is an object representing a metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID.", + "example": "ms_OF36L2rk4EqhdxvZs56IW9iE" }, - "examples": { - "Percent Discount": { - "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", - "campaign": null, - "campaign_id": null, - "category": "Second", - "category_id": "cat_0bb81a481615a37b5e", - "categories": [ - { - "id": "cat_0bb81a481615a37b5e", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-09-20T05:58:01.561Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 1800, - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-02-01T00:00:00.000Z", - "expiration_date": "2023-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "PT2H" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + "related_object": { + "type": "string", + "description": "The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.", + "enum": [ + "campaign", + "customer", + "earning_rule", + "loyalty_tier", + "order", + "order_item", + "product", + "promotion_tier", + "publication", + "redemption", + "reward", + "voucher" + ] + }, + "properties": { + "description": "Contains the metadata definitions. There can be many properties within this object.", + "anyOf": [ + { + "properties": { + "custom_property_name": { + "type": "object", + "description": "Custom property name. This is defined in **Project Settings** > **Metadata Schema** in the Dashboard.", + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "number", + "object", + "date", + "datetime", + "geopoint", + "boolean", + "image_url" + ] + }, + "array": { + "type": "boolean", + "description": "Indicates whether the definition is an array." + }, + "optional": { + "type": "boolean", + "description": "Indicates whether this definition is optional or not optional for the resource." + }, + "objectType": { + "type": [ + "string", + "null" + ], + "description": "Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object." + }, + "eq": { + "type": "array", + "description": "Array of possible values when the setting for `is equal to any of` in the Dashboard is defined explicitly.", + "items": {} + }, + "ne": { + "type": "array", + "description": "Array of values that are not allowed when the setting for `is not equal to any of` in the Dashboard is defined explicitly.", + "items": {} + }, + "lt": { + "type": "integer", + "description": "A property of `number` type must have `less than` this value." + }, + "lte": { + "type": "integer", + "description": "A property of `number` type must be `less than or equal` to this value." + }, + "gt": { + "type": "integer", + "description": "A property of `number` type must be `greater than` this value." + }, + "gte": { + "type": "integer", + "description": "A property of `number` type must be `greater than or equal` to this value." + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the definition was deleted from the schema." + }, + "maxLength": { + "type": "integer", + "description": "Value for maximum length when the setting for `has maximum length of` in the Dashboard is defined explicitly." + }, + "minLength": { + "type": "integer", + "description": "Value indicating minimum length when the setting for `has minimum length of` in the Dashboard is defined explicitly." + }, + "exactLength": { + "type": "integer", + "description": "Value indicating exact length when the setting for `has exact length of` in the Dashboard is defined explicitly." + } + } } - }, - "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": "2022-09-20T06:00:50.202Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 101, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" - }, - "object": "voucher" + } } - }, - "Gift Card": { - "value": { - "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", - "code": "welcomegiftcard", - "campaign": null, - "campaign_id": null, - "category": "Existing Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 20000, - "balance": 20000, - "effect": "APPLY_TO_ITEMS" - }, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:09:49.665Z", - "updated_at": "2022-02-17T11:11:48.071Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" - }, - "object": "voucher" + ], + "type": "object" + }, + "allow_defined_only": { + "type": "boolean", + "description": "Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.\t" + }, + "created_at": { + "type": "string", + "example": "2021-12-03T13:33:44.556Z", + "description": "Timestamp representing the date and time when the metadata schema was created in ISO 8601 format.\t", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-11T08:05:30.695Z", + "description": "Timestamp representing the date and time when the metadata schema was updated in ISO 8601 format.\t", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "metadata_schema", + "description": "The type of object represented by the JSON. This object stores information about the metadata schema." + } + }, + "x-tags": [ + "METADATA SCHEMAS API" + ], + "examples": [ + { + "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", + "related_object": "earning_rule", + "properties": { + "channel_id": { + "type": "string", + "array": true, + "optional": true, + "objectType": null, + "exactLength": 5 + }, + "channel_name": { + "eq": [ + "instagram", + "facebook", + "google", + "twitter", + "linkedin", + "website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "Loyalty Card": { - "value": { - "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", - "code": "welcomeloyalty", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "Existing Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 20000, - "balance": 20000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": "2022-02-17T11:20:12.447Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" - }, - "object": "voucher" + "allow_defined_only": false, + "created_at": "2022-08-25T13:09:59.970Z", + "updated_at": "2022-08-25T13:11:15.704Z", + "object": "metadata_schema" + }, + { + "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", + "related_object": "campaign", + "properties": { + "region": { + "eq": [ + "EMEA", + "AMER", + "APAC" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "Amount Discount": { - "value": { - "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "code": "WelcomeDiscountAmount", - "campaign": null, - "campaign_id": null, - "category": "Existing Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 + "allow_defined_only": false, + "created_at": "2022-08-25T13:12:58.447Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "age": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "city_id": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T11:41:05.236Z", - "updated_at": "2022-02-17T11:45:29.269Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_tDN7MJNayjrf1wyn", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "related_object_type": "voucher", - "created_at": "2022-02-17T11:41:05.210Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" - }, - "object": "voucher" + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null } }, - "Fixed Discount": { - "value": { - "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", - "code": "wou4w1Og", - "campaign": "Fixed", - "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", - "category": "Existing Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS", - "fixed_amount": 2000 - }, - "gift": null, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T11:54:37.766Z", - "updated_at": "2022-02-17T12:04:53.346Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" - }, - "object": "voucher" + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.889Z", + "updated_at": "2022-09-12T07:34:49.163Z", + "object": "metadata_schema" + }, + { + "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", + "related_object": "loyalty_tier", + "properties": { + "level_name": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "audience_restricted": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null } }, - "Unit Discount": { - "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ + "allow_defined_only": false, + "created_at": "2022-08-25T13:14:54.954Z", + "updated_at": "2022-08-25T13:15:24.436Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "card": { + "eq": [ + "Visa", + "MasterCard", + "Other" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "currency": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "ne": [ 1, 2, - 3, - 4, - 5 + 18, + 22 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", - "updated_at": "2022-02-18T06:31:08.630Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 5, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" - }, - "object": "voucher" + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "store_city": { + "eq": [ + "Hampden", + "San Francisco", + "Warsaw" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null } - } - } - } - } - }, - "400": { - "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:47.575Z", + "updated_at": "2022-10-25T10:05:18.978Z", + "object": "metadata_schema" }, - "examples": { - "Invalid Voucher": { - "value": { - "code": 400, - "key": "invalid_voucher", - "message": "Invalid Voucher", - "details": "It is not possible to change Voucher discount type", - "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" + { + "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", + "related_object": "order_item", + "properties": { + "manufacturer_id": { + "gte": 15, + "type": "number", + "array": false, + "optional": true, + "objectType": null } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Delete Voucher", - "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the voucher with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:03.167Z", + "updated_at": null, + "object": "metadata_schema" }, - "examples": { - "Voucher Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id 10OFF", - "request_id": "v-0ae28d3cec96bb1b7e", - "resource_id": "10OFF", - "resource_type": "voucher" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "create-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Create Voucher", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the voucher that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_POST" - }, - "examples": { - "Percentage Discount": { - "value": { - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "percent_off": 10, - "type": "PERCENT", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 10 + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "vendor": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "metadata": { - "test": true, - "locale": "de-en" + "category": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "validation_rules": [ - "val_4j7DCRm2IS59" - ] - } + "location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.298Z", + "updated_at": "2022-07-14T15:53:29.226Z", + "object": "metadata_schema" }, - "Gift Card": { - "value": { - "category": "New Customers", - "type": "GIFT_VOUCHER", - "gift": { - "amount": 10000, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + { + "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", + "related_object": "promotion_tier", + "properties": { + "level": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } - } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:04.937Z", + "updated_at": "2022-09-23T08:51:46.266Z", + "object": "metadata_schema" }, - "Loyalty Card": { - "value": { - "category": "New Customers", - "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 10000 + { + "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", + "related_object": "publication", + "properties": { + "file_uploaded": { + "type": "image_url", + "array": false, + "optional": true, + "objectType": null }, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + "publication_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } - } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:35.534Z", + "updated_at": "2022-09-12T10:26:31.135Z", + "object": "metadata_schema" }, - "Amount Discount with Formula": { - "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 100 + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "metadata": { - "Season": "Spring" + "redemption_location": { + "type": "object", + "array": false, + "optional": true, + "objectType": "Location" } - } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.794Z", + "updated_at": "2022-08-25T13:19:50.497Z", + "object": "metadata_schema" }, - "Percent Discount with Formula": { - "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "amount_limit": 1700, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" + { + "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", + "related_object": "reward", + "properties": { + "reward_type": { + "eq": [ + "MATERIAL", + "PAY-WITH-POINTS", + "DISCOUNT-COUPON", + "GIFT-CARD-CREDITS", + "LOYALTY POINTS" + ], + "type": "string", + "array": false, + "optional": false, + "objectType": null + } + }, + "allow_defined_only": true, + "created_at": "2022-08-25T13:07:13.689Z", + "updated_at": "2022-08-25T13:08:26.696Z", + "object": "metadata_schema" + }, + { + "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", + "related_object": "voucher", + "properties": { + "lang": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "validity_day_of_week": [ - 0, - 1 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 101 + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "metadata": { - "Season": "Fall" + "marketing_text": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "ProductionVoucherCodeMetaData": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null } - } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:23.994Z", + "updated_at": "2022-09-19T14:13:30.590Z", + "object": "metadata_schema" } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + ] + }, + "21_res_list_metadata_shemas": { + "title": "List Metadata Schemas Response Body", + "type": "object", + "description": "Response schema for listing metadata schemas using **GET** `/metadata-schemas`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about metadata schemas in a dictionary.", + "default": "list" }, - "examples": { - "Percentage Discount": { - "value": { - "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "code": "welcome", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", + "default": "schemas" + }, + "schemas": { + "type": "array", + "description": "Array of metadata schema objects.", + "items": { + "$ref": "#/components/schemas/21_obj_metadata_schema_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of metadata schemas." + } + }, + "examples": [ + { + "object": "list", + "data_ref": "schemas", + "schemas": [ + { + "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", + "related_object": "Payment", + "properties": { + "payment_tax": { + "type": "number", + "array": false, + "optional": true, + "objectType": null }, - "barcode": { - "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" + "payment_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "is_referral_code": false, - "created_at": "2022-02-17T09:05:34.668Z", - "updated_at": null, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_74F7QZoYbUoljwQO", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "related_object_type": "voucher", - "created_at": "2022-02-17T09:05:34.642Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcome/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Card": { - "value": { - "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", - "code": "welcomegiftcard", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 10000, - "balance": 10000, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + "allow_defined_only": true, + "created_at": "2022-03-07T11:01:01.747Z", + "updated_at": "2022-03-07T11:01:44.785Z", + "object": "metadata_schema" + }, + { + "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", + "related_object": "campaign", + "properties": { + "Store": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + }, + "locale": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_tag": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_time_tag": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "deleted": true, + "optional": true, + "objectType": null + }, + "height_customer_number": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_country_string": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" + "allow_defined_only": false, + "created_at": "2021-12-03T13:33:44.556Z", + "updated_at": "2022-07-26T13:57:42.288Z", + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "birth_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "CRM_created_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "customer_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "barcode": { - "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.894Z", + "updated_at": "2022-07-14T15:15:34.928Z", + "object": "metadata_schema" + }, + { + "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", + "related_object": "earning_rule", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "minLength": 6, + "objectType": null } }, - "is_referral_code": false, - "created_at": "2022-02-17T09:09:49.665Z", + "allow_defined_only": false, + "created_at": "2022-07-27T08:54:07.980Z", "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Loyalty Card": { - "value": { - "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", - "code": "welcomeloyalty", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "New Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 10000, - "balance": 10000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + "object": "metadata_schema" + }, + { + "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", + "related_object": "loyalty_tier", + "properties": { + "has_funds": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } }, - "assets": { - "qr": { - "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" + "allow_defined_only": false, + "created_at": "2022-03-30T06:22:16.685Z", + "updated_at": "2022-07-27T08:55:01.628Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "Payment": { + "type": "object", + "array": false, + "deleted": true, + "optional": true, + "objectType": "Payment" + }, + "day_of_week": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null }, - "barcode": { - "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "number_of_store_visits": { + "type": "number", + "array": false, + "optional": true, + "objectType": null } }, - "is_referral_code": false, - "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Amount Discount with Formula": { - "value": { - "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", - "code": "amount1", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.798Z", + "updated_at": "2022-04-20T06:47:10.350Z", + "object": "metadata_schema" + }, + { + "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", + "related_object": "order_item", + "properties": { + "Size": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Color": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Thickness": { + "eq": [ + "Thin", + "Medium", + "Thick" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "metadata": { - "Season": "Spring" }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" + "allow_defined_only": false, + "created_at": "2022-03-11T13:32:55.029Z", + "updated_at": "2022-05-23T13:46:01.463Z", + "object": "metadata_schema" + }, + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "color": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "origin": { + "type": "string", + "array": false, + "optional": true, + "minLength": 1, + "objectType": null + }, + "product_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_date_property": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_number_property": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_boolean_property": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null }, - "barcode": { - "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" + "metadata_attribute_name_with_datetime_property": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null } }, - "is_referral_code": false, - "created_at": "2022-09-19T14:22:50.552Z", - "updated_at": null, - "redemption": { - "quantity": 100, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/amount1/publications?page=1&limit=10" + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.880Z", + "updated_at": "2022-07-14T15:46:47.994Z", + "object": "metadata_schema" + }, + { + "id": "ms_th8YHt9yFYY1yAA99XOasT5W", + "related_object": "promotion_tier", + "properties": { + "has_budget": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } }, - "object": "voucher" - } - }, - "Percent Discount with Formula": { - "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:21.523Z", + "updated_at": "2022-07-27T08:54:42.909Z", + "object": "metadata_schema" + }, + { + "id": "ms_Z7niydc0OpGjDRL4yB40niXn", + "related_object": "publication", + "properties": { + "year": { + "type": "number", + "array": false, + "optional": true, + "objectType": null } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 1700, - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 0, - 1 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "metadata": { - "Season": "Fall" }, - "assets": { - "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + "allow_defined_only": false, + "created_at": "2022-03-30T06:23:49.715Z", + "updated_at": "2022-04-19T10:28:24.568Z", + "object": "metadata_schema" + }, + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": null, - "redemption": { - "quantity": 101, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.890Z", + "updated_at": "2022-07-26T14:58:24.546Z", + "object": "metadata_schema" + }, + { + "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", + "related_object": "reward", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "objectType": null, + "exactLength": 4 + } }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + "allow_defined_only": false, + "created_at": "2022-07-27T08:53:32.257Z", + "updated_at": "2022-07-27T08:53:48.542Z", + "object": "metadata_schema" + }, + { + "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", + "related_object": "voucher", + "properties": { + "unit": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Region": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "CATEGORY": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "active_on_calendar_month": { + "eq": [ + 1, + 2, + 3, + 5, + 7, + 9, + 10, + 11, + 12 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + } }, - "object": "voucher" - } - } - } - } - } - }, - "409": { - "description": "Returns an error if a voucher code already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate Code": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated voucher exists with id CODE", - "request_id": "v-0ae786a8f786b73dfa", - "resource_id": "CODE", - "resource_type": "voucher" + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:01.281Z", + "updated_at": "2022-06-22T07:22:09.577Z", + "object": "metadata_schema" } - } + ], + "total": 13 } - } - } - } - } - } - }, - "/v1/vouchers/": { - "post": { - "operationId": "generate-random-code", - "tags": [ - "VOUCHERS API" - ], - "summary": "Generate Random Code", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the voucher that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers__POST" - }, - "examples": { - "Percentage Discount": { - "value": { - "category": "New Customers", - "code": "NEW-WELCOME-COUPON", - "type": "DISCOUNT_VOUCHER", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", - "discount": { - "percent_off": 10, - "type": "PERCENT", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2016-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 10 - }, - "metadata": { - "test": true, - "locale": "de-en" - }, - "validation_rules": [ - "val_4j7DCRm2IS59" - ] - } + ] + }, + "22_res_list_locations": { + "title": "List Locations Response Body", + "type": "object", + "description": "Response schema for listing locations using **GET** `/locations`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about locations in a dictionary.", + "default": "list" }, - "Gift Card": { - "value": { - "category": "New Customers", - "type": "GIFT_VOUCHER", - "gift": { - "amount": 10000, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "code_config": { - "pattern": "GIFT-CARD-##########", - "prefix": "New-", - "postfix": "0", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - } - } + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", + "default": "data" }, - "Loyalty Card": { - "value": { - "category": "New Customers", - "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 10000 - }, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "code_config": { - "pattern": "LOYALTY-CARD-##", - "prefix": "New-", - "postfix": "1", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - } + "data": { + "type": "array", + "description": "Array of location objects.", + "items": { + "$ref": "#/components/schemas/22_obj_location_object" } }, - "Unit Discount Multiple Items": { - "value": { - "category": "New Customers", - "code": "MultipleUnitTypesUnitDiscount", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 5 - }, - "metadata": { - "test": true, - "locale": "de-en" - } - } + "total": { + "type": "integer", + "description": "Total number of locations." }, - "Unit Discount Single Item": { - "value": { - "category": "New Customers", - "code": "AddMissingItemDiscount", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 3 - } - } + "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 end date filter) to get more records returned in the results." } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Percentage Discount": { - "value": { - "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", - "code": "NEW-WELCOME-COUPON", - "campaign": "Bug fix", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2016-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T07:14:40.096Z", - "updated_at": null, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_COu5PJAsWmAwuCqR", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", - "related_object_type": "voucher", - "created_at": "2022-02-17T07:14:40.280Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Voucher": { - "value": { - "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", - "code": "New-GIFT-CARD-8tqB6FcyhE0", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 10000, - "balance": 10000, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T07:49:10.834Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Loyalty Card": { - "value": { - "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", - "code": "New-LOYALTY-CARD-UC1", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "New Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 10000, - "balance": 10000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" - }, - "barcode": { - "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" + }, + "examples": [ + { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" } }, - "is_referral_code": false, - "created_at": "2022-02-17T08:06:41.091Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Unit Discount Multiple Items": { - "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null + }, + { + "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", + "object": "location", + "name": "New York", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + -74.016167, + 40.703186 + ], + [ + -74.008687, + 40.750656 + ], + [ + -73.943597, + 40.851838 + ], + [ + -73.928559, + 40.845285 + ], + [ + -73.936152, + 40.8356 + ], + [ + -73.934298, + 40.810015 + ], + [ + -73.92711, + 40.795145 + ], + [ + -73.978623, + 40.710432 + ], + [ + -74.013201, + 40.701619 + ], + [ + -74.016167, + 40.703186 + ] + ] + ] } }, - "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", - "updated_at": null, - "redemption": { - "quantity": 5, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Unit Discount Single Item": { - "value": { - "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", - "code": "AddMissingItemDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" + "created_at": "2022-07-15T05:37:45.299Z", + "updated_at": null + }, + { + "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", + "object": "location", + "name": "Germany", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:51.303908897065064,10.222253628401518", + "radius": "192.37 km" } }, - "is_referral_code": false, - "created_at": "2022-02-18T06:46:44.536Z", - "updated_at": null, - "redemption": { - "quantity": 3, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" + "created_at": "2022-07-14T15:51:39.265Z", + "updated_at": null + }, + { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], + [ + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 + ] + ] + ] + } }, - "object": "voucher" + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null } - } + ], + "total": 4, + "has_more": false } - } - } - } - } - } - }, - "/v1/vouchers/{code}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "2CpRCE2c" - }, - "name": "code", - "in": "path", - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.", - "required": true - } - ], - "post": { - "operationId": "enable-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Enable Voucher", - "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThe method sets the voucher state to **active**. The voucher can be redeemed - only if the redemption occurs after the start date and the voucher is not expired.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a voucher object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + ] + }, + "22_obj_location_object": { + "title": "Location object", + "type": "object", + "description": "This is an object representing a location.", + "x-tags": [ + "LOCATIONS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique location ID, assigned by the Voucherify API.", + "example": "loc_NoMGXmHO9OUs7iz9mGWpamma" }, - "examples": { - "Example": { - "value": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2022-09-19T11:54:17.248Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "created_at": "2022-09-19T10:06:07.934Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about a `location`.", + "default": "location" + }, + "name": { + "type": "string", + "description": "Location name." }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" + "shape": { + "type": "object", + "description": "Defines the shape and boundaries of the location.", + "anyOf": [ + { + "$ref": "#/components/schemas/22_obj_location_object_shape_circle" + }, + { + "$ref": "#/components/schemas/22_obj_location_object_shape_polygon" } - } + ] + }, + "created_at": { + "type": "string", + "example": "2022-02-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the location was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-03-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the location was updated in ISO 8601 format.", + "format": "date-time" } } - } - } - } - } - }, - "/v1/vouchers/{code}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "2CpRCE2c" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "disable-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Disable Voucher", - "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThis method sets the voucher state to **inactive**. The voucher cannot be redeemed.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a voucher object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "22_obj_location_object_shape_circle": { + "title": "Circle", + "type": "object", + "description": "This is an object representing a circular shape.", + "properties": { + "type": { + "type": "string", + "description": "The type of shape being defined is a `circle`.", + "default": "circle" }, - "examples": { - "Example": { - "value": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2022-09-19T11:53:23.452Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "created_at": "2022-09-19T10:06:07.934Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" + "format": { + "type": "string", + "description": "The location is defined in terms of a `distance` object.", + "default": "distance" + }, + "distance": { + "type": "object", + "title": "Distance", + "description": "Defines the parameters for the circle.", + "properties": { + "center": { + "type": "string", + "description": "Center of the circle identified by GPS coordinates in decimal degrees.", + "example": "geo:40.79372699823857,-74.15092132694554" + }, + "radius": { + "type": "string", + "description": "Defines the radius of the circle." } } } } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "22_obj_location_object_shape_polygon": { + "title": "Polygon", + "type": "object", + "description": "This is an object representing a polygon.", + "properties": { + "type": { + "type": "string", + "description": "The type of shape being defined is a `polygon`.", + "default": "polygon" + }, + "format": { + "type": "string", + "description": "The location is defined in terms of a `geojson` object.", + "default": "geojson" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" + "distance": { + "type": "object", + "title": "Geojson", + "description": "Defines the parameters for the polygon.", + "properties": { + "type": { + "type": "string", + "description": "Type of geojson coordinates, i.e. `Polygon`.", + "default": "Polygon" + }, + "coordinates": { + "type": "array", + "description": "Contains array of GeoJSON coordinate arrays.", + "items": { + "$ref": "#/components/schemas/22_geojson_array" + } } } } } - } - } - } - } - }, - "/v1/vouchers/{code}/balance": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "GIFT-CARD-1" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "add-remove-gift-voucher-balance", - "tags": [ - "VOUCHERS API" - ], - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "Add or Remove Gift Card Balance", - "description": "Add balance to an existing gift card.", - "requestBody": { - "required": true, - "description": "Provide the amount to be added to/subtracted from the gift card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_balance" + }, + "22_geojson_array": { + "title": "GeoJSON coordinate array.", + "type": "array", + "description": "GeoJSON coordinate array.", + "items": { + "$ref": "#/components/schemas/22_geojson_coordinates" + } + }, + "22_geojson_coordinates": { + "title": "GeoJSON coordinate.", + "type": "array", + "description": "GeoJSON coordinate.", + "items": { + "type": "integer" + } + }, + "22_filter_updated_at": { + "type": "object", + "title": "Updated at", + "properties": { + "updated_at": { + "$ref": "#/components/schemas/16_filter_conditions_date_time" + } }, - "examples": { - "Example": { - "value": { - "amount": 10000 - } + "description": "A filter on the list based on the object `updated_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[updated_at][before]=2017-09-08T13:52:18.227Z`" + }, + "22_filter_created_at": { + "type": "object", + "title": "Created at", + "properties": { + "created_at": { + "$ref": "#/components/schemas/16_filter_conditions_date_time" } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a balance object if the operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_code_balance" - }, - "examples": { - "Example": { - "value": { - "amount": 10000, - "total": 20100, - "balance": 20100, - "type": "gift_voucher", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - } - } - } + }, + "description": "A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`" + }, + "22_filter_name": { + "type": "object", + "title": "Name", + "properties": { + "name": { + "$ref": "#/components/schemas/16_filter_conditions_string" } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "description": "A filter on the list based on the name field." + }, + "22_filter_id": { + "type": "object", + "title": "ID", + "properties": { + "id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + } + }, + "description": "A filter on the list based on the id of the location." + }, + "23_obj_qualification_object": { + "title": "Qualification object", + "type": "object", + "description": "This is an object representing a qualification.", + "x-tags": [ + "QUALIFICATIONS API" + ], + "properties": { + "redeemables": { + "$ref": "#/components/schemas/23_obj_qualification_redeemables" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } + "tracking_id": { + "type": "string", + "description": "This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID." + }, + "order": { + "type": "object", + "description": "The order object sent in the request.", + "$ref": "#/components/schemas/23_obj_order_object" + }, + "stacking_rules": { + "$ref": "#/components/schemas/23_obj_qualification_object_stacking_rules" } } - } - } - } - } - }, - "/v1/vouchers/{code}/transactions": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "GIFT-CARD-1" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "get": { - "operationId": "list-gift-card-transactions", - "tags": [ - "VOUCHERS API" - ], - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "List Gift Card Transactions", - "description": "List transactions that are associated with credit movements on a gift card.", - "responses": { - "200": { - "description": "Returns a dictionary of transaction objects", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_code_transactions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dccc4d5813e71bd", - "source_id": "20230317_subtract_1", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "API", - "reason": "Subtracting credits from card", - "type": "CREDITS_REMOVAL", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128020, - "amount": -2000, - "object": "balance", - "balance": 121020, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T15:50:00.786Z" - }, - { - "id": "vtx_0c9dcc920ac0e9ef82", - "source_id": "20230317_add_1", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "API", - "reason": "Adding more points to card", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130020, - "amount": 20, - "object": "balance", - "balance": 123020, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T15:49:08.768Z" - }, - { - "id": "vtx_0c94f018d30bef6689", - "source_id": "HRwc0oHz_reward", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "cash reward", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": 2000, - "object": "balance", - "balance": 123000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } + }, + "23_obj_order_object": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", + "x-tags": [ + "ORDERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:38:02.055Z" - }, - { - "id": "vtx_0c94edbbaccbef5db6", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REFUND", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": 44, - "object": "balance", - "balance": 121000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", - "source_id": null - }, - "redemption": { - "id": "r_0c94ed583fcafc31c1" - }, - "rollback": { - "id": "rr_0c94edbb8d0bef5d9e" - } + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:27:42.389Z" - }, - { - "id": "vtx_0c94ed584f4afc31da", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REDEMPTION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": -44, - "object": "balance", - "balance": 120956, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", - "source_id": null - }, - "redemption": { - "id": "r_0c94ed583fcafc31c1" - } + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:26:00.640Z" - }, - { - "id": "vtx_0c94e9432c4afc2134", - "source_id": "HRwc0oHz_removal", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "removal", - "type": "CREDITS_REMOVAL", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": -2000, - "object": "balance", - "balance": 121000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:08:10.413Z" - }, - { - "id": "vtx_0c94e8100f8afc1c6c", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REDEMPTION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": -7000, - "object": "balance", - "balance": 123000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_qZX3pEt5rFf5W23qRMDQcVt9", - "source_id": null - }, - "redemption": { - "id": "r_0c94e80fda4afc1c59" - } + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:02:55.935Z" - }, - { - "id": "vtx_0c94e6b82a4bef406c", - "source_id": "walmart", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "return", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": 5000, - "object": "balance", - "balance": 130000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } + "sku": { + "type": "string", + "description": "SKU name." }, - "related_transaction_id": null, - "created_at": "2023-03-10T17:57:03.758Z" + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } } - ], - "has_more": false + } } } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/vouchers/{code}/transactions/export": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "GIFT-CARD-1" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "export-gift-card-transactions", - "tags": [ - "VOUCHERS API" - ], - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "Export Gift Card Transactions", - "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "requestBody": { - "description": "Specify the parameters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "source" - ] + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_ARi2UbRjgfrHQJoVcKFrBUgA", - "object": "export", - "created_at": "2023-05-16T08:30:21.496Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id", - "source" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null - } - }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." } } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "23_obj_qualification_object_stacking_rules": { + "type": "object", + "title": "Examine Qualification Stacking Rules", + "description": "Defines stacking rules for the redeemables.", + "properties": { + "redeemables_limit": { + "type": "integer", + "description": "Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is `30`.", + "default": 30 }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } + "applicable_redeemables_limit": { + "type": "integer", + "description": "Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is `5`.", + "default": 5 } } - } - } - } - } - }, - "/v1/vouchers/import": { - "post": { - "operationId": "import-vouchers", - "tags": [ - "VOUCHERS API" - ], - "summary": "Import Vouchers", - "description": "Import standalone vouchers and gift cards into the repository.\n\n\n\n> 📘 Important notes\n>\n> - **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z.\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\nAny parameters not provided in the payload will be left blank or null.\n\nFor both **standalone discount vouchers and gift cards**, you can import the following fields: \n\n- code\n- category\n- active\n- type\n- start_date\n- expiration_date\n- redemption.quantity\n- additional_info\n- metadata\n\nFor **gift cards**, you can also import the following field:\n\n- gift.amount\n\nFor **discount vouchers**, you can import the `discount` object. The object will slightly vary depending on the type of discount. Each discount type **requires** the `type` to be defined in the import.\n\n| **Discount Type** | **Required fields** |\n|:---|:---|\n| Amount | amount_off, effect |\n| Percent | percent_off, effect |\n| Fixed | fixed_amount, effect |\n| Unit - One item | unit_off, unit_type, effect |\n| Unit - Multiple items | unit_off, unit_type, effect |\n| Shipping | unit_off, unit_type, effect |\n\nFields other than the ones listed above won't be imported. Even if provided, they will be silently skipped.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "The request body is an array of objects. Each object contains details about a specific voucher. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_import" - }, - "examples": { - "Example": { - "value": [ - { - "code": "PROMO-CODE30OFF-NO-EFFECT", - "category": "new customer acquisition", - "type": "DISCOUNT_VOUCHER", - "active": true, - "discount": { - "amount_off": 3000, - "type": "AMOUNT" - }, - "start_date": "2020-12-01T23:00:00Z", - "expiration_date": "2023-12-19T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code1" - }, - { - "code": "PROMO-CODE30-PERCENT-NO-EFFECT", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "percent_off": 30, - "type": "PERCENT" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" - }, + }, + "23_req_create_qualification": { + "type": "object", + "title": "Examine Qualification Request Body", + "description": "Request body schema for examining a qualification`.", + "properties": { + "customer": { + "anyOf": [ { - "code": "GIFT-CARD-100", - "type": "GIFT_VOUCHER", - "active": true, - "category": "new customer acquisition", - "gift": { - "amount": 10000 - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 5 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-GIFT-code2" + "$ref": "#/components/schemas/23_req_create_qualification_customer_id" }, { - "code": "PROMO-CODE1-PERCENT-EFFECT-ORDER", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "percent_off": 30, - "type": "PERCENT", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "$ref": "#/components/schemas/23_req_create_qualification_customer_source_id" }, { - "code": "PROMO-CODE2-PERCENT-EFFECT-ITEM", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "percent_off": 30, - "type": "PERCENT", - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" - }, + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ { - "code": "PROMO-CODE1-PERCENT-NO-EFFECT-REDEEMED-QUANTITY-ATTRIBUTE-DOESNT-GET-PASSED", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "percent_off": 30, - "type": "PERCENT" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1, - "redeemed_quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "$ref": "#/components/schemas/23_req_create_qualification_order_id" }, { - "code": "PROMO-CODE1-AMOUNT-EFFECT-ITEMS-PROPORTIONALLY", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "amount_off": 30, - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "$ref": "#/components/schemas/23_req_create_qualification_order_source_id" }, { - "code": "PROMO-CODE1-FIXED-EFFECT-ORDER", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "fixed_amount": 30, - "type": "FIXED", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"redeemable\"] | - Returns the redeemables' metadata. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "items": { + "type": "string", + "enum": [ + "redeemable", + "category" + ] + } }, - { - "code": "PROMO-CODE1-UNIT-SINGLE-ITEM-EFFECT-MISSING", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "limit": { + "type": "integer", + "description": "The maximum number of redeemables to be returned in the API request. The actual number of returned redeemables will be determined by the API. The default value is set to 5, and the maximum value is 50.", + "maximum": 50 }, - { - "code": "PROMO-CODE2-UNIT-MULTIPLE-ITEMS", - "type": "DISCOUNT_VOUCHER", - "active": true, - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_NEW_ITEMS" - } - ] - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "starting_after": { + "type": "string", + "example": "2021-09-08T13:52:18.227Z", + "format": "date-time", + "description": "Curser used for paging." }, - { - "code": "PROMO-CODE1-SHIPPING", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "filters": { + "description": "A set of fiters to return only a specific category or type of redeemable.", + "anyOf": [ + { + "$ref": "#/components/schemas/23_obj_filter_resource_type" + }, + { + "$ref": "#/components/schemas/23_obj_filter_category_id" + } + ] } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "mode": { + "type": "string", + "description": "Defines which resources Voucherify will use. Currently, `BASIC` is supported." + }, + "scenario": { + "type": "string", + "description": "Defines the scenario Voucherify should consider during the qualification process.\n\n- `ALL` - Scenario that returns all redeemables available for the customer in one API request.\n- `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile.\n- `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only.\n- `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s).\n- `PROMOTION_STACKS` - returns the applicable promotion stacks.\n- `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s).", + "enum": [ + "ALL", + "CUSTOMER_WALLET", + "AUDIENCE_ONLY", + "PRODUCTS", + "PRODUCTS_DISCOUNT", + "PROMOTION_STACKS", + "PRODUCTS_BY_CUSTOMER", + "PRODUCTS_DISCOUNT_BY_CUSTOMER" ] } } - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0aac93c6af84485df3" - } - } + }, + "23_req_create_qualification_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" } } - } - } - } - } - }, - "/v1/vouchers/importCSV": { - "post": { - "operationId": "import-vouchers-using-csv", - "tags": [ - "VOUCHERS API" - ], - "summary": "Import Vouchers using CSV", - "description": "Import standalone vouchers into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties listed in the file headers that cannot be mapped to standard voucher fields will be added to the metadata object. \n\nYou can find an example CSV file [here](https://support.voucherify.io/article/45-import-codes-and-share-them-digitally#coupons).\n___\n\n```cURL cURL example\ncurl -X POST \\\n https://api.voucherify.io/v1/vouchers/importCSV \\\n -F file=@/path/to/vouchers.csv \\\n -H \"X-App-Id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" \\\n -H \"X-App-Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n```\n\n\n\n> 📘 Standard voucher fields mapping\n>\n> - Go to the [import vouchers](ref:import-vouchers) endpoint to see all standard CSV fields description (body params section).\n> - Supported CSV file headers: Code,Voucher Type,Value,Discount Type,Category,Start Date,Expiration Date,Redemption Limit,Redeemed Quantity, Redeemed Amount,Active,Additional Info,Custom Metadata Property Name\n>- **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z. \n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\n\n\n> 📘 Categories\n>\n> In the structure representing your data, you can define a category that the voucher belongs to. You can later use the category of a voucher to group and search by specific criteria in the Dashboard and using the [List Vouchers](ref:list-vouchers) endpoint.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" + }, + "23_req_create_qualification_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } } - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the **response** and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } + }, + "23_req_create_qualification_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." } } - } - }, - "400": { - "description": "Invalid payload. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "23_req_create_qualification_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption of this request." + } + } + }, + "23_obj_filter_resource_type": { + "description": "Filter conditions set on the resource `type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", + "title": "Filter by type", + "type": "object", + "properties": { + "resource_type": { + "$ref": "#/components/schemas/16_filter_conditions_string" }, - "examples": { - "Example 1": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'file'", - "request_id": "74e4bb71-5b6d-49b9-98eb-239691c9d67a" - } - } + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } - } - } - } - } - }, - "/v1/vouchers/qualification": { - "post": { - "operationId": "examine-vouchers-qualification", - "deprecated": true, - "tags": [ - "VOUCHERS API" - ], - "summary": "Examine Qualification [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nDisplay vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 **standalone vouchers**. \n\n> 👍 Prevailing assumption\n> You data is synced with Voucherify.\n\n ## How does this endpoint work? \n\n A property's value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.\n\nAs a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.\n\n ## What's excluded? \n\n The verification logic won't run against _coupons from bulk unique code campaigns_. For campaigns with multiple unique codes, you should run a [dedicated function](ref:examine-campaigns-qualification) for searching and identifying qualified campaigns.\n\n ## Customizing the response\n\n> 📘 Query parameters let you sort and filter the returned vouchers\n>\n> Customize your response:\n> - If you only care about verifying a customer, use `audienceRulesOnly` set to `true`. \n>- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a `limit`. This will return vouchers sorted by `-created_at`, by default beginning with the most recent vouchers listed at the top.\n> - If you have a preference on the sorting order of the returned vouchers, you can use `order` to customize your response.\n\n ## Sending the request body payload\n\n\n ## Customer\n\nYou have the option of sending customer data via the dedicated `customer` object in the request body or a nested `customer` object within the `order` object.\n ### Available options:\n\n - You can either pass a customer `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal customer identifier e.g., email, database ID, CRM id), \n\n - a combination of the remaining parameters in the customer object, \n\n - a combination of customer `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that customer in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). \n\n## Order\n\n ### Available options:\n\n - You can either pass an order `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal order identifier), \n\n - a combination of the remaining parameters in the order object, \n\n - a combination of order `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that order in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).\n\n## Guidelines:\n\nTo validate against vouchers with total order `amount` requirements, make sure to include the total order `amount` in the order object or alternatively the `amount` for _every_ order item (the application will then add each amount to get the total and perform the qualification checks). If the total order `amount` is provided along with the individual items' amounts, the total order `amount` will take precedence.\n\n\n| **Case** | **Order-Level Parameter Included** | **Item-Level Parameter Included** | **Precedence** | **Calculation Result** | **Parameter included in payload accounts for checks against requirements in these validation rules** |\n|:---:|:---:|:---:|:---:|---|---|\n| **1** | `amount` | `amount` | Order-level | Uses order-level `amount` | - Total order amount |\n| **2** | | `amount` | Item-level | Sums each item-level `amount` | - Total order amount
- subtotal of matched items |\n| **3** | | `price`
`quantity` | Item-level | Multiplies each item's (`price` x `quantity`) to get item `amount` and then adds each item's `amount` to get total order `amount` | - Total order amount
- Subtotal of matched items
- Unit price of any matching order line
- Price of each item/Price of any item |\n| **4** | | `amount`
`price`
`quantity` | Item-level `amount` | Uses item-level `amount` for total order `amount` calculation, ignores (`price` x `quantity`) calculation | - Total order amount (uses item `amount` if provided or `price` x `quantity` for items without `amount` property; `amount` takes precedence in case all 3 properties are provided for an item)
- Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)
- Unit price of any matching order line
- Price of each item/Price of any item |\n| **5** | `amount` | `amount`
`price`
`quantity` | Order-level | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`).
- Subtotal of matched items (see case **4** for details).
- Unit price of any matching order line
- Price of each item/Price of any item |\n \n\n## Reward\n\n ## Gift Card", - "parameters": [ - { - "$ref": "#/components/parameters/audienceRulesOnly" - }, - { - "schema": { - "type": "integer", - "maximum": 50 }, - "in": "query", - "name": "limit", - "description": "The number of vouchers to be qualified." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] + "23_obj_filter_category_id": { + "description": "Filter conditions set on the resource `category_id`.", + "title": "Filter by category ID", + "type": "object", + "properties": { + "category_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "Should contain given customer and context such as an order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_qualification" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", - "metadata": { - "key": "value" - } - }, - "order": { - "amount": 10000, - "items": [ - { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ] - }, - "metadata": { - "key": "value" - } - } + "23_obj_qualification_redeemables": { + "title": "Redeemables", + "type": "object", + "description": "List or redeemables for examine qualification.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. Default is `list`." }, - "Qualify product using product_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of qualified redeemables." + }, + "data": { + "type": "array", + "description": "Array of qualified redeemables.", + "items": { + "allOf": [] } }, - "Qualify product using source_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} + "total": { + "type": "integer", + "example": 5, + "description": "The number of redeemables returned in the API request." + }, + "has_more": { + "type": "boolean", + "description": "As results are always limited, the `has_more` flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results." + } + } + }, + "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." + }, + "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." } } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" + "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." + } }, - "metadata": {} + "required": [ + "id", + "voucher_id", + "campaign_id", + "bucket", + "created_at", + "status", + "expires_at", + "object" + ] } }, - "Qualify SKU using sku_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } + "total": { + "type": "integer", + "description": "Total number of point expiration buckets." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltiesGetEarningRuleResponseBody": { + "$ref": "#/components/schemas/EarningRule" + }, + "LoyaltiesEnableEarningRulesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "updated_at": { + "type": [ + "string", + "null" ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." }, - "metadata": {} - } + "active": { + "type": "boolean", + "default": true, + "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." + } + }, + "required": [ + "updated_at", + "active" + ] + } + ] + }, + "LoyaltiesDisableEarningRulesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" }, - "Qualify SKU using source_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } + { + "type": "object", + "properties": { + "updated_at": { + "type": [ + "string", + "null" ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." }, - "metadata": {} - } + "active": { + "type": "boolean", + "default": false, + "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." + } + }, + "required": [ + "updated_at", + "active" + ] + } + ] + }, + "EarningRuleBase": { + "title": "EarningRuleBase", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Assigned by the Voucherify API, identifies the earning rule object." }, - "Qualify redemption metadata": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format." + }, + "loyalty": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleFixed" }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" + { + "$ref": "#/components/schemas/EarningRuleProportional" + } + ] + }, + "event": { + "$ref": "#/components/schemas/EarningRuleEvent", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card." + }, + "custom_event": { + "type": "object", + "properties": { + "schema_id": { + "type": "string" + } + }, + "required": [ + "schema_id" + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + }, + "required": [ + "id" + ] + }, + "source": { + "type": "object", + "required": [ + "object_id", + "object_type" + ], + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" + "object_id": { + "type": "string", + "description": "A unique campaign identifier assigned by the Voucherify API." }, - "metadata": {} + "object_type": { + "type": "string", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", + "enum": [ + "campaign" + ] + } } }, - "Qualify order line item metadata": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" + "object": { + "type": "string", + "enum": [ + "earning_rule" + ], + "description": "The type of object represented by JSON. Default is earning_rule." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify." + }, + "start_date": { + "type": "string", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." }, - "metadata": {} + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." + } + }, + "required": [ + "duration", + "interval" + ] + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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 } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } - } - } - } - }, - "responses": { - "200": { - "description": "This operation returns the list of valid and active vouchers based on the qualification of given context (e.g., customer profile, redemptions metadata, order).", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_qualification" - } - } - } - } - } - } - }, - "/v1/vouchers/bulk/async": { - "post": { - "operationId": "update-vouchers-in-bulk", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Vouchers in bulk", - "description": "Use this endpoint to update specific metadata parameters for each code, respectively. You can update each code's metadata property separately. \n\n- Update up to **100 records** in one request.\n- Upserts are not supported. \n\n> 🚧 \n> \n> Currently only **metadata** updates are supported.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "List of objects, each containing a code that is being updated and the metadata key/value pairs for that code.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_bulk_async" }, - "examples": { - "Example": { - "value": [ - { - "code": "example_code", - "metadata": { - "lang": "en", - "test": false, - "MetadataTest": "Update metadata", - "update_value": 1, - "next_update_date": "2022-11-11T09:00:00.000Z" - } - }, - { - "code": "example_code2", - "metadata": { - "lang": "pl", - "test": false, - "MetadataTest": "Update metadata", - "update_value": 2 - } - } - ] + "required": [ + "id", + "created_at", + "loyalty", + "source", + "object", + "automation_id", + "metadata" + ] + }, + "EarningRuleEvent": { + "title": "EarningRuleEvent", + "type": "string", + "enum": [ + "order.paid", + "customer.segment.entered", + "custom_event", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged", + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left" + ] + }, + "EarningRuleFixed": { + "title": "Define fixed amount of points", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "FIXED" + ], + "description": "The number of points to be added to the loyalty card." + }, + "points": { + "type": "integer", + "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." } } - } - } - }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + }, + "EarningRuleProportionalOrder": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" + } + ], + "title": "Order" + }, + "EarningRuleProportionalOrderAmount": { + "title": "Order Amount", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_AMOUNT" + ], + "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" + "order": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + } + } + } } } - } - } - } - } - } - }, - "/v1/vouchers/metadata/async": { - "post": { - "operationId": "update-vouchers-metadata-in-bulk", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Vouchers' metadata in bulk", - "description": "Use this endpoint to update the same metadata parameters for a list of codes. \nUpdate up to **100 records** in one request. Upserts are not supported. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "Request to update vouchers metadata in bulk. Provide an array of voucher codes in the `codes` parameter along with the `metadata` object. The `metadata` object should contain the key value pairs that you would like to update for all the vouchers included in the `codes` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_metadata_async" }, - "examples": { - "Example": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726" - ], - "metadata": { - "lang": "en", - "authorized_internally": true + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderTotalAmount": { + "title": "Order Total Amount", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_TOTAL_AMOUNT" + ], + "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + }, + "order": { + "type": "object", + "required": [ + "total_amount" + ], + "properties": { + "total_amount": { + "type": "object", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + } + } } } } - } - } - } - }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + }, + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderMetadata": { + "title": "Order Metadata", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "400": { - "description": "Returns an error indicating the reason for an unsuccessfull operation.", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - { - "$ref": "#/components/schemas/e_400_not_enough_codes" - }, - { - "$ref": "#/components/schemas/e_400_metadata_validation_failed" - } + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_METADATA" ], - "discriminator": { - "propertyName": "key" - } + "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" }, - "examples": { - "Not enough codes": { - "value": { - "code": 400, - "key": "not_enough_codes", - "message": "Not enough codes", - "details": "Specify at least 1 code in codes.", - "request_id": "v-0c4b067a8f161e120f" + "order": { + "type": "object", + "required": [ + "metadata" + ], + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the order metadata property to grant points for." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "property": { + "type": "string", + "description": "Order metadata property." + } + } } } } - } - } - } - } - } - }, - "/v1/vouchers/{code}/sessions/{sessionKey}": { - "parameters": [ - { - "name": "code", - "in": "path", - "schema": { - "type": "string", - "example": "7fjWdr" - }, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify.", - "required": true - }, - { - "schema": { - "type": "string", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "name": "sessionKey", - "in": "path", - "required": true, - "description": "A unique session identifier." - } - ], - "delete": { - "operationId": "release-validation-session", - "tags": [ - "VOUCHERS API" - ], - "summary": "Release Validation Session", - "description": "Manually release a validation session that has been set up for the voucher. This method undos the actions that are explained in our guide on how a validation session was established, you can read more [here](doc:locking-validation-session). \n\n> 📘 Release Session using Dashboard\n>\n> You can also use the Validations Manager in the Dashboard to unlock sessions. [Read more](https://support.voucherify.io/article/16-dashboard-sections#validations).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if the validation session was released successfully." - } - } - } - }, - "/v1/campaign-object": { - "get": { - "operationId": "campaign-object", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Campaign Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Campaign Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } - } - } - } - } - } - }, - "/v1/campaigns": { - "post": { - "operationId": "create-campaign", - "tags": [ - "CAMPAIGNS API", - "PROMOTIONS API" - ], - "summary": "Create Campaign", - "description": "Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes. \n\n\n> 📘 Global uniqueness\n>\n> All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code. \n\n> 🚧 Code generation status\n>\n> This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](ref:get-campaign) description.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the campaign that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_create_campaign" }, - "examples": { - "Discount Campaign": { - "value": { - "name": "Discount Campaign 4", - "campaign_type": "DISCOUNT_COUPONS", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 3, - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "percent_off": 10, - "type": "PERCENT" - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "10OFF-#######" - } - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "AMER" - } - } + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderItemsQuantity": { + "title": "Order Items Quantity", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." }, - "Gift Card Campaign": { - "value": { - "name": "Gift Card Campaign", - "campaign_type": "GIFT_VOUCHERS", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "voucher": { - "type": "GIFT_VOUCHER", - "gift": { - "amount": 1000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "GIFT-CARD-#######" - } - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" - } - } + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_QUANTITY" + ], + "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" }, - "Loyalty Program": { - "value": { - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "auto_join": true, - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "LOYALTY-CARD-#######" - } - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" - } - } - }, - "Promotion": { - "value": { - "name": "Promotion - API - 4", - "campaign_type": "PROMOTION", - "type": "STATIC", - "category_id": "cat_0bb343dee3cdb5ec0c", - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "active": false, - "promotion": { - "tiers": [ - { - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "B" - }, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" - ] + "order_items": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "quantity": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." }, - { - "name": "Order more than $100", - "banner": "Get $30 off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A" - }, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } - ] - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "metadata": { - "region": "APAC" - } - } - }, - "Referral Program": { - "value": { - "name": "Referral Campaign 2", - "campaign_type": "REFERRAL_PROGRAM", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "referral_program": { - "conversion_event_type": "redemption" - }, - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 45, - "effect": "APPLY_TO_ORDER", - "amount_limit": 15 - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "REFERRAL-CODE-#######" - }, - "is_referral_code": true - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" + } } } } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a campaign object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "required": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalOrderItemsAmount": { + "title": "Order Items Amount", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_AMOUNT" + ], + "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" }, - "examples": { - "Discount Campaign": { - "value": { - "id": "camp_NdBCAQk1AAZcMcv6kt6X164Q", - "name": "Discount Campaign 4", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10 + "order_items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." }, - "redemption": { - "quantity": 10 + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "10OFF-#######" + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "AMER" - }, - "created_at": "2022-09-21T09:25:49.617Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } - ], - "object": "campaign" + } } - }, - "Gift Card Campaign": { - "value": { - "id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "name": "Gift Card Campaign", - "campaign_type": "GIFT_VOUCHERS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "GIFT_VOUCHER", - "gift": { - "amount": 1000, - "effect": "APPLY_TO_ORDER" + } + } + }, + "required": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalOrderItemsSubtotalAmount": { + "title": "Order Items Subtotal Amount", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_SUBTOTAL_AMOUNT" + ], + "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)" + }, + "order_items": { + "type": "object", + "required": [ + "subtotal_amount" + ], + "properties": { + "subtotal_amount": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." }, - "redemption": { - "quantity": 10 + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "GIFT-CARD-#######" + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:31:16.266Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } - ], - "object": "campaign" + } } - }, - "Loyalty Program": { - "value": { - "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 + } + } + }, + "required": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalCustomerMetadata": { + "title": "Customer Metadata", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)" + }, + "customer": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for." }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "LOYALTY-CARD-#######" + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:39:45.479Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "property": { + "type": "string", + "description": "Customer metadata property." } - ], - "object": "campaign" + } } - }, - "Promotion": { - "value": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "name": "Promotion - API - 4", - "campaign_type": "PROMOTION", - "type": "STATIC", - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-23T08:54:38.281Z", - "category": "First", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "promotion": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", - "created_at": "2022-09-23T08:54:38.286Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "B" - }, - "hierarchy": 1, - "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "campaign": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": true, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" - }, - "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_dr3oXeN98YfiTF60", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", - "related_object_type": "promotion_tier", - "created_at": "2022-09-23T08:54:38.286Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - }, - { - "id": "promo_uMSxvzhxXDp3Ijs3659npqb2", - "created_at": "2022-09-23T08:54:38.314Z", - "name": "Order more than $100", - "banner": "Get $30 off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A" - }, - "hierarchy": 2, - "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "campaign": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": true, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" - }, - "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_jgJlWms7GVK59iNR", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_uMSxvzhxXDp3Ijs3659npqb2", - "related_object_type": "promotion_tier", - "created_at": "2022-09-23T08:54:38.314Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - ], - "total": 2, - "has_more": false - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } + } + } + }, + "required": [ + "type", + "calculation_type", + "customer" + ] + }, + "EarningRuleProportionalCustomEvent": { + "title": "Custom Event", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOM_EVENT_METADATA" + ], + "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." + }, + "custom_event": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" ], - "object": "campaign" - } - }, - "Referral Program": { - "value": { - "id": "camp_N8rztKAqOYIdFxNLr9eNIjyB", - "name": "Referral Campaign 2", - "campaign_type": "REFERRAL_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 15, - "percent_off": 45, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 10 + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for." }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "REFERRAL-CODE-#######" + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." }, - "is_referral_code": true, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "referral_program": { - "conversion_event_type": "redemption" - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-23T09:06:41.757Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "property": { + "type": "string", + "description": "\nCustom event metadata property." } - ], - "object": "campaign" + } } } } + }, + "required": [ + "type", + "calculation_type", + "custom_event" + ] + }, + "EarningRuleProportional": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrder" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" + } + ], + "title": "Calculate points proportionally" + }, + "EarningRuleProportionalOrderItems": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" + } + ], + "title": "Order Items" + }, + "LoyaltiesListMemberRewardsRequestQuery": { + "title": "Loyalties List Member Rewards Request Query", + "type": "object", + "properties": { + "affordable_only": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "page": { + "type": "integer" + } } - } - }, - "400": { - "description": "Returns an error if an incomplete request body is provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "LoyaltiesGetPointsExpirationRequestQuery": { + "title": "Loyalties Get Points Expiration Request Query", + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100 }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_campaign", - "message": "Invalid Campaign", - "details": "Property 'discount' is required for REFERRAL_PROGRAM campaign", - "request_id": "v-0bb99c9213425fa250" - } - } + "page": { + "type": "integer" } } - } - }, - "404": { - "description": "When a payload value is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "LoyaltiesListCardTransactionsRequestQuery": { + "title": "Loyalties List Card Transactions Request Query", + "type": "object", + "properties": { + "limit": { + "type": "integer", + "minimum": 1, + "multipleOf": 100 }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find category with id cat_0bb343dee3cdb5ec0c", - "request_id": "v-0c55671ed1cb0f1a27", - "resource_id": "cat_0bb343dee3cdb5ec0c", - "resource_type": "category" - } - } + "page": { + "type": "integer" } } - } - }, - "409": { - "description": "Returns an error if a campaign with the same name already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "LoyaltiesListCardTransactionsResponseBody": { + "title": "Loyalties List Card Transactions Response Body", + "type": "object", + "properties": { + "object": { + "type": "string", + "pattern": "list", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON." }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated campaign exists with name Discount Campaign", - "request_id": "v-0bb98f8c6552250aab", - "resource_id": "Discount Campaign", - "resource_type": "campaign" - } + "data_ref": { + "type": "string", + "pattern": "data", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of transaction objects." + }, + "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." } - } - } - } - } - }, - "get": { - "operationId": "list-campaigns", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "List Campaigns", - "description": "Retrieve a list of campaigns in a project. \n\nThe campaigns are returned sorted by creation date, with the most recent campaigns appearing first. \n\nWhen you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.\n\nThis method will return an error when trying to return a limit of more than 100 campaigns.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/campaign_type" - }, - { - "schema": { - "type": "string", - "default": "category" + }, + "required": [ + "object", + "data_ref", + "data", + "has_more" + ] }, - "in": "query", - "name": "expand", - "description": "Include an expanded `categories` object in the response." - }, - { - "schema": { + "LoyaltyCardTransactionsType": { "type": "string", "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" + "POINTS_ACCRUAL", + "POINTS_CANCELLATION", + "POINTS_REDEMPTION", + "POINTS_REFUND", + "POINTS_ADDITION", + "POINTS_REMOVAL", + "POINTS_EXPIRATION", + "POINTS_TRANSFER_IN", + "POINTS_TRANSFER_OUT" ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `campaign` property that contains an array of campaigns. The maximum number of campaigns returned is determined by the `limit` query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_res_list_campaigns" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "campaigns", - "campaigns": [ - { - "id": "camp_SibPsDRKQvg3SUtptgPZCNZb", - "name": "Voucher Metadata", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 4400, - "percent_off": 30, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 9, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "#########", - "prefix": "Discount-", - "postfix": "YY" - }, - "is_referral_code": false, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 + "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" + }, + "balance": { + "type": "string" + }, + "next_expiration_date": { + "type": "string" + }, + "next_expiration_points": { + "type": "string" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ] + }, + "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": [ + "string", + "null" + ], + "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." + }, + "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": [ + "string", + "null" + ], + "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." + }, + "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": "Contains the detailed information about the transaction.", + "properties": { + "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" ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 1, - "active": true, - "metadata": { - "region": "AMER" - }, - "created_at": "2022-09-20T09:32:29.530Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" + "description": "The type of voucher whose balance is being adjusted due to the transaction." }, - { - "id": "camp_HgsbCKauXmEoPnnh8aas0ISe", - "name": "Static Campaign", - "campaign_type": "DISCOUNT_COUPONS", - "type": "STATIC", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 1 - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-09-20T07:52:34.499Z", - "updated_at": "2022-09-20T11:38:13.501Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" + "total": { + "type": "integer", + "description": "The available points prior to the transaction." }, - { - "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "name": "Loyalty Program Fall 2022", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 7, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LOYALTY-CARD-" - }, - "is_referral_code": false - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-09-19T07:56:22.103Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" + "object": { + "type": "string", + "pattern": "balance", + "enum": [ + "balance" + ], + "description": "The type of object represented by the JSON." }, - { - "id": "camp_4tHsQEDUOER6PeW8SoMdnHH6", - "name": "Dynamic Discounts", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 5, - "percent_off_formula": "IF(ORDER_AMOUNT > 300;15;5)", - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "DYNAMIC-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": { - "marketing_text": "Purchases above $300 are eligible for a 15% discount." - }, - "created_at": "2022-07-12T15:12:02.575Z", - "updated_at": "2022-07-20T10:48:05.617Z", - "category": "test", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b688929a2476386a8", - "object": "campaign" + "points": { + "type": "integer", + "description": "The amount of points being used up in the transaction." }, - { - "id": "camp_JlsseNSDO7l4neFtev6p6945", - "name": "$20 OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "$20OFFORDER-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:43:36.057Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are subtracted from the loyalty card." }, - { - "id": "camp_Uj3cNbWSgt7Zl4AyHM7Sa5Qk", - "name": "3% OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 3, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "3%OFFORDER-" + "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." }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:41:12.087Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" + "type": { + "type": "string", + "pattern": "voucher", + "enum": [ + "voucher" + ], + "description": "The object being modified, i.e. voucher." + } + } } - ], - "total": 6 - } - } - } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}": { - "parameters": [ - { - "in": "path", - "name": "campaignId", - "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.", - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "required": true - } - ], - "get": { - "operationId": "get-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Get Campaign", - "description": "Retrieves the campaign with the given campaign ID or campaign name.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a campaign object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_JlsseNSDO7l4neFtev6p6945", - "name": "$20 OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" + }, + "required": [ + "type", + "total", + "object", + "points", + "balance", + "related_object" + ] + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID." }, - "redemption": { - "quantity": null + "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." }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "$20OFFORDER-" + "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." }, - "is_referral_code": false + "name": { + "type": "string", + "description": "Type of custom event." + } }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:43:36.057Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "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." + } }, - "category_id": null, - "object": "campaign" + "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." } } - } - } - } - }, - "404": { - "description": "Returns an error when requesting the campaign that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_jcErmtGAOmHUAy0oUgkwKnP", - "request_id": "v-0bb8694614d58bf2a8", - "resource_id": "camp_jcErmtGAOmHUAy0oUgkwKnP", - "resource_type": "campaign" - } - } + "related_transaction_id": { + "type": [ + "string", + "null" + ], + "description": "The related transaction ID on the receiving card." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format.\n\n" } - } - } - } - } - }, - "put": { - "operationId": "update-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Update Campaign", - "description": "Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. \n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped. \n\n> #### Vouchers will be affected\n>\n> This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the campaign parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_update_campaign" }, - "examples": { - "Example": { - "value": { - "description": "New description" + "required": [ + "id", + "source_id", + "voucher_id", + "campaign_id", + "source", + "reason", + "type", + "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" } } } - } - } - }, - "responses": { - "200": { - "description": "Returns the campaign object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "LoyaltiesExportCardTransactionsResponseBody": { + "title": "Loyalties Export Card Transactions Response Body", + "type": "object", + "description": "", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID." }, - "examples": { - "Example": { - "value": { - "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "LOYALTY-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "description": "New description", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 + "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" ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 2, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:39:45.479Z", - "updated_at": "2022-09-23T09:47:00.205Z", - "category": "First", - "creation_status": "MODIFYING", - "vouchers_generation_status": "MODIFYING", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "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 + } + } + } + } + } } - ], - "object": "campaign" + } } } + }, + "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." } - } - } - } - } - }, - "delete": { - "operationId": "delete-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Delete Campaign", - "description": "Permanently deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [ - { - "schema": { - "type": "boolean" + }, + "required": [ + "id", + "object", + "created_at", + "status", + "channel", + "exported_object", + "parameters", + "result", + "user_id" + ] }, - "in": "query", - "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with exactly the same name.", - "name": "force" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "RewardAssignment": { + "title": "Reward Assignment", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique reward assignment ID, assigned by Voucherify." }, - "examples": { - "Delete Campaign": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "404": { - "description": "Returns an error indicating that the campaign with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "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." }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Spring Campaign", - "request_id": "v-0adac46be8cdbfd921", - "resource_id": "Spring Campaign", - "resource_type": "campaign" + "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." } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/vouchers": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign to which voucher(s) will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "add-vouchers-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Add Vouchers to Campaign", - "description": "This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [ - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "vouchers_count", - "description": "Number of vouchers that should be added." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher parameters that you would like to overwrite.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_add_vouchers_to_campaign" }, - "examples": { - "Example": { - "value": { - "category_id": "cat_0bb81a481615a37b5e", - "start_date": "2022-09-24T00:00:00Z", - "expiration_date": "2022-09-25T23:59:59Z", - "active": false, - "redemption": { - "quantity": null + "required": [ + "id", + "reward_id", + "created_at", + "object" + ] + }, + "Reward": { + "allOf": [ + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID, assigned by Voucherify." }, - "code_config": { - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "length": 8, - "prefix": "Add-", - "pattern": null, - "postfix": "-API" + "name": { + "type": "string", + "description": "Reward name." }, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" + "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" } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded for a voucher count of 1.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + ] + }, + "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." }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0bb96ebb7ec3720252" + "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." + } + } } } } - } - } - }, - "202": { - "description": "Returns an `async_action_id` if the request was made to create more than 1 voucher.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/vouchers/{code}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - }, - { - "schema": { - "type": "string" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A custom **code** that identifies the voucher." - } - ], - "post": { - "operationId": "add-voucher-with-specific-code-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Add Voucher with Specific Code to Campaign", - "description": "This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher parameters that you would like to overwrite.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_add_vouchers_with_specific_code_to_campaign" }, - "examples": { - "Example": { - "value": { - "category_id": "cat_0bb81a481615a37b5e", - "start_date": "2022-09-24T00:00:00Z", - "expiration_date": "2022-09-25T23:59:59Z", - "active": false, - "redemption": { - "quantity": null - }, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" + "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." + } + } } } } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "required": [ + "type", + "parameters" + ] + }, + "RewardTypeCampaign": { + "title": "Reward Type Campaign", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Reward type." }, - "examples": { - "Example": { - "value": { - "id": "v_EJwB9Wy2aOIsDpWhnl2QBY51OqjQ5Ukg", - "code": "Code3", - "campaign": "Add Vouchers to Campaign", - "campaign_id": "camp_xxpmFyWO9h9s5cEe7HtmOK5B", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 2000, - "percent_off": 30, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-24T00:00:00.000Z", - "expiration_date": "2022-09-25T23:59:59.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 + "parameters": { + "type": "object", + "required": [ + "campaign" + ], + "description": "Defines how the reward is generated.", + "properties": { + "campaign": { + "type": "object", + "required": [ + "id", + "type" ], - "active": true, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+p2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6+1N81zXuY6/pnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bp2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6%2B1N81zXuY6%2FpnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg%3D%3D" + "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." }, - "barcode": { - "id": "U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5/u9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY+sOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW+NCQg6Ts8clYWWP5lrGyV/fzoA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5%2Fu9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY%2BsOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW%2BNCQg6Ts8clYWWP5lrGyV%2FfzoA%3D%3D" + "type": { + "type": "string", + "enum": [ + "DISCOUNT_COUPONS", + "PROMOTION", + "GIFT_VOUCHERS", + "REFERRAL_PROGRAM" + ], + "description": "Campaign type." } - }, - "is_referral_code": false, - "created_at": "2022-09-21T07:14:28.217Z", - "updated_at": null, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/Code3/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/Code3/publications?page=1&limit=10" - }, - "object": "voucher" + } } } } - } - } - }, - "409": { - "description": "Returns an error if a voucher with the same code already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "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." }, - "examples": { - "Duplicate": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated voucher exists with id Code1", - "request_id": "v-0bb974be99d22504cd", - "resource_id": "Code1", - "resource_type": "voucher" + "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" + ] } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/import": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The ID of an existing campaign to which you're importing the codes. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "import-vouchers-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Import Vouchers to Campaign", - "description": "Imports vouchers to an **existing** campaign.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Discount type, expiration date and the remaining attributes will be taken from the [Campaign](ref:get-campaign) settings.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_import_vouchers_to_campaign" }, - "examples": { - "Example": { - "value": [ - { - "code": "CODE7", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true + "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." }, - { - "code": "CODE8", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true + "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." }, - { - "code": "CODE9", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true + "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." } - ] + } }, - "Gift Cards": { - "value": [ - { - "code": "CODE13", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "gift": { - "amount": 500 - }, - "active": true + "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." }, - { - "code": "CODE14", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "gift": { - "amount": 2000 - }, - "active": true + "count": { + "type": "integer", + "description": "Publication events counter." }, - { - "code": "CODE15", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": false + "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" ] }, - "Loyalty Cards": { - "value": [ - { - "code": "CODE10", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "loyalty_card": { - "points": 300 - }, - "active": true + "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." }, - { - "code": "CODE11", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "loyalty_card": { - "points": 2000 - }, - "active": true + "redeemed_points": { + "type": "integer", + "description": "Total loyalty points redeemed." }, - { - "code": "CODE12", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true - } - ] - } - } - } - } - }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "400": { - "description": "Returns an error if the request includes incorrect data, e.g. a wrong data type or duplicated codes.", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/e_400_invalid_voucher" + "redeemed_quantity": { + "type": "integer", + "description": "How many times a voucher has already been redeemed." }, - { - "$ref": "#/components/schemas/e_400_duplicate_key" + "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" ] }, - "examples": { - "Duplicate Codes": { - "value": { - "code": 400, - "key": "duplicate_key", - "message": "Duplicate codes", - "details": "2 voucher codes(s) already exist.", - "request_id": "v-0adaccaba61502e4b3" - } - }, - "Missing Code": { - "value": { - "code": 400, - "key": "invalid_voucher", - "message": "Invalid Voucher", - "details": "Found 1 voucher(s) without 'code' value", - "request_id": "v-0bbc38ce088c8b2f9a" - } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redemption.quantity should be number,null", - "request_id": "v-0c545db3808418908f" - } - } - } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/importCSV": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "import-vouchers-to-campaign-using-csv", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Import Vouchers to Campaign by CSV", - "description": "Imports vouchers to an **existing** campaign. \n\n\nThe CSV file has to include headers in the first line. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \\\n -F file=@/path/to/campaigns.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nYou can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties. \n\nDiscount type, time limits, and validation rules will be taken from the [campaign object](ref:get-campaign) settings. \n\n\n| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |\n|---|---|---|---|---|---|---|---|\n| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.
Context: `LOYALTY_PROGRAM` | The initial gift card balance.
Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |\n|\n\n> 📘 Active\n>\n> The CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - } - } - }, - "description": "The file path is stored in the form `file` header." - }, - "responses": { - "200": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "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" }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "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." }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_FZL4iTTdZw36nZOoXYQ172fQ", - "request_id": "v-0bc26adad888b6fed1", - "resource_id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "resource_type": "campaign" + "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" } - } - } - } - } - } - }, - "/v1/campaigns/qualification": { - "post": { - "operationId": "examine-campaigns-qualification", - "deprecated": true, - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Examine Qualification [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nThe method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order). \n\nThe maximum number of **returned campaigns is 50**.\n\n## What campaign types are included in the response?\n\n- `DISCOUNT_COUPONS`\n- `GIFT_VOUCHERS`\n- `REFERRAL_PROGRAM`\n\n## What's excluded?\n\nA checking logic will be run only among campaigns and will ignore _standalone vouchers_. For standalone vouchers, you should run a [dedicated endpoint](ref:examine-vouchers-qualification) for searching and identifing vouchers. \n\n## Subsequent Steps\n\nAs a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](ref:create-publication) will return a unique code which will belong to a given customer.\n\n## Sample use case\n\nAs a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "audienceRulesOnly", - "description": "This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)" - }, - { - "schema": { - "type": "integer", - "maximum": 50 - }, - "in": "query", - "name": "limit", - "description": "The number of campaigns to be qualified. The maximum number is 50." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "type", - "-type", + }, + "required": [ + "id", "code", - "-code", "category", - "-category", - "campaign", - "-campaign" + "category_id", + "type", + "loyalty_card", + "start_date", + "expiration_date", + "validity_timeframe", + "validity_day_of_week", + "active", + "additional_info", + "metadata", + "is_referral_code", + "created_at" ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_examine_qualification" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", - "metadata": { - "key": "value" - } - }, - "order": { - "amount": 10000, - "items": [ - { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ] - }, - "metadata": { - "key": "value" - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_res_examine_qualification" - } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "enable-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Enable Campaign", - "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an empty json `{}`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/res_empty_json" + "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)." }, - "examples": { - "Empty JSON": { - "value": {} - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "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)." }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_h8RyP6FV94F3Ev2odP24j5p", - "request_id": "v-0adaf4847c9502879b", - "resource_id": "camp_h8RyP6FV94F3Ev2odP24j5p", - "resource_type": "campaign" - } - } - } - } - } - } - } - } - }, - "/v1/campaigns/{campaignId}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being disabled. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "disable-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Disable Campaign", - "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an empty json `{}`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/res_empty_json" + "reason": { + "type": "string", + "description": "Reason for the transfer." }, - "examples": { - "Empty JSON": { - "value": {} - } + "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" } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "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" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Spring Campaign", - "request_id": "v-0adaf3735116bb298b", - "resource_id": "Spring Campaign", - "resource_type": "campaign" - } - } - } - } - } - } - } - } - }, - "/v1/promotion-tier-object": { - "get": { - "operationId": "promotion-tier-object", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Promotion Tier Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Promotion Tier Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + "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." } - } - } - } - } - } - }, - "/v1/promotions/tiers": { - "get": { - "operationId": "list-promotion-tiers", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers", - "description": "This method enables you to list promotion tiers.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "is_available", - "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." - }, - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { - "type": "string" + }, + "required": [ + "points" + ] }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { + "PointsExpirationTypes": { + "title": "Points Expiration Types", "type": "string", "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" + "PROGRAM_RULES", + "CUSTOM_DATE", + "NON_EXPIRING" ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "category_id": "cat_0bb81a481615a37b5e", - "object": "campaign" - }, - "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - }, - { - "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "created_at": "2021-12-15T11:34:01.358Z", - "updated_at": "2022-02-09T09:20:08.619Z", - "name": "Hot Promotion - Tier 2", - "banner": "Get Tier 2 Discount $20 Off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 33 - }, - "orders": { - "total_amount": 519200, - "total_discount_amount": 66000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_pEe1inoYSfmO12p7", - "rule_id": "val_5h0wc453_5", - "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.358Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - }, - { - "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "created_at": "2021-12-15T11:34:01.333Z", - "updated_at": "2022-02-09T09:20:05.603Z", - "name": "Hot Promotion - Tier 1", - "banner": "Get Tier 1 Discount 10zl", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "ProductionMetaData": "Hot Promotion - Tier 1" - }, - "hierarchy": 1, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 11 - }, - "orders": { - "total_amount": 1414979, - "total_discount_amount": 11000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_QqYs7GGVy7cuh3L9", - "rule_id": "val_5h0wc453_4", - "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.333Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - ], - "total": 3 - } - } - } - } - } - } - } - } - }, - "/client/v1/promotions/tiers": { - "get": { - "operationId": "list-promotion-tiers-client-side", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers (client-side)", - "description": "This method enables you to list promotion tiers.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "is_available", - "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." - }, - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { - "type": "string", - "enum": [ + "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", - "-created_at", - "updated_at", - "-updated_at" + "object" ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "category_id": "cat_0bb81a481615a37b5e", - "object": "campaign" - }, - "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + "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." }, - { - "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "created_at": "2021-12-15T11:34:01.358Z", - "updated_at": "2022-02-09T09:20:08.619Z", - "name": "Hot Promotion - Tier 2", - "banner": "Get Tier 2 Discount $20 Off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 33 - }, - "orders": { - "total_amount": 519200, - "total_discount_amount": 66000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_pEe1inoYSfmO12p7", - "rule_id": "val_5h0wc453_5", - "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.358Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 + "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" } }, - { - "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "created_at": "2021-12-15T11:34:01.333Z", - "updated_at": "2022-02-09T09:20:05.603Z", - "name": "Hot Promotion - Tier 1", - "banner": "Get Tier 1 Discount 10zl", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "ProductionMetaData": "Hot Promotion - Tier 1" - }, - "hierarchy": 1, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 11 - }, - "orders": { - "total_amount": 1414979, - "total_discount_amount": 11000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_QqYs7GGVy7cuh3L9", - "rule_id": "val_5h0wc453_4", - "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.333Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } + "filters": { + "$ref": "#/components/schemas/ExportVoucherFilters", + "description": "Filter conditions." } - ], - "total": 3 + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } - } - } - } - } - } - } - } - }, - "/v1/promotions/{campaignId}/tiers": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID assigned by Voucherify." - } - ], - "get": { - "operationId": "list-promotion-tiers-from-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers from Campaign", - "description": "This method enables you to list promotion tiers from a specified campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" + }, + "required": [ + "exported_object" + ] }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_xyOKjAmysZrwt3aqq1dMUwMU", - "created_at": "2022-04-07T08:43:53.730Z", - "updated_at": "2022-08-26T05:22:43.220Z", - "name": "Amount", - "banner": "Get $10 off entire order", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "campaign": { - "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b5f67863083bf7c05", - "object": "campaign" - }, - "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 1 - }, - "orders": { - "total_amount": 2187, - "total_discount_amount": 1000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + { + "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." }, - { - "id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", - "created_at": "2022-04-07T08:43:53.581Z", - "updated_at": "2022-08-26T05:22:43.008Z", - "name": "Percentage", - "banner": "Get 10% OFF on entire order", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "campaign": { - "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b5f67863083bf7c05", - "object": "campaign" - }, - "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 1 - }, - "orders": { - "total_amount": 71600, - "total_discount_amount": 7160 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + "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." } - ], - "total": 2, - "has_more": false + }, + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } - } - } - } - } - } - } - }, - "post": { - "operationId": "add-promotion-tier-to-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Add Promotion Tier to Campaign", - "description": "This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the promotion tier parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" - }, - "examples": { - "Example": { - "value": { - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a promotion tier object if the promotion tier was successfully added to the campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "required": [ + "exported_object" + ] }, - "examples": { - "Example": { - "value": { - "id": "promo_JcYGIKJsnv0SpZcx2njZm69x", - "created_at": "2022-09-22T11:21:57.808Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 6, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 + { + "title": "Export Customers", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "customer" ], - "summary": { - "redemptions": { - "total_redeemed": 0 + "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" + } }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 + "filters": { + "$ref": "#/components/schemas/ExportCustomerFilters", + "description": "Filter conditions." } }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_AmeYPmiLZKaIxq01", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_JcYGIKJsnv0SpZcx2njZm69x", - "related_object_type": "promotion_tier", - "created_at": "2022-09-22T11:21:57.808Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } - } - } - } - } - } - } - } - }, - "/v1/promotions/tiers/{promotionTierId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "promo_2EnAik6Jt7dKTOMkRTIgEjZH" - }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "get": { - "operationId": "get-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Get Promotion Tier", - "description": "This method enables you to retrieve a specific promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a promotion tier object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - } - } - } - } - }, - "put": { - "operationId": "update-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Update Promotion Tier", - "description": "This method updates a promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the promotion tier parameters that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_update_promotion_tier" - }, - "examples": { - "Example": { - "value": { - "name": "Order more than $100 USD", - "banner": "Order more than $100 USD", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 25, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A-21" - }, - "hierarchy": 1, - "start_date": "2022-09-22T00:00:00.000Z", - "expiration_date": "2022-09-29T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3 - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a promotion tier object if the update was successful.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "required": [ + "exported_object" + ] }, - "examples": { - "Example": { - "value": { - "id": "promo_hINAfBAVhmFuSAzi3vptfyxW", - "created_at": "2022-09-22T12:40:23.286Z", - "updated_at": "2022-09-22T12:40:58.626Z", - "name": "Order more than $100 USD", - "banner": "Order more than $100 USD", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 25, - "effect": "APPLY_TO_ORDER" + { + "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." } }, - "metadata": { - "level": "A-21" + "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." + } }, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": false, - "start_date": "2022-09-22T00:00:00.000Z", - "expiration_date": "2022-09-29T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3 + "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" ], - "summary": { - "redemptions": { - "total_redeemed": 0 + "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" + } }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 + "filters": { + "$ref": "#/components/schemas/ExportPointsExpirationFilters", + "description": "Filter conditions." } }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_8e3e53ZgDNcoRGAI", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW", - "related_object_type": "promotion_tier", - "created_at": "2022-09-22T12:40:23.286Z", - "object": "validation_rules_assignment" + "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" } - ], - "total": 1 - } + }, + "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." } - } - } - } - } - }, - "delete": { - "operationId": "delete-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Delete Promotion Tier", - "description": "This method deletes a promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the promotion tier with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "required": [ + "id", + "object", + "created_at", + "status", + "result", + "user_id" + ] + }, + "Export": { + "title": "Export", + "allOf": [ + { + "$ref": "#/components/schemas/ExportBase" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_2EnAik6Jt7dKTOMkRTIgEjZ", - "request_id": "v-0ae284707e9027a79d", - "resource_id": "promo_2EnAik6Jt7dKTOMkRTIgEjZ", - "resource_type": "promotion_tier" + { + "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." } - } - } - } - } - } - } - } - }, - "/v1/promotions/tiers/{promotionTierId}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "post": { - "operationId": "enable-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Enable Promotion Tier", - "description": "This method enables a promotion tier, i.e. makes the `active` parameter = `true`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the promotion tier object with an updated `active` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "required": [ + "id", + "object", + "created_at", + "status", + "result", + "user_id" + ] }, - "examples": { - "Example": { - "value": { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "updated_at": "2022-09-22T10:32:07.712Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 2 - }, - "orders": { - "total_amount": 37650, - "total_discount_amount": 6000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + { + "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" } - } + ] } - } - } - }, - "404": { - "description": "Returns an error if the promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + ], + "title": "" + }, + "ExportVoucher": { + "title": "Export Vouchers", + "type": "object", + "properties": { + "exported_object": { + "type": "string", + "enum": [ + "voucher" + ], + "description": "The type of object to be exported." }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", - "request_id": "v-0bbaea52be14cc9782", - "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", - "resource_type": "promotion_tier" + "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." + } } - } - } - } - } - }, - "/v1/promotions/tiers/{promotionTierId}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "post": { - "operationId": "disable-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Disable Promotion Tier", - "description": "This method disables a promotion tier, i.e. makes the `active` parameter = `false`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the promotion tier object with an updated `active` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "FiltersCondition": { + "title": "Filters Condition", + "type": "object", + "properties": { + "$in": { + "$ref": "#/components/schemas/Any" }, - "examples": { - "Example": { - "value": { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "updated_at": "2022-09-22T10:34:09.529Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 2 - }, - "orders": { - "total_amount": 37650, - "total_discount_amount": 6000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - } - } + "$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" } } - } - }, - "404": { - "description": "Returns an error if the promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "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." }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", - "request_id": "v-0bbaea52be14cc9782", - "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", - "resource_type": "promotion_tier" - } - } + "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" } } - } - } - } - } - }, - "/v1/promotions/stacks": { - "get": { - "operationId": "list-all-promotion-stacks", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Stacks", - "description": "This method enables you to list promotion stacks irrespective of the campaign they are associated with. \n\nYou can use filters in the query parameters to specify the stacks to be returned in the response.\n\n## Advanced filters for fetching promotion stacks\n\n| **Filters** | **Examples** |\n| :--- | :--- |\n| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |\n| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |", - "parameters": [ - { - "schema": { - "type": "integer" }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { + "Junction": { + "title": "Junction", + "enum": [ + "and", + "AND", + "or", + "OR" + ], "type": "string" }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "name", - "-name" + "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" ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `data` property that contains an array of promotion stacks across all your campaigns.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "stack_SLuhQrAt3mXwHg776lYkzZO8", - "name": "Stack 2", - "created_at": "2022-11-03T10:18:58.356Z", - "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Mfww2TuoeU23enqSmnz0f3rh", - "promo_vU5IHaLKS7mmZ3ylABET6ikb", - "promo_TeHA11JlfN29mUftDcpqIWWq", - "promo_bhKBsIX3tO7yqmpTLCLLuaud" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_twQWp1TyaxX5RlSqn061xGVy", - "name": "First stack", - "created_at": "2021-12-27T11:59:21.838Z", - "updated_at": "2022-12-16T08:22:51.970Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga", - "promo_Mwy9XpA0TLctSGriM5kum0qp" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_vhCqN5PY7rmPw8yACRvHRZaz", - "name": "Second stack", - "created_at": "2021-12-27T11:55:47.431Z", - "updated_at": "2022-12-16T08:22:52.221Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga", - "promo_Mwy9XpA0TLctSGriM5kum0qp" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_zwChew7GY1AnDZJQ6GVP2sdT", - "name": "Third stack", - "created_at": "2021-12-27T11:54:26.283Z", - "updated_at": "2022-12-16T08:22:52.483Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_NS5hEUznL9XPa89rbrOZYMey", - "name": "Fourth stack", - "created_at": "2021-12-27T11:48:43.982Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_Rz0NvFtCZOObS3J5R68KET17", - "name": "Third stack", - "created_at": "2021-12-27T11:40:57.426Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_e8pH0nIuANmYRPE0x8hwDrpm", - "name": "Second stack", - "created_at": "2021-12-27T08:43:13.875Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_3Q4EJpZqg3DI5IRwgBYfsb37", - "name": "First stack", - "created_at": "2021-12-27T08:43:13.498Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_KxSD0GahLUg9ULB6TseGfUHJ", - "name": "Stack 1", - "created_at": "2021-12-23T12:28:38.881Z", - "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_NMex647s5UushvbBUJmYT2Fc", - "promo_4TqHr24boFISDrcOHSlfAxwm" - ], - "hierarchy_mode": "MANUAL" - } - } - ], - "total": 9 - } - } + "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" } } - } - } - } - } - }, - "/v1/promotions/{campaignId}/stacks": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - } - ], - "get": { - "operationId": "list-promotion-stacks-in-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Stacks in Campaign", - "description": "This method enables you to list promotion stacks from a specified campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of promotion stack objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "stack_p0WhtyyDU95crobleMpRabhH", - "name": "First stack", - "created_at": "2022-09-22T13:03:25.740Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_dJNhAEeV5sR5oPQq1UrUdnMC", - "promo_aaAF8mVAzA0PF1igia2OC63d" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_XAzn8AFR3Ks3DBPLAQxV7zHe", - "name": "Second stack", - "created_at": "2022-09-22T13:03:25.903Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" - } - } - ], - "total": 2 + }, + "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." } - } - } - } - } - }, - "post": { - "operationId": "create-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Create Promotion Stack", - "description": "This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the order of promotion tiers for the promotion stack.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" }, - "examples": { - "Example": { - "value": { - "name": "Fifth Stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" - } - } + "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" } } - } - } - }, - "responses": { - "200": { - "description": "Returns a new stack object if a valid promotion campaign identifier was provided in the path and available promotion IDs in the payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", - "name": "Fifth Stack", - "created_at": "2022-09-23T07:44:53.888Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" + }, + "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" } - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign or promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", - "request_id": "v-0bbc10de5886137afd", - "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", - "resource_type": "campaign" + }, + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." } }, - "Promotion Tier Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_dJNhAEeV5sR5oPQq1UrUdnM", - "request_id": "v-0bbc11186303fa288a", - "resource_id": "promo_dJNhAEeV5sR5oPQq1UrUdnM", - "resource_type": "promotion_tier" - } - } + "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" } } - } - } - } - } - }, - "/v1/promotions/{campaignId}/stacks/{stackId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "stack_KOIde7AUf08at12lZ1r3OfFL" - }, - "name": "stackId", - "in": "path", - "required": true, - "description": "Promotion stack ID." - } - ], - "get": { - "operationId": "get-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Get Promotion Stack", - "description": "This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a stack object if valid identifiers were provided in the path.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_p0WhtyyDU95crobleMpRabhH", - "name": "First stack", - "created_at": "2022-09-22T13:03:25.740Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_dJNhAEeV5sR5oPQq1UrUdnMC", - "promo_aaAF8mVAzA0PF1igia2OC63d" - ], - "hierarchy_mode": "MANUAL" + }, + "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" } } - } - }, - "404": { - "description": "Returns an error if the campaign or promotion stack cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Stack Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_stack with id stack_p0WhtyyDU95crobleMpRabh", - "request_id": "v-0bbc0a659591f99d65", - "resource_id": "stack_p0WhtyyDU95crobleMpRabh", - "resource_type": "promotion_stack" + }, + "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." } }, - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", - "request_id": "v-0bbc0aa77a0c8b78e8", - "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", - "resource_type": "campaign" - } - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } - } - } - } - } - }, - "put": { - "operationId": "update-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Update Promotion Stack", - "description": "This methods allows for editing an existing stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the promotion stack parameters that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" }, - "examples": { - "Example": { - "value": { - "name": "Fifth Stack Modified", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE" - ], - "hierarchy_mode": "MANUAL" - } - } + "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" } } - } - } - }, - "responses": { - "200": { - "description": "Returns a promotion stack with updated parameters if the update was successful.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", - "name": "Fifth Stack Modified", - "created_at": "2022-09-23T07:44:53.888Z", - "updated_at": "2022-09-23T07:59:44.172Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE" - ], - "hierarchy_mode": "MANUAL" + }, + "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" } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Delete Promotion Stack", - "description": "This method deletes a promotion stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the stack or campaign with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Stack Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_stack with id stack_KOIde7AUf08at12lZ1r3OfFp", - "request_id": "v-0ae289ca779027b030", - "resource_id": "stack_KOIde7AUf08at12lZ1r3OfFp", - "resource_type": "promotion_stack" + }, + "filters": { + "$ref": "#/components/schemas/ExportVoucherTransactionsFilters", + "description": "Filter conditions." } }, - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer % Promotion", - "request_id": "v-0ae28a621c46af534b", - "resource_id": "Summer % Promotion", - "resource_type": "campaign" - } - } - } - } - } - } - } - } - }, - "/v1/reward-object": { - "get": { - "operationId": "reward-object", - "tags": [ - "REWARDS API" - ], - "summary": "Reward Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Reward object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } - } - } - } - } - } - }, - "/v1/reward-assignment-object": { - "get": { - "operationId": "reward-assignment-object", - "tags": [ - "REWARDS API" - ], - "summary": "Reward Assignment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Reward Assignment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "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" } } - } - } - } - } - }, - "/v1/rewards": { - "get": { - "operationId": "list-rewards", - "tags": [ - "REWARDS API" - ], - "summary": "List Rewards", - "description": "Retrieve rewards.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" }, - "in": "query", - "name": "assignment_id", - "description": "A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of reward objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_res_list_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rew_3e7IqghVtTR7L3xQMSCxjFu2", - "name": "Get $10", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "balance": 1000, - "type": "GIFT_VOUCHERS" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-03-10T08:40:20.917Z", - "updated_at": "2022-08-17T07:52:56.965Z", - "metadata": null, - "object": "reward" - }, - { - "id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "name": "Get 100 Points", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "balance": 100, - "type": "LOYALTY_PROGRAM" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-02-28T11:56:13.764Z", - "updated_at": null, - "metadata": null, - "object": "reward" - }, - { - "id": "rew_BNZ3van6AF2AiquWp8Lfw0xq", - "name": "30% discount", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_ZtHLATYVpItqmuSqmaz1rZ2Y", - "type": "DISCOUNT_COUPONS" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T09:48:50.609Z", - "updated_at": null, - "metadata": {}, - "object": "reward" - }, - { - "id": "rew_nlV8bgWU1jNO9YWQ7CdZmzq7", - "name": "1 point = $0.01", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 0.01, - "points_ratio": 1 - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T16:45:21.582Z", - "updated_at": null, - "metadata": { - "Type": "0.01" - }, - "object": "reward" - }, - { - "id": "rew_x6FmF1KFdDs06hYPr9lK6ajf", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619" - } - }, - "stock": "4", - "redeemed": "1", - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_wJHdZUAVSpWtYM6ORq4up3I2.png", - "description": "Get a Comic Book in Archie's series." - }, - "created_at": "2022-08-17T07:13:32.781Z", - "updated_at": null, - "metadata": { - "Type": "Personal" - }, - "object": "reward" - } - ], - "total": 5 - } + "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." } - } - } - } - } - }, - "post": { - "operationId": "create-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Create Reward", - "description": "Create a new reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define parameters of the new reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_create_reward" }, - "examples": { - "Gift card credits": { - "value": { - "name": "Digital - Gift Card Reward", - "type": "CAMPAIGN", - "metadata": { - "Type": "Gift" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 3000 - } - } - } - }, - "Discount Coupon": { - "value": { - "name": "Digital - Discount Coupon", - "type": "CAMPAIGN", - "metadata": { - "Type": "Discount" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1" + "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" } - } + ] } }, - "Loyalty Points": { - "value": { - "name": "Digital - Loyalty Points Reward", - "type": "CAMPAIGN", - "metadata": { - "Type": "Loyalty Points" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 100 - } - } - } + { + "title": "string", + "type": "string" }, - "Pay with Points": { - "value": { - "name": "Pay with Points Reward", - "type": "COIN", - "metadata": { - "Type": "Coin" - }, - "parameters": { - "coin": { - "exchange_ratio": 900, - "points_ratio": 8000 - } - } - } + { + "title": "number", + "type": "number" }, - "Material Reward": { - "value": { - "name": "Get a Comic Book", - "metadata": { - "Type": "Material" - }, - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" + { + "title": "object", + "type": "object" + } + ], + "title": "Any" + }, + "LoyaltiesCreateTiersRequestBody": { + "title": "Loyalties Create Tiers Request Body", + "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" } - }, - "stock": 2, - "attributes": { - "image_url": "https://www.website.com/img_fPHsk9Ob.png", - "description": "Archie's Series" } } - } + ] } - } - } - }, - "responses": { - "200": { - "description": "Returns a reward object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + }, + "LoyaltiesCreateTiersResponseBody": { + "title": "Loyalties Create Tiers Response Body", + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "LoyaltiesGetRewardAssignmentResponseBody": { + "$ref": "#/components/schemas/RewardAssignment" + }, + "LoyaltiesGetRewardDetailsResponseBody": { + "$ref": "#/components/schemas/Reward" + }, + "LoyaltiesListTiersRequestQuery": { + "title": "Loyalties List Tiers Request Query", + "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." }, - "examples": { - "Material": { - "value": { - "id": "rew_Crmu3hu2FKZWZIML59AeAs1n", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } - }, - "stock": "2", - "redeemed": null, - "attributes": { - "image_url": "https://www.website.com/img_fPH9oOb.png", - "description": "Archie's Series" - }, - "created_at": "2022-08-25T11:20:58.172Z", - "updated_at": null, - "metadata": { - "Type": "Material" - }, - "object": "reward" - } - } + "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." } } - } - } - } - } - }, - "/v1/rewards/{rewardId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "rew_2erjvECLs92GYzKbak3QkyTV" - }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." - } - ], - "get": { - "operationId": "get-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Get Reward", - "description": "Retrieve a reward by the reward ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward object if a valid identifier was provided. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" + }, + "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { + "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", + "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." } } - } - }, - "404": { - "description": "Not Found. When requesting a reward that has been deleted or does not exist, the resource will not be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "LoyaltiesGetTierResponseBody": { + "$ref": "#/components/schemas/LoyaltyTier" + }, + "LoyaltiesListTiersResponseBody": { + "title": "Loyalties List Tiers Response Body", + "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." }, - "examples": { - "Not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkG", - "request_id": "v-0b8c77bcc890215e35", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkG", - "resource_type": "reward" - } + "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." } - } - } - } - } - }, - "put": { - "operationId": "update-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Update Reward", - "description": "Update the details of a reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define the parameters to be updated for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_update_reward" }, - "examples": { - "Gift card credits": { - "value": { - "name": "Digital - Gift Card Reward", - "metadata": { - "Type": "Gift" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 3000 - } - } - } + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltiesListMemberLoyaltyTiersResponseBody": { + "title": "Loyalties List Member Loyalty Tiers Response Body", + "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." }, - "Discount Coupon": { - "value": { - "name": "Digital - Discount Coupon", - "metadata": { - "Type": "Discount" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1" - } - } - } + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." }, - "Loyalty points": { - "value": { - "name": "Digital - Loyalty Points Reward", - "metadata": { - "Type": "Loyalty Points" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 100 - } - } + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" } }, - "Pay with Points": { - "value": { - "name": "Pay with Points Reward", - "metadata": { - "Type": "Coin" - }, - "parameters": { - "coin": { - "exchange_ratio": 900, - "points_ratio": 8000 - } - } - } + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "EarningRule": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" }, - "Material Reward": { - "value": { - "name": "Get a Comic Book", - "metadata": { - "Type": "Physical product" + { + "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." }, - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } + "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." }, - "stock": 2, - "attributes": { - "image_url": "https://www.website.com/img_fPH9.png", - "description": "Comic book" - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an updated reward object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "examples": { - "Material": { - "value": { - "id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "name": "Get a Comic Book", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } - }, - "stock": "2", - "redeemed": null, - "attributes": { - "image_url": "https://www.website.com/img_fPH9.png", - "description": "Comic book" - }, - "created_at": "2022-08-25T10:00:12.794Z", - "updated_at": "2022-08-25T10:06:30.655Z", - "metadata": { - "Type": "Physical product" - }, - "object": "reward" + "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" + ] } - } - } - }, - "400": { - "description": "Returns an error if the balance parameter is not defined correctly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_balance" + ] + }, + "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { + "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." }, - "examples": { - "Invalid Balance": { - "value": { - "code": 400, - "key": "invalid_balance", - "message": "Property 'parameters.campaign.balance' is invalid", - "details": "Property 'parameters.campaign.balance' must be greater than zero for campaign type: GIFT_VOUCHERS", - "request_id": "v-0b96d2b90dce48855f" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Delete Reward", - "description": "Delete a reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "400": { - "description": "Bad Request. Returns an error indicating that the reward with given ID is assigned to a resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_resource_in_use" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "resource_in_use", - "message": "Resource in use", - "details": "Resource reward with id rew_fcYALROsORec6cP0VBItCVfq is in use by reward_assignments with ids [rewa_5WV7H3y2lT3GGl03Xjw29IEc]", - "request_id": "v-0b8c7b967950216291", - "related_object_ids": [ - "rewa_5WV7H3y2lT3GGl03Xjw29IEc" - ], - "related_object_type": "reward_assignment" - } - } - } - } - } - }, - "404": { - "description": "Returns an error indicating that the reward with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of earning rule objects." }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", - "request_id": "v-0ae29895e8c6b7781a", - "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", - "resource_type": "reward" - } - } - } - } - } - } - } - } - }, - "/v1/rewards/{rewardId}/assignments": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." - } - ], - "get": { - "operationId": "list-reward-assignments", - "tags": [ - "REWARDS API" - ], - "summary": "List Reward Assignments", - "description": "Retrieve reward assignments by the reward ID.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_wciTvaOfYmAa3EmIIW3QpXXZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 15 - } - }, - "created_at": "2022-08-17T08:13:02.507Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 20 - } - }, - "created_at": "2022-08-24T11:40:22.418Z", - "updated_at": null, - "object": "reward_assignment" - } - ], - "total": 2 - } + "data": { + "type": "array", + "description": "Contains array of earning rule objects.", + "items": { + "$ref": "#/components/schemas/EarningRule" } - } - } - } - }, - "404": { - "description": "Returns an error if the given reward is missing, does not exist or was deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "request_id": "v-0b95a68c678ad5c765", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "resource_type": "reward" - } - } + "total": { + "type": "integer", + "description": "Total number of earning rule objects." } - } - } - } - } - }, - "post": { - "operationId": "create-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Create Reward Assignment", - "description": "Assigns a reward to a specified loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_create_reward_assignment" }, - "examples": { - "Example": { - "value": { - "campaign": "camp_OTuGGP90PivbvROsRvfM65El", - "parameters": { - "loyalty": { - "points": 39 - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltyTierBase": { + "title": "Loyalty Tier Base", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Loyalty Tier name." }, - "examples": { - "Example": { - "value": { - "id": "rewa_cqD2XE5x8LcD2c1FLlvqikti", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_OTuGGP90PivbvROsRvfM65El", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 39 - } - }, - "created_at": "2022-08-24T13:44:42.610Z", - "updated_at": null, - "object": "reward_assignment" - } - } - } - } - } - }, - "400": { - "description": "Returns an error if request body parameters are missing.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_missing_param" + "earning_rules": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule." }, - "examples": { - "Missing Parameter": { - "value": { - "code": 400, - "key": "missing_param", - "message": "Missing required parameter", - "details": "Parameter 'parameters.loyalty' is required", - "request_id": "v-0b95c7f3684ad5f06d" - } - } - } - } - } - }, - "404": { - "description": "Returns an error when creating a reward assignment for a reward that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "request_id": "v-0b95c0bedf46fcbe83", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "resource_type": "reward" - } + "rewards": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" }, - "Missing Campaign": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id null", - "request_id": "v-0b95c68b12cad5eebb", - "resource_id": null, - "resource_type": "campaign" - } - } - } - } - } - }, - "409": { - "description": "Returns an error if a conflict is found, i.e. an assignment for the reward has already been created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" + "description": "Contains a list of reward IDs and their points mapping for the given reward." }, - "examples": { - "Duplicate Found": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated reward_assignment exists with id rewa_q1Ad955TUZS4nVIxplOw9pL3", - "request_id": "v-0b95c78daa06fcc6bb", - "resource_id": "rewa_q1Ad955TUZS4nVIxplOw9pL3", - "resource_type": "reward_assignment" + "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." } } } - } - } - } - } - } - }, - "/v1/rewards/{rewardId}/assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "rew_2erjvECLs92GYzKbak3QkyTV" - }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." - }, - { - "schema": { - "type": "string", - "example": "rewa_YkwQ5ezNYTQV2geodMVhTpy4" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique reward assignment ID." - } - ], - "put": { - "operationId": "update-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Update Reward Assignment", - "description": "Update the number of points needed to successfully redeem the reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define the number of points required to exchange for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_update_reward_assignment" }, - "examples": { - "Example": { - "value": { - "parameters": { - "loyalty": { - "points": 35 - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the updated reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "required": [ + "name", + "points" + ] + }, + "LoyaltyTier": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" }, - "examples": { - "Example": { - "value": { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 35 + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID." + }, + "campaign_id": { + "type": "string", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in points.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + } + }, + "expiration": { + "type": "object", + "description": "Defines loyalty tier expiration date.", + "properties": { + "customer_id": { + "type": "string" + }, + "campaign_id": { + "type": "string" + }, + "tier_id": { + "type": "string" + }, + "start_date": { + "type": "string", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" } }, - "created_at": "2022-08-24T11:40:22.418Z", - "updated_at": "2022-08-24T13:02:32.262Z", - "object": "reward_assignment" - } - } - } - } - } - }, - "404": { - "description": "Returns an error indicating that the reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76XI", - "request_id": "v-0b95b8760a4ad5dda1", - "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76XI", - "resource_type": "reward_assignment" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Delete Reward Assignment", - "description": "This method deletes a reward assignment for a particular reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the reward or reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", - "request_id": "v-0ae29f325e1027cde8", - "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", - "resource_type": "reward" + "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." } }, - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_YkwQ5ezNYTQV2geodMVhTpy", - "request_id": "v-0ae2a0588b9027cf95", - "resource_id": "rewa_YkwQ5ezNYTQV2geodMVhTpy", - "resource_type": "reward_assignment" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "get-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve a reward assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + "required": [ + "id", + "campaign_id", + "metadata", + "created_at", + "config", + "object" + ] } - } - } - }, - "404": { - "description": "Returns an error indicating that the reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + ] + }, + "MappingMultiply": { + "title": "MappingMultiply", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "MULTIPLY" + ], + "description": "Type of calculation." }, - "examples": { - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76X", - "request_id": "v-0b95b596e98ad5da24", - "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "resource_type": "reward_assignment" - } - } + "multiplier": { + "type": "number", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." } } - } - } - } - } - }, - "/v1/publication-object": { - "get": { - "operationId": "publication-object", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Publication Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Publication Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_obj_publication_object" + }, + "MappingFixed": { + "title": "MappingFixed", + "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." } } - } - } - } - } - }, - "/v1/publications/create": { - "get": { - "operationId": "create-publication-1", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Create Publication", - "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet.\n> ❗️ Limited access\n>\n> Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a [dedicated endpoint](ref:create-publication). \n\n\n> 📘 Specifying the voucher to be published\n>\n> - In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign and in the query parameters specify the `campaign` without specifying the voucher.\n> - If you would like to publish a specific code from a specific campaign, then you need to provide the `campaign` and the `voucher` parameters.\n> - If you would like to publish a standalone voucher, then omit the campaign parameter and simply provide the `voucher` parameter. \n\n## Example Request \n```markdown Publication Query \n/publications/create?campaign=camp_T0bUgWGCAV6S0X3smH4MEboG&metadata[year]=2&metadata[Date]=2023-03-03&metadata[DateTime]=2023-03-03T14:06:08.311Z&metadata[Flag]=true&metadata[Number]=222&metadata[String]=stringy&metadata[ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&metadata[Object][payment][payment_tax]=9&metadata[Object][payment][payment_method]=Visa&metadata[Object][payment][payment_date]=2023-03-03&metadata[Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&metadata[Object][payment][payment_completed]=true&metadata[Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[source_id]=try-new-12&customer[name]=John%20Jimmy&customer[description]=This is testing the publication endpoint.&customer[email]=johnjimy2%40email.com&customer[phone]=%2B48%20123%20333%20333&customer[address][city]=Warsaw&customer[address][state]=Mazowieckie&customer[address][line_1]=4499%20Main%20St.&customer[address][line_2]=Blg%202%20APT%204&customer[address][country]=Poland&customer[address][postal_code]=122333&customer[birthday]=2222-01-22&customer[metadata][paid_bill]=true&customer[metadata][age]=22&customer[metadata][location]=Poland&customer[metadata][acquisition_date]=2022-09-09&customer[metadata][birth_date]=2023-03-20T18:44:19.215Z&customer[metadata][ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][location-unknown][city]=Katowice&customer[metadata][location-unknown][state]=slask&customer[metadata][location-unknown][number]=2&customer[metadata][location-unknown][date]=2034-09-11&customer[metadata][location-unknown][dateTime]=2023-03-20T18:44:19.215Z&customer[metadata][Object][payment][payment_date]=2023-03-03&customer[metadata][Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&customer[metadata][Object][payment][payment_completed]=true&customer[metadata][Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][Object][payment][payment_tax]=9&customer[metadata][Object][payment][payment_method]=Visa```", - "parameters": [ - { - "schema": { - "type": "string", - "example": "custom_publication_source_id" - }, - "in": "query", - "name": "source_id", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." - }, - { - "schema": { - "type": "string", - "example": "PROMO-1LwwzYI" }, - "in": "query", - "name": "voucher", - "description": "Code of voucher being published. If there is a particular code that you would like to publish, then you can use this parameter to specify the code. You can omit this parameter if you would like to publish a random code from a campaign, where the campaign is in `AUTO_UPDATE` mode." - }, - { - "name": "metadata", - "in": "query", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.", - "style": "deepObject", - "explode": true, - "schema": { - "type": "object" - } - }, - { - "name": "customer", - "in": "query", - "required": true, - "description": "Specify the customer who is to receive a code. You can either directly provide the respective ID's as strings or provide them in the form of an object.", - "style": "deepObject", - "explode": true, - "schema": { + "MappingPoints": { "anyOf": [ { - "$ref": "#/components/schemas/5_req_create_publication_customer" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + "$ref": "#/components/schemas/MappingMultiply" }, { - "$ref": "#/components/schemas/9_req_create_customer" + "$ref": "#/components/schemas/MappingFixed" } ] - } - }, - { - "name": "campaign", - "in": "query", - "required": true, - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. You can use this parameter without having to specify a particular `voucher` code if the campaign is in `AUTO_UPDATE` mode. This parameter not required for a standalone code, however, if you intend to use a code from a campaign, then this parameter is required.", - "style": "deepObject", - "explode": true, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_campaign" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_campaign_id" - }, + }, + "a_req_importCSV": { + "type": "object", + "title": "Import CSV file", + "description": "Request body schema for importing data using a CSV file.", + "format": "binary", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "File path." + } + }, + "required": [ + "file" + ] + }, + "a_res_async_actions": { + "type": "object", + "title": "Asynchronous Actions", + "description": "Response to requests that are processed asynchronously.", + "additionalProperties": false, + "examples": [ { - "$ref": "#/components/schemas/5_req_create_publication_campaign_name" + "async_action_id": "aa_0a875d56c805df6601" + } + ], + "properties": { + "async_action_id": { + "type": "string", + "example": "aa_0a875d56c805df6601", + "description": "The ID of the scheduled asynchronous action." } + }, + "required": [ + "async_action_id" ] - } - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a publication object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_create_publication" - }, - "examples": { - "Example": { - "value": { - "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", - "object": "publication", - "created_at": "2022-09-30T16:30:32.924Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "pub_source_customer_5", - "metadata": { - "year": 2022 - }, - "channel": "myown", - "source_id": "publication_source_ID_10", - "result": "SUCCESS", - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "voucher": { - "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", - "code": "cEsMn0uA", - "campaign": "Test - Discount Effect - Amount - Items", - "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-30T16:30:32.956Z", - "updated_at": null, - "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "vouchers_id": [ - "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" - ] - } - } + }, + "error": { + "title": "error", + "type": "object", + "properties": {}, + "discriminator": { + "propertyName": "key", + "mapping": { + "not_enough_codes": "not_enough_codes" } - } - } - }, - "400": { - "description": "Returns an error if the query parameters are incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "description": "Short error response", + "examples": [] + }, + "e_error": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." }, - "examples": { - "Missing customer": { - "value": { - "code": 400, - "key": "invalid_query_params", - "message": "Invalid query params", - "details": "Query should have required property 'customer'", - "request_id": "v-0c8b6423f3c80ed3e4" - } - }, - "Missing vouchers": { - "value": { - "code": 400, - "key": "missing_vouchers", - "message": "Missing vouchers", - "details": "Either Campaign or Voucher is required" - } - }, - "Voucher cannot be published": { - "value": { - "code": 400, - "key": "voucher_cannot_be_published", - "message": "Voucher cannot be published", - "details": "Voucher cannot be published. Customer already joined program.", - "request_id": "v-0c8b763544080efed2" - } - }, - "Voucher already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_vM7vQZmgV86k0wuz05cFAOfarj4s8BQE' has already been published", - "request_id": "v-0c8baebc67c80e97a0" - } - }, - "Duplicate source ID": { - "value": { - "code": 400, - "key": "duplicate_source_id", - "message": "Duplicate source_id", - "details": "Publication with source_id: 'test_publication_source_id_test_voucher' already exists", - "request_id": "v-0c8b7e8f78c80e94a2" - } - }, - "Too many vouchers requested": { - "value": { - "code": 400, - "key": "too_many_vouchers_requested", - "message": "Too many vouchers requested", - "details": "Only up to 1 can be published", - "request_id": "v-0c8bac9a25c80e912d" - } - }, - "Metadata validation failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "ImageURL: must be a URL pointing to JPG/JPEG or PNG resource (actual value is 'http.com')", - "request_id": "v-0c8bcbd742080ee807" + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "error": { + "type": "object", + "description": "Contains custom user-defined error message translation.", + "properties": { + "message": { + "type": "string", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" } } } } - } - }, - "403": { - "description": "Returns an error if you don't have a specific credentials set up. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_integration_key" + }, + "e_error_expanded": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Unique resource ID that can be used in another endpoint to get more details.", + "example": "rf_0c5d710a87c8a31f86" }, - "examples": { - "Example": { - "value": { - "code": 403, - "message": "Forbidden", - "key": "integration_api_key_required" + "resource_type": { + "type": "string", + "description": "The resource type.", + "example": "redemption" + }, + "error": { + "type": "object", + "description": "Contains custom user-defined error message translation.", + "properties": { + "message": { + "type": "string", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" } } } } - } - }, - "404": { - "description": "Returns an error if a resource is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "e_error_no_translation": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." }, - "examples": { - "Resource not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_xqA7DGj5eYPHg6PHVKwYRWiA", - "request_id": "v-0c8b6b35294af6f192", - "resource_id": "cust_xqA7DGj5eYPHg6PHVKwYRWiA", - "resource_type": "customer" - } - } + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - } - } - } - }, - "/v1/publications": { - "get": { - "operationId": "list-publications", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "List Publications", - "description": "Retrieve a list of publications. To return a **particular** publication, you can use the `source_id` query parameter and provide the `source_id` of the publication you are looking for specifically.\n\n## Pagination\n\n\n> 🚧 Important!\n>\n> If you want to scroll through a huge set of records, it is recommended to use the [Exports API](ref:create-export). This API will return an error `page_over_limit` if you reach a page above 1000.\n\n## Filter Query\n\nThe `filters` query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:\n\n\n```url\nfilters[][conditions][][]=\n```\n\n### Operators:\n\n\n```\n \"$in\"\n \"$not_in\"\n \"$is\"\n \"$is_not\"\n \"$has_value\"\n \"$is_unknown\"\n \"$contains\"\n \"$starts_with\"\n \"$ends_with\"\n \"$more_than\"\n \"$less_than\"\n \"$more_than_equal\"\n \"$less_than_equal\"\n```\n\n### Examples\n\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR\n```", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at", - "channel", - "-channel" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign", - "description": "Filters by a given campaign name." - }, - { - "schema": { - "type": "string", - "example": "cust_jl33V8ZDQJp4goU1z8DmFioo" - }, - "in": "query", - "name": "customer", - "description": "Filters by a unique customer ID." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "voucher", - "description": "Filters by a given voucher code." - }, - { - "schema": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ] - }, - "in": "query", - "name": "result", - "description": "Filters by a publication result." - }, - { - "schema": { - "type": "string", - "enum": [ - "discount", - "loyalty", - "lucky_draw" - ] }, - "in": "query", - "name": "voucher_type", - "description": "Filters by a voucher type." - }, - { - "schema": { - "type": "boolean" + "e_integration_key": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + } + } }, - "in": "query", - "name": "is_referral_code", - "description": "This filter works only for the `true` option. If set to `true`, the query returns only publications of codes from referral campaigns. " - }, - { - "schema": { - "type": "string" + "e_400_missing_param": { + "description": "Error: Bad Request → Missing Parameters", + "type": "object", + "title": "Missing Parameters", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "missing_param", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Missing required parameter", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Parameter 'custom_event.schema_id' is required", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96c19b1a41c03999", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } }, - "in": "query", - "name": "filters", - "description": "Allows for combining the filters mentioned in the endpoint description." - }, - { - "schema": { - "type": "string" + "e_400_not_enough_source_ids": { + "description": "Error: Bad Request → Missing Parameters", + "type": "object", + "title": "Not Enough Source ID's", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "not_enought_source_ids", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Not enough source_ids", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Specify at least 1 source_id", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96c19b1a41c03999", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } }, - "in": "query", - "name": "source_id", - "description": "Using this endpoint with a particular publication `source_id`, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of publications you’ve previously created with [create publication](ref:create-publication) or implicitly by the distribution manager. The publications are returned in sorted order, with the most recent ones appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_list_publications" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "publications", - "publications": [ - { - "id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu", - "object": "publication", - "created_at": "2022-09-28T13:31:23.522Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "cindy.jones@email.com", - "metadata": { - "distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei", - "source_type": "distribution", - "source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei" - }, - "channel": "Automation", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Cindy Jones", - "email": "cindy.jones@email.com", - "source_id": "cindy.jones@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "voucher": { - "code": "FNV5IrtY", - "object": "voucher", - "campaign": "Loyalty Campaign", - "loyalty_card": { - "points": 0, - "balance": 0 - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD" - ] - }, - { - "id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX", - "object": "publication", - "created_at": "2022-09-28T13:31:02.766Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "sandy.jones@email.com", - "metadata": {}, - "channel": "voucherify-website", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Sandy Jones", - "email": "sandy.jones@email.com", - "source_id": "sandy.jones@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "voucher": { - "code": "Voucher-1", - "object": "voucher", - "campaign": null, - "discount": { - "type": "AMOUNT", - "amount_off": 200, - "amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)", - "effect": "APPLY_TO_ORDER" - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu" - ] - }, - { - "id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV", - "object": "publication", - "created_at": "2022-09-13T06:15:08.249Z", - "customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G", - "tracking_id": "1", - "metadata": {}, - "channel": "voucherify-website", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_ur1hIPGflbaAe14mLlLdon3G", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "1", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "voucher": { - "code": "GIFT-WOZaK5YF1Fs87tAX", - "object": "voucher", - "campaign": "Gift Cards", - "gift": { - "amount": 0, - "balance": 0 - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc" - ] - } - ], - "total": 3 - } - } + "e_400_invalid_payload": { + "title": "Invalid Payload", + "type": "object", + "description": "Error: Bad Request → Invalid Payload", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_payload", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid payload", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - }, - "400": { - "description": "Returns an error if you request a page higher than 1000.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "e_400_invalid_balance": { + "title": "Invalid Balance", + "type": "object", + "description": "Error: Bad Request → Invalid Balance", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "page_over_limit", - "message": "Listing resource above 1000 page is not supported", - "details": "Property .page cannot be higher than 1000", - "request_id": "v-0bc2a39574c61362af" - } - } + "key": { + "type": "string", + "default": "invalid_balance", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - } - } - }, - "post": { - "operationId": "create-publication", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Create Publication", - "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.", - "parameters": [ - { - "schema": { - "type": "boolean" }, - "in": "query", - "name": "join_once", - "description": "Through this flag, you can control if a particular person gets only one and always the same code even if the app sends multiple publication requests. It means that if you have a referral program, a referrer is assigned only to one code if an integration sends publication requests more than once for the same customer." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the publication parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_req_create_publication" - }, - "examples": { - "Example - Specific Voucher": { - "value": { - "campaign": { - "name": "campaign-name" - }, - "customer": { - "source_id": "source-id", - "Name": "Customer Name", - "email": "customer email" - }, - "voucher": "voucher-code", - "metadata": { - "key": "value" - } - } + "e_400_resource_in_use": { + "title": "Resource in use", + "type": "object", + "description": "Error: Bad Request - Resource in use", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "Example - Random Voucher": { - "value": { - "campaign": { - "name": "campaign-name", - "count": 1 - }, - "customer": { - "source_id": "source-id", - "Name": "Customer Name", - "email": "customer email" - }, - "voucher": "voucher-code", - "metadata": { - "key": "value" - } - } + "key": { + "type": "string", + "default": "resource_in_use", + "description": "Short string describing the kind of error which occurred." }, - "Example 3": { - "value": { - "source_id": "publication_source_ID_10", - "campaign": "Test - Discount Effect - Amount - Items", - "channel": "myown", - "customer": { - "source_id": "pub_source_customer_5", - "name": "Bob Jones", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "1901-12-01" - }, - "metadata": { - "year": 2022 - } + "message": { + "type": "string", + "default": "Resource in use", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "related_object_ids": { + "type": "array", + "description": "Name or ID of the resources that are related.", + "items": { + "type": "string", + "example": "rewa_5WV7H3y2lT3GGl03Xjw29IEc" } + }, + "related_object_type": { + "type": "string", + "description": "Specifies the type of resource that is related." } } - } - } - }, - "responses": { - "200": { - "description": "Returns a publication object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_create_publication" - }, - "examples": { - "Example": { - "value": { - "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", - "object": "publication", - "created_at": "2022-09-30T16:30:32.924Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "pub_source_customer_5", - "metadata": { - "year": 2022 - }, - "channel": "myown", - "source_id": "publication_source_ID_10", - "result": "SUCCESS", - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "voucher": { - "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", - "code": "cEsMn0uA", - "campaign": "Test - Discount Effect - Amount - Items", - "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-30T16:30:32.956Z", - "updated_at": null, - "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "vouchers_id": [ - "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" - ] - } - } + }, + "e_400_invalid_export_fields": { + "title": "Invalid Export Fields", + "type": "object", + "description": "Error: Bad Request → Invalid Export Fields", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_export_fields", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid Export", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - }, - "400": { - "description": "Returns an error if a publication with the same source ID already exists in the system or some request body parameter is missing.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + }, + "e_400_invalid_voucher": { + "title": "Invalid Voucher", + "type": "object", + "description": "Error: Bad Request → Invalid Voucher", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "examples": { - "Missing Parameters": { - "value": { - "code": 400, - "key": "missing_vouchers", - "message": "Missing vouchers", - "details": "Either Campaign or Voucher is required" - } - }, - "Already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_Y5P4UZ1yilkiYOIJmAAgWazUi1wfkNwF' has already been published", - "request_id": "v-0bc40bb800d5651137" - } - }, - "Duplicate Source ID": { - "value": { - "code": 400, - "key": "duplicate_source_id", - "message": "Duplicate source_id", - "details": "Publication with source_id: 'publication_source_ID_1' already exists", - "request_id": "v-0bc40bf81555651191" - } - } + "key": { + "type": "string", + "default": "invalid_voucher", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid Voucher", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - }, - "404": { - "description": "Returns an error if a resource is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "e_400_invalid_validation_rules": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code.", + "default": 400 + }, + "key": { + "type": "string", + "default": "invalid_validation_rules", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + } + }, + "title": "Invalid Validation Rules", + "description": "Error: Bad Request → Invalid Validation Rules" + }, + "e_400_not_enough_codes": { + "title": "Not Enough Codes", + "type": "object", + "description": "Error: Bad Request → Not enough codes", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id 1", - "request_id": "v-0bc40546e5d56508e5", - "resource_id": "1", - "resource_type": "campaign" - } - } + "key": { + "type": "string", + "default": "not_enough_codes", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Not enough codes", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Specify at least 1 code in codes.", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - } - } - } - }, - "/v1/validation-object": { - "get": { - "operationId": "validation-object", - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validation Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Object", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher" - } - ] + }, + "e_400_metadata_validation_failed": { + "title": "Metadata Validation Failed", + "type": "object", + "description": "Error: Bad Request → Metadata validation failed", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "metadata_validation_failed", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Metadata validation failed", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Ranking: must be a number (actual value is 'true')", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." } } - } - } - } - } - }, - "/v1/vouchers/{code}/validate": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "Testing7fjWdr" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A code that identifies the voucher." - } - ], - "post": { - "operationId": "validate-voucher", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Voucher [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys. \n\n\n> ❗️ Important \n>\n> This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](ref:stackable-discounts-api). The stacking discounts API lets you validate up to 5 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.\n\n#### Gift Vouchers - validate Gift Card and control amount to redeem\nVoucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition. \n\nThis operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.\n\nIf a validation session is established, then the session details will be returned as well. Read more about sessions [here](doc:locking-validation-session).\n\nVoucher validation might fail because of one of these reasons:\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of start date - expiration date time frame\n* `voucher is disabled` - learn more about a [disabled voucher](ref:disable-voucher)\n* `customer does not match segment rules` - learn more [customer tracking](doc:customers#customer-tracking) \n* `order does not match validation rules` - learn more about [validation rules](doc:validation-rules)", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher validation context using the request body parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_voucher" - }, - "examples": { - "Free Shipping": { - "value": { - "customer": { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M" - }, - "order": { - "items": [ - { - "product_id": "prod_0ba621bae5d39762ce", - "quantity": "1" - }, - { - "product_id": "prod_0b661d404787ec6d3b", - "quantity": "1", - "price": 3100 - } - ] - } - } - }, - "Multiple Product Variants": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP" - } - } + }, + "e_400_missing_reward": { + "title": "Missing Reward", + "type": "object", + "description": "Error: Bad Request → Missing Reward", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "Unit - Add order items": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8" - }, - "session": { - "type": "LOCK", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } + "key": { + "type": "string", + "default": "missing_reward", + "description": "Short string describing the kind of error which occurred." }, - "Fixed": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "items": [ - { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" - }, - { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" - } - ] - }, - "session": { - "type": "LOCK" - } - } + "message": { + "type": "string", + "default": "Missing reward", + "description": "A human-readable message providing a short description about the error." }, - "Percentage": { - "value": { - "customer": { - "source_id": "your_customer_source_ID", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "1960-12-01" - }, - "order": { - "items": [ - { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" - }, - { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" - } - ] - }, - "session": { - "type": "LOCK", - "key": "your_custom_key", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } + "details": { + "type": "string", + "example": "A reward is required when redeeming a LOYALTY_CARD", + "description": "A human-readable message providing more details about the error." }, - "Amount": { - "value": { - "customer": { - "source_id": "your_customer_source_ID", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "1960-12-01" - }, - "order": { - "items": [ - { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" - }, - { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" - }, - { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" - } - ], - "metadata": { - "currency": "EUR" - } - }, - "session": { - "type": "LOCK", - "key": "your_custom_key", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." }, - "Loyalty Card": { - "value": { - "order": { - "items": [ - { - "product_id": "prod_0bd76fc58f8038b043", - "quantity": "1" - }, - { - "product_id": "prod_0bd76bd0e204542738", - "quantity": "1" - } - ] - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "points": 10 - } - } + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." }, - "Gift Card": { - "value": { - "customer": { - "source_id": "286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d" - }, - "order": { - "amount": 1000, - "metadata": { - "currency": "USD" - } - }, - "gift": { - "credits": 2 - }, - "metadata": { - "location_id": [ - "L1" - ] - } - } + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." }, - "Referral Code": { - "value": { - "customer": { - "source_id": "earlybirdcust" - }, - "order": { - "amount": 20000, - "metadata": { - "currency": "USD" - } - }, - "metadata": { - "location_id": [ - "L1" - ] + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "Missing reward = please add one.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" } } } } - } - } - }, - "responses": { - "200": { - "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the request body.", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - } - ] + }, + "e_400_missing_order": { + "title": "Missing Order", + "type": "object", + "description": "Error: Bad Request → Missing Order", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." }, - "examples": { - "False": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Gift Card cannot be redeemed because of violated validation rules: val_wvipKm99CJuL", - "request_id": "v-0bccef7a9585cf63b6" - }, - "tracking_id": "track_ZGPtmYcM+Mw=", - "code": "vBQvYFEM", - "metadata": {} - } - }, - "Free Shipping": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "order": { - "amount": 4300, - "total_amount": 4300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0ba621bae5d39762ce", - "quantity": 1, - "amount": 1200, - "price": 1200, - "subtotal_amount": 1200, - "product": { - "id": "prod_0ba621bae5d39762ce", - "source_id": "arabica_plus", - "name": "Arabica Coffee 250g", - "price": 1200 - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d404787ec6d3b", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0b661d404787ec6d3b", - "source_id": "7717f389-4621-4c7a-a6db-d4acfe051a97", - "name": "Kate Moss by Mario Testino" - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "Test - Discount - Free Shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "metadata": {} - } - }, - "Multiple Product Varients": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", - "created_at": "2022-09-21T13:09:25.773Z", - "updated_at": "2022-09-21T13:09:27.139Z", - "status": "PAID", - "amount": 237300, - "initial_amount": 28000, - "discount_amount": 8400, - "items_discount_amount": 209300, - "total_discount_amount": 217700, - "total_amount": 19600, - "items_applied_discount_amount": 209300, - "total_applied_discount_amount": 209300, - "items": [ - { - "object": "order_item", - "source_id": "A0E20000000295J", - "related_object": "sku", - "product_id": "prod_0b661d31134b299cc2", - "quantity": 1, - "amount": 9500, - "price": 9500, - "subtotal_amount": 9500, - "product": { - "id": "prod_0b661d31134b299cc2", - "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", - "name": "Keychain D‘Amico" - }, - "sku": { - "id": "sku_0b661d6265cb29ae52", - "source_id": "A0E20000000295J", - "sku": "Keychain D‘Amico", - "metadata": {}, - "price": 9500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000EAT6", - "related_object": "sku", - "quantity": 1, - "amount": 18500, - "price": 18500, - "subtotal_amount": 18500, - "product": { - "name": "Jogging pants Paolo Pecora light grey" - }, - "sku": { - "sku": "Jogging pants Paolo Pecora light grey", - "metadata": {} - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f7", - "quantity": 3, - "discount_quantity": 3, - "initial_quantity": 0, - "amount": 89700, - "discount_amount": 89700, - "initial_amount": 0, - "applied_discount_amount": 89700, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f7", - "source_id": "M0E20000000ELDG", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f6", - "quantity": 4, - "discount_quantity": 4, - "initial_quantity": 0, - "amount": 119600, - "discount_amount": 119600, - "initial_amount": 0, - "applied_discount_amount": 119600, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f6", - "source_id": "M0E20000000ELDF", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" - }, - "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bb9c69ca9d5a364b2": { - "date": "2022-09-21T13:09:25.799Z", - "related_object_type": "redemption", - "related_object_id": "r_0bb9c69ca9d5a364b2", - "stacked": [ - "r_0bb9c69ca9d5a364b3", - "r_0bb9c69ca9d5a364b4" - ] - } - } - }, - "code": "Test - Discount - Unit - Multiple - Product Variants", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 3, - "unit_type": "sku_0b661e41fc8d35a8f7", - "sku": { - "id": "sku_0b661e41fc8d35a8f7", - "source_id": "M0E20000000ELDG", - "sku": "Casual jacket Michael Kors beige" - }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } - }, - { - "effect": "ADD_NEW_ITEMS", - "unit_off": 4, - "unit_type": "sku_0b661e41fc8d35a8f6", - "sku": { - "id": "sku_0b661e41fc8d35a8f6", - "source_id": "M0E20000000ELDF", - "sku": "Casual jacket Michael Kors beige" - }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } - } - ] - }, - "metadata": {} - } - }, - "Unit - Add order items": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "ssn_K7DV3RbAGNCRVrPNZxJfld3FdwAQwOGl", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", - "created_at": "2022-09-21T13:09:25.773Z", - "updated_at": "2022-09-21T13:09:27.139Z", - "status": "PAID", - "amount": 117700, - "initial_amount": 28000, - "discount_amount": 8400, - "items_discount_amount": 89700, - "total_discount_amount": 98100, - "total_amount": 19600, - "items_applied_discount_amount": 89700, - "total_applied_discount_amount": 89700, - "items": [ - { - "object": "order_item", - "source_id": "A0E20000000295J", - "related_object": "sku", - "product_id": "prod_0b661d31134b299cc2", - "quantity": 1, - "amount": 9500, - "price": 9500, - "subtotal_amount": 9500, - "product": { - "id": "prod_0b661d31134b299cc2", - "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", - "name": "Keychain D‘Amico" - }, - "sku": { - "id": "sku_0b661d6265cb29ae52", - "source_id": "A0E20000000295J", - "sku": "Keychain D‘Amico", - "metadata": {}, - "price": 9500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000EAT6", - "related_object": "sku", - "quantity": 1, - "amount": 18500, - "price": 18500, - "subtotal_amount": 18500, - "product": { - "name": "Jogging pants Paolo Pecora light grey" - }, - "sku": { - "sku": "Jogging pants Paolo Pecora light grey", - "metadata": {} - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f8", - "quantity": 3, - "discount_quantity": 3, - "initial_quantity": 0, - "amount": 89700, - "discount_amount": 89700, - "initial_amount": 0, - "applied_discount_amount": 89700, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" - }, - "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bb9c69ca9d5a364b2": { - "date": "2022-09-21T13:09:25.799Z", - "related_object_type": "redemption", - "related_object_id": "r_0bb9c69ca9d5a364b2", - "stacked": [ - "r_0bb9c69ca9d5a364b3", - "r_0bb9c69ca9d5a364b4" - ] - } - } - }, - "code": "Test - Discount - Unit - Add new order items", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 3, - "unit_type": "sku_0b661e41fc8d35a8f8", - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige" - }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } - }, - "metadata": {} - } - }, - "Fixed": { - "value": { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "strict": false, - "price": 2000, - "price_formula": "IF(ORDER_AMOUNT > 400;0;20)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "products_collection", - "id": "pc_2KWKXn09Dk8neCfymqd4xOq8", - "strict": false, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "products_collection", - "id": "pc_x7HELQo52g2uI6nDuuOTRjAW", - "strict": false, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - } - ], - "total": 7, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "ssn_u8rvi3Ac70S5ZRELWrxYsR2bnolpVWNg", - "type": "LOCK", - "ttl": 7, - "ttl_unit": "DAYS" - }, - "order": { - "amount": 46500, - "items_discount_amount": 9300, - "total_discount_amount": 9300, - "total_amount": 37200, - "items_applied_discount_amount": 9300, - "total_applied_discount_amount": 9300, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "discount_amount": 1300, - "applied_discount_amount": 1300, - "price": 6500, - "subtotal_amount": 5200, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "discount_amount": 600, - "applied_discount_amount": 600, - "price": 6000, - "subtotal_amount": 5400, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "discount_amount": 2000, - "applied_discount_amount": 2000, - "price": 2000, - "subtotal_amount": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 5000, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "discount_amount": 4400, - "applied_discount_amount": 4400, - "price": 11000, - "subtotal_amount": 17600, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "SPENDMOREGETMORE-DaIXFJvn", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" - }, - "metadata": { - "shoutout": "Order more than 200€ to get 10% off pants, more than 300€ to get 20% off sweaters, and more than 400€ to get free shipping." - }, - "campaign": "SPENDMOREGETMORE", - "campaign_id": "camp_Nwb2mppeDTtk23s1FVo6riwp" - } - }, - "Voucher expired": { - "value": { - "valid": false, - "reason": "voucher expired", - "error": { - "code": 400, - "key": "voucher_expired", - "message": "voucher expired", - "details": "EarlyBird-tB6zCApA", - "request_id": "v-0be43067028abb6ca8" - }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "code": "EarlyBird-tB6zCApA", - "metadata": { - "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." - } - } - }, - "Percentage": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "session": { - "key": "your_custom_key", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 46500, - "discount_amount": 4650, - "total_discount_amount": 4650, - "total_amount": 41850, - "applied_discount_amount": 4650, - "total_applied_discount_amount": 4650, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "EarlyBird-tB6zCApA", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 10 - }, - "expiration_date": "2022-10-29T00:00:00.000Z", - "metadata": { - "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." - }, - "campaign": "Webinar - Early Bird Scenario", - "campaign_id": "camp_z1g3iFqQe5qiZ9TTYFVpMwC0" - } - }, - "Amount": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "session": { - "key": "your_custom_key", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 46500, - "discount_amount": 1000, - "total_discount_amount": 1000, - "total_amount": 45500, - "applied_discount_amount": 1000, - "total_applied_discount_amount": 1000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } - } - ], - "metadata": { - "currency": "EUR" - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "PAYINEUROS", - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 1000 - }, - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." - } - } - }, - "Loyalty points exceeded": { - "value": { - "valid": false, - "reason": "loyalty card points exceeded", - "error": { - "code": 400, - "key": "loyalty_card_points_exceeded", - "message": "loyalty card points exceeded", - "details": "LOYALTY-CARD-ng3Kb9tM", - "request_id": "v-0be434ae35cabb018a" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "LOYALTY-CARD-ng3Kb9tM", - "metadata": {} - } - }, - "Loyalty Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "order": { - "amount": 14500, - "discount_amount": 50, - "total_discount_amount": 50, - "total_amount": 14450, - "applied_discount_amount": 50, - "total_applied_discount_amount": 50, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bd76fc58f8038b043", - "quantity": 1, - "amount": 8500, - "price": 8500, - "subtotal_amount": 8500, - "product": { - "id": "prod_0bd76fc58f8038b043", - "source_id": "webinar_BF_sweater_yellow", - "name": "Yellow Sweater", - "price": 8500 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bd0e204542738", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "LOYALTY-CARD-ng3Kb9tM", - "loyalty": { - "points_cost": 10 - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy", - "points": 10 - }, - "metadata": {}, - "campaign": "Loyalty Campaign", - "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" - } - }, - "Voucher disabled": { - "value": { - "valid": false, - "reason": "voucher is disabled", - "error": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "GIFT-CARD-kW4aEsfB", - "request_id": "v-0be43817d7121a437d" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "GIFT-CARD-kW4aEsfB", - "metadata": {} - } - }, - "Gift Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "order": { - "amount": 1000, - "discount_amount": 2, - "total_discount_amount": 2, - "total_amount": 998, - "applied_discount_amount": 2, - "total_applied_discount_amount": 2, - "metadata": { - "currency": "USD" - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "GIFT-CARD-kW4aEsfB", - "gift": { - "amount": 32000, - "balance": 21500, - "effect": "APPLY_TO_ORDER" - }, - "metadata": {}, - "campaign": "Gift Card Campaign", - "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" - } - }, - "Cannot be redeemed by referrer": { - "value": { - "valid": false, - "reason": "voucher cannot be redeemed by referrer", - "error": { - "code": 400, - "key": "referrer_not_permitted_to_redeem", - "message": "voucher cannot be redeemed by referrer", - "details": "REFERRAL-CODE-OxBakPYf", - "request_id": "v-0be43a8a110abb1bd3" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "REFERRAL-CODE-OxBakPYf", - "metadata": {} - } - }, - "Referral Code": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", - "order": { - "amount": 20000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 14000, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "metadata": { - "currency": "USD" - }, - "referrer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" - }, - "customer_id": null, - "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "order" - }, - "code": "REFERRAL-CODE-OxBakPYf", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 30 - }, - "metadata": {}, - "campaign": "Referral Campaign", - "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" + "key": { + "type": "string", + "default": "missing_order", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Missing order", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "An order is required when redeeming a LOYALTY_CARD", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." + }, + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." + }, + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "Missing order = please add one.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" } } } } - } - }, - "400": { - "description": "Returns an error if request body is missing parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error" - }, - "examples": { - "Missing reward": { - "value": { - "code": 400, - "key": "missing_reward", - "message": "Missing reward", - "details": "A reward is required when redeeming a LOYALTY_CARD", - "request_id": "v-0bcb925c6d90f7f8fc", - "error": { - "message": "Missing reward = please add one." - } - } - }, - "Missing Parameter": { - "value": { - "code": 400, - "key": "missing_order_items_amount", - "message": "Missing applicable order items", - "details": "At least one applicable order item with amount is required to redeem this GIFT_VOUCHER", - "request_id": "v-0bcccfd04085cf2540", - "error": { - "message": "Request should contain an amount for the item." - } - } - }, - "Metadata Validation Failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "location_id: must be an array, and every element: must be a string, must be equal to one of L1,L2,L3 (actual value is 'L1')", - "request_id": "v-0bcced27715305d3fa" + }, + "e_400_loyalty_card_points_exceeded": { + "title": "Loyalty Card Points Exceeded", + "type": "object", + "description": "Error: Bad Request → Loyalty Card Points Exceeded", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "loyalty_card_points_exceeded", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "loyalty card points exceeded", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "SoAm6kbC", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." + }, + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." + }, + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "There are not enough loyalty points on the card.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" } } } } - } - } - } - } - }, - "/client/v1/validate": { - "get": { - "operationId": "validate-voucher-client-side", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Voucher (client-side) [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.\n\n> ❗️ Specifying gift credits and loyalty points\n>\n> This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount. \n\n### Set customer identity (optional)\n\nVoucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.\n\nVoucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.\n\nThe returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `/validate` request, and the version encrypted and returned as part of the validation request.\n\n### Sample workflow\n\nCustomer tracking workflow in a nutshell:\n\n**Client-side:**\n * A customer visits your website.\n * A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.\n\n**Backend:**\n * Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.\n * A customer object is created and within the redemption response, you get a customer `id`.\n * You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.\n \nA customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](ref:get-customer). \n\n\n\n> 📘 Customer identifier\n>\n> The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=PAYINEUROS&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer=cust_4vMj8Twr5nBzvTrNCgipMb6M&[order][metadata][currency]=EUR&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=LOYALTY-CARD-ng3Kb9tM&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=GIFT-CARD-kW4aEsfB&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku&[item][4][sku_id]=sku_0b661e41fc0d35a8f1&[item][4][quantity]=4'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=REFERRAL-CODE-OxBakPYf&amount=10000'\n```\n\n### [JSFiddle Example](https://jsfiddle.net/voucherify/gfu2bgn5/)\n\n```javascript\n\n\n\n```\n\n### Examples with Query Parameters\n\n| **Query Parameters** | **Example URL** |\n|:---|:---|\n| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |\n| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |\n| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |\n\n### Reasons why a validation might fail\n\nVoucher validation might fail because of one of these reasons:\n\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of [start date - expiration date] timeframe\n* `voucher is disabled` - learn more about [disabled vouchers](ref:disable-voucher)\n* `customer does not match segment rules` - learn more customer tracking LINK\n* `order does not match validation rules` - learn more about validation rules LINK", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - }, - { - "schema": { - "type": "string", - "example": "7fjWdr" }, - "in": "query", - "name": "code", - "description": "A code that identifies the voucher." - }, - { - "schema": { - "type": "string" + "e_403_wrong_api_endpoint": { + "title": "Wrong API Endpoint", + "type": "object", + "description": "Error: Forbidden → Wrong API Endpoint", + "properties": { + "code": { + "type": "integer", + "default": 403, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "wrong_api_endpoint", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Wrong API endpoint", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Given project is bound to different API endpoint, you should use: https://api.voucherify.io", + "description": "A human-readable message providing more details about the error." + } + } }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that validated the voucher. This identifier is generated during voucher validation based on your internal ID (e.g., email, database ID) during the first request. This is a hashed customer source ID. If the request is performed for the first time, pass the internal ID to track the customer. **Although not all information is required, the extra information helps prevent fraud.**" - }, - { - "schema": { - "type": "string" + "e_404_not_found": { + "description": "Error: Not Found", + "type": "object", + "title": "Not Found", + "properties": { + "code": { + "type": "integer", + "default": 404, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "not_found", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Resource not found", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96cd820301c0483a", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Name or ID of the resource that was not found." + }, + "resource_type": { + "type": "string", + "description": "Specifies the type of resource that was not found." + } + } }, - "in": "query", - "name": "amount", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order. This amount is the sum of the order items' amounts." - }, - { - "schema": { - "type": "string", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + "e_409_duplicate_found": { + "title": "Duplicated Resource", + "type": "object", + "description": "Error: Conflict → Duplicated resource found", + "properties": { + "code": { + "type": "integer", + "default": 409, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_found", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicated resource found", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Name or ID of the resource that already exists." + }, + "resource_type": { + "type": "string", + "description": "Specifies the type of resource that already exists." + } + } }, - "in": "query", - "name": "session_key", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated." - }, - { - "schema": { - "type": "integer" + "e_400_duplicate_key": { + "title": "Duplicated Key", + "type": "object", + "description": "Error: Conflict → Duplicated key found", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_key", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicate codes", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } }, - "in": "query", - "name": "session_ttl", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session_ttl_unit` parameter." - }, - { - "schema": { - "type": "string", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] + "e_400_duplicate_source_id": { + "title": "Duplicate Source ID", + "type": "object", + "description": "Error: Conflict → Duplicate source_id found", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_source_id", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicate source_id", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } }, - "in": "query", - "name": "session_ttl_unit", - "description": "Defines the type of unit in which the session time is counted." - }, - { - "$ref": "#/components/parameters/metadata" - }, - { - "$ref": "#/components/parameters/item" - }, - { - "schema": { - "type": "string" + "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" }, - "in": "query", - "name": "session_type", - "description": "The session is required to establish a session between multiple parallel validation and redemption requests. This parameter is required to establish a new session. The session locks the **redemption quantity by 1** and additionally the redemption **gift credits** specified within the request for a gift card and the **loyalty points** for a loyalty card." - }, - { - "name": "customer", - "in": "query", - "required": false, - "schema": { - "anyOf": [ + "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": [ { - "type": "object", - "title": "Customer details", - "description": "Customer source ID and/or customer metadata.", - "properties": { - "source_id": { - "type": "string", - "description": "Customer source ID.", - "example": "name.lastname@email.com" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.", - "style": "deepObject", - "explode": true - } - }, - "style": "deepObject", - "explode": true + "$ref": "#/components/schemas/product_collections_collection_item_base" }, { - "type": "string", - "title": "Customer ID", - "description": "Unique customer ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + "anyOf": [ + { + "$ref": "#/components/schemas/product_collections_static_collection" + }, + { + "$ref": "#/components/schemas/product_collections_dynamic_collection" + } + ] } ] }, - "description": "Customer details." - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { + "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", - "title": "Order details", - "description": "Order details.", "properties": { - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.", - "style": "deepObject", - "explode": true + "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" + ] } }, - "style": "deepObject", - "explode": true + "required": [ + "id", + "name", + "created_at", + "object" + ] }, - "description": "Order details." - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on [validation sessions](doc:locking-validation-session).", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - } + "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" ] }, - "examples": { - "Wrong customer": { - "value": { - "valid": false, - "reason": "customer does not match validation rules", - "error": { - "message": "Only the gift card owner can apply credits from the gift card to the order." - }, - "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+o", - "code": "GIFT-CARD-kW4aEsfB", - "metadata": {} - } - }, - "Validation Rule Not Satisfied": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Discount Coupon cannot be redeemed because of violated validation rules: val_WuupvE7OVXyo", - "request_id": "v-0be54f4afa0357c12f" - }, - "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychk", - "code": "PAYINEUROS", - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." - } - } - }, - "Validate Discount Coupon": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 13000, - "discount_amount": 1000, - "total_discount_amount": 1000, - "total_amount": 12000, - "applied_discount_amount": 1000, - "total_applied_discount_amount": 1000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - } - ], - "metadata": { - "currency": "EUR" - }, - "customer_id": null, - "referrer_id": null, - "object": "order" + "name": { + "type": "string" + }, + "products": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" }, - "code": "PAYINEUROS", - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 1000 + "product_id": { + "type": "string" }, - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + "object": { + "enum": [ + "sku", + "product" + ] } - } - }, - "Validate Loyalty Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 121700, - "discount_amount": 5000, - "total_discount_amount": 5000, - "total_amount": 116700, - "applied_discount_amount": 5000, - "total_applied_discount_amount": 5000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bb4aa003890cb", - "quantity": 2, - "amount": 9000, - "price": 4500, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76bb4aa003890cb", - "source_id": "webinar_BF_pants_black_sweat_pants", - "name": "Black Sweat Pants", - "price": 4500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000ELDH", - "related_object": "sku", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "quantity": 3, - "amount": 89700, - "price": 29900, - "subtotal_amount": 89700, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - } - ], - "metadata": { - "currency": "EUR" - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "LOYALTY-CARD-ng3Kb9tM", - "loyalty": { - "points_cost": 1000 - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy" - }, - "metadata": {}, - "campaign": "Loyalty Campaign", - "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" - } - }, - "Validate Gift Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 165700, - "discount_amount": 21500, - "total_discount_amount": 21500, - "total_amount": 144200, - "applied_discount_amount": 21500, - "total_applied_discount_amount": 21500, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bb4aa003890cb", - "quantity": 2, - "amount": 9000, - "price": 4500, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76bb4aa003890cb", - "source_id": "webinar_BF_pants_black_sweat_pants", - "name": "Black Sweat Pants", - "price": 4500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000ELDH", - "related_object": "sku", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "quantity": 3, - "amount": 89700, - "price": 29900, - "subtotal_amount": 89700, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd347ec7d26", - "sku_id": "sku_0b661e41fc0d35a8f1", - "quantity": 4, - "amount": 44000, - "price": 11000, - "subtotal_amount": 44000, - "product": { - "id": "prod_0b661d4bd347ec7d26", - "source_id": "975193eb-1911-444a-a0f0-f567efce1a8b", - "name": "Pumps ”Flex” Michael Kors black" - }, - "sku": { - "id": "sku_0b661e41fc0d35a8f1", - "source_id": "M0E20000000DMVX", - "sku": "Pumps ”Flex” Michael Kors black", - "price": 11000 - } - } - ], - "metadata": { - "currency": "EUR" - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "GIFT-CARD-kW4aEsfB", - "gift": { - "amount": 32000, - "balance": 21500, - "effect": "APPLY_TO_ORDER" - }, - "metadata": {}, - "campaign": "Gift Card Campaign", - "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" - } - }, - "Validate Referral Code": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", - "order": { - "amount": 10000, - "discount_amount": 3000, - "total_discount_amount": 3000, - "total_amount": 7000, - "applied_discount_amount": 3000, - "total_applied_discount_amount": 3000, - "items": [], - "metadata": {}, - "referrer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" - }, - "customer_id": null, - "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "order" - }, - "code": "REFERRAL-CODE-OxBakPYf", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 30 - }, - "metadata": {}, - "campaign": "Referral Campaign", - "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" - } - } - } - } - } - }, - "400": { - "description": "Returns an error if missing required parameters or tracking IDs come from the same origin.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Missing customer": { - "value": { - "code": 400, - "key": "missing_customer", - "message": "Missing customer", - "details": "Customer is required to validate rules", - "request_id": "v-0be548ae620abb0a73" - } - }, - "Ambiguous tracking ID": { - "value": { - "code": 400, - "key": "ambiguous_tracking_id", - "message": "Ambiguous trackingId ('track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychkbEcMNB5RhcTj+zcKBEcGnUZkAXxg=' vs. 'track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==')", - "details": "The customer cannot be identified as two different identifiers have been used between requests from same origin.", - "request_id": "v-0be550a5a84abb30f8" - } + }, + "required": [ + "id", + "object" + ] } } - } - } - } - } - } - }, - "/v1/promotions/validation": { - "post": { - "operationId": "validate-promotions", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Promotions [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nUse this method to get valid promotions for a given customer and order.\n\n### Advanced validation filters\n\nYou can narrow down a validation to a specific promotion ID or tier metadata. Here are the examples of filtering queries you can use:\n\n| **Filter** | **Example** |\n|:---|:---|\n| promotion_id | [filters][promotion_id][conditions][$is]={{campaign_id}} |\n| tier metadata | [filters][metadata.{{promotion tier metadata key}}][conditions][$is]={{promotion tier metadata value}} |\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }'/\n 'https://api.voucherify.io/v1/promotions/validation?audienceRulesOnly=true'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n },\n \"metadata\": {\n \"store_names\": \"Store 1 - New York - Broadway\"\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][promotion_id][conditions][$is]=camp_nYcAyjFXmEaBU0nB7EQ4hVTr'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][metadata.has_budget][conditions][$is]=true'\n```", - "parameters": [ - { - "schema": { - "type": "string" + }, + "required": [ + "type", + "name" + ] }, - "in": "query", - "name": "audienceRulesOnly", - "description": "If you add a query param AudienceRulesOnly=true, the request will be validated against customer-related rules only, the rest of attached limits and rules will be ignored." - }, - { - "name": "filters", - "in": "query", - "required": false, - "schema": { + "product_collections_create_dynamic_request_body": { + "title": "Create Product Collection - Auto Update", "type": "object", - "title": "Promotion filters", - "description": "Promotion filter conditions.", "properties": { - "metadata": { - "type": "object", - "description": "Allows you to create a filter based on the conditions set for promotion metadata values. The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that are attached to a promotion tier object. Stores additional information about the promotion tier in a structured format.", - "style": "deepObject", - "explode": true + "type": { + "enum": [ + "AUTO_UPDATE" + ] + }, + "name": { + "type": "string" }, - "promotion_id": { + "filter": { "type": "object", - "description": "Allows you to create a filter based on the unique promotion ID.", - "style": "deepObject", - "explode": true - } - }, - "style": "deepObject", - "explode": true - }, - "description": "Filter conditions." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the customer and order context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_promotion" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", - "metadata": { - "key": "value" - } + "additionalProperties": false, + "required": [ + "junction" + ], + "properties": { + "junction": { + "$ref": "#/components/schemas/Junction" }, - "options": { - "expand": [ - "category" - ] + "id": { + "$ref": "#/components/schemas/FieldConditions" }, - "order": { - "amount": 10000, - "items": [ - { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ] + "product_id": { + "$ref": "#/components/schemas/FieldConditions" }, - "metadata": { - "key": "value" - } - } - }, - "Customer Rules Only": { - "value": { - "customer": { - "id": "cust_gN9KgORZECfdhG9qT6n82Zr7" + "source_id": { + "$ref": "#/components/schemas/FieldConditions" }, - "order": { - "items": [ - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" - }, - { - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 - }, - { - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 - }, - { - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - } + "name": { + "$ref": "#/components/schemas/FieldConditions" }, - "options": { - "expand": [ - "category" - ] - } - } - }, - "Campaign Specific": { - "value": { - "customer": { - "source_id": "test-user@email.com" + "price": { + "$ref": "#/components/schemas/FieldConditions" }, - "order": { - "items": [ - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" - }, - { - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 - }, - { - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 - }, - { - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - } + "object": { + "$ref": "#/components/schemas/FieldConditions" }, - "options": { - "expand": [ - "category" - ] + "attributes": { + "$ref": "#/components/schemas/FieldConditions" }, "metadata": { - "store_names": "Store 1 - New York - Broadway" - } - } - }, - "Promotion Tier Metadata": { - "value": { - "customer": { - "name": "Joe McDonald", - "email": "joey@email.com", - "source_id": "123_source_id" + "$ref": "#/components/schemas/FieldConditions" }, - "order": { - "items": [ - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 - }, - { - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" - }, - { - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 - }, - { - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 - }, - { - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - } + "image_url": { + "$ref": "#/components/schemas/FieldConditions" }, - "options": { - "expand": [ - "category" - ] + "skus": { + "$ref": "#/components/schemas/FieldConditions" + }, + "created_at": { + "$ref": "#/components/schemas/FieldConditions" + }, + "updated_at": { + "$ref": "#/components/schemas/FieldConditions" } } } + }, + "required": [ + "type", + "name", + "filter" + ] + } + }, + "examples": { + "req_vouchers_metadata_1": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726" + ], + "metadata": { + "lang": "en", + "authorized_internally": true + } + } + }, + "req_vouchers_metadata_2": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726", + "PROMO-CODE888" + ], + "metadata": { + "lang": "en", + "authorized_internally": true + } + } + }, + "res_async_actions": { + "value": { + "async_action_id": "aa_0ab2df092385be5ca5" } } } }, - "responses": { - "200": { - "description": "Returns a list of valid promotions for a given context (customer and order). You can then choose which promotion to apply, i.e. the highest discount amount.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_res_validate_promotion" - }, - "examples": { - "Customer Rules Only": { - "value": { - "valid": true, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "promotions": [ - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 9351000, - "initial_amount": 72100, - "items_discount_amount": 9340400, - "total_discount_amount": 9340400, - "total_amount": 10600, - "items_applied_discount_amount": 9340400, - "total_applied_discount_amount": 9340400, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, + "paths": { + "/v1/voucher-object": { + "get": { + "operationId": "voucher-object", + "tags": [ + "VOUCHERS API" + ], + "summary": "Voucher Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Voucher Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + } + } + } + } + } + } + }, + "/v1/vouchers": { + "get": { + "operationId": "list-vouchers", + "tags": [ + "VOUCHERS API" + ], + "summary": "List Vouchers", + "description": "Returns a list of your vouchers. By default, the vouchers are returned sorted by creation date, with the most recent vouchers appearing first. A maximum of 10 vouchers are returned in the response.\n\nWhen you get a list of vouchers, you can optionally specify query parameters to customize the amount of vouchers returned per call using `limit`, which page of vouchers to return using `page`, sort the vouchers using the `order` query parameter and more.\n\nThis method will return an error when trying to return a limit of more than 100 vouchers.\n", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/category" + }, + { + "in": "query", + "name": "campaign_id", + "description": "Limit search results to vouchers within the specified campaign", + "schema": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3" + } + }, + { + "$ref": "#/components/parameters/customer" + }, + { + "$ref": "#/components/parameters/campaign" + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary that contains an array of vouchers. Each entry in the array is a separate voucher object. If no more vouchers are available (query parameter `page` incremented over and above the voucher count), the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_GET" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "vouchers", + "vouchers": [ { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 23, - "discount_quantity": 22, - "initial_quantity": 1, - "amount": 39100, - "discount_amount": 37400, - "initial_amount": 1700, - "applied_discount_amount": 37400, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 222, - "discount_quantity": 222, - "initial_quantity": 1, - "amount": 333000, - "discount_amount": 333000, - "initial_amount": 1500, - "applied_discount_amount": 333000, - "price": 1500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 111, - "discount_quantity": 111, - "initial_quantity": 1, - "amount": 6660000, - "discount_amount": 6660000, - "initial_amount": 60000, - "applied_discount_amount": 6660000, - "price": 60000, - "subtotal_amount": 0, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 11, - "discount_quantity": 11, - "initial_quantity": 0, - "amount": 2310000, - "discount_amount": 2310000, - "initial_amount": 0, - "applied_discount_amount": 2310000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ByIIAHC1Mz9ouJsitzAWsush", - "name": "Multiple", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 11, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" - } - }, - { - "effect": "ADD_NEW_ITEMS", - "unit_off": 22, - "unit_type": "sku_0b7d7dfb090be5c619", - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1" + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" }, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1" - } - }, - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 111, - "unit_type": "prod_0b7d7c4e814be5c502", - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12" - } - }, - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 222, - "unit_type": "prod_0b72b0bd64d198e3ae", - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage" - } - } - ] - }, - "campaign": { - "id": "camp_JtoaZ8Qgpf6FkMAy2wWiOJWH", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "discount_amount": 9340400, - "applied_discount_amount": 9340400, - "metadata": {}, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 9522100, - "initial_amount": 72100, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 72100, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } + "object": "voucher" }, { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 + "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "code": "AmountDiscount", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 400, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-01T00:00:00.000Z", + "expiration_date": "2022-10-31T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" + } }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "name": "Add new SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 45, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" - }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 4, - "discount_amount": 9450000, - "applied_discount_amount": 9450000, - "metadata": {}, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 109500, - "initial_amount": 72100, - "items_discount_amount": 39100, - "total_discount_amount": 39100, - "total_amount": 70400, - "items_applied_discount_amount": 39100, - "total_applied_discount_amount": 39100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 23, - "discount_quantity": 23, - "initial_quantity": 1, - "amount": 39100, - "discount_amount": 39100, - "initial_amount": 1700, - "applied_discount_amount": 39100, - "price": 1700, - "subtotal_amount": 0, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 + "is_referral_code": false, + "created_at": "2022-09-12T07:51:02.145Z", + "updated_at": "2022-09-19T08:29:12.566Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/AmountDiscount/redemptions?page=1&limit=10" }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_NcdD0zLo6FUhKWpNrNuP3Pte", - "name": "Add missing SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 23, - "unit_type": "sku_0b7d7dfb090be5c619", - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1" - }, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 3, - "discount_amount": 39100, - "applied_discount_amount": 39100, - "metadata": {}, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 76100, - "initial_amount": 72100, - "items_discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 72100, - "items_applied_discount_amount": 4000, - "total_applied_discount_amount": 4000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AmountDiscount/publications?page=1&limit=10" }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b00ffed198e344", - "quantity": 8, - "discount_quantity": 8, - "initial_quantity": 0, - "amount": 4000, - "discount_amount": 4000, - "initial_amount": 0, - "applied_discount_amount": 4000, - "price": 500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b00ffed198e344", - "source_id": "roses_1", - "name": "Bouquet - Romantic Roses", - "price": 500 - } + "object": "voucher" } ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_nGr1SWuy9vduABkbbJkl8cHb", - "name": "Add new order items", - "banner": "Add Romantic Roses", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 8, - "unit_type": "prod_0b72b00ffed198e344", - "product": { - "id": "prod_0b72b00ffed198e344", - "source_id": "roses_1", - "name": "Bouquet - Romantic Roses" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 2, - "discount_amount": 4000, - "applied_discount_amount": 4000, - "metadata": {}, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 78100, - "initial_amount": 72100, - "items_discount_amount": 7500, - "total_discount_amount": 7500, - "total_amount": 70600, - "items_applied_discount_amount": 7500, - "total_applied_discount_amount": 7500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 5, - "discount_quantity": 5, - "initial_quantity": 1, - "amount": 7500, - "discount_amount": 7500, - "initial_amount": 1500, - "applied_discount_amount": 7500, - "price": 1500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, + "total": 2 + } + } + } + } + } + } + } + } + }, + "/v1/vouchers/{code}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "7fjWdr" + }, + "in": "path", + "name": "code", + "description": "A unique **code** that identifies the voucher.", + "required": true + } + ], + "get": { + "operationId": "get-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Get Voucher", + "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } ], - "metadata": { - "payment_mean": [ - "credit-card" - ] + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae", - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", "start_date": null, "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "discount_amount": 7500, - "applied_discount_amount": 7500, - "metadata": {}, - "object": "promotion_tier" + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + } }, - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "total_amount": 72100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } + "Gift Card": { + "value": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": null, + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 55000, + "balance": 44700, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2022-08-29T09:37:20.185Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount": { + "value": { + "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "code": "AMOUNTDISCOUNTUSINGFORMULA", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 400, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-01T00:00:00.000Z", + "expiration_date": "2022-10-31T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 + "barcode": { + "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-12T07:51:02.145Z", + "updated_at": "2022-09-19T08:29:12.566Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_tO5AuzXIkkNPTC50", + "rule_id": "val_5h0wc453_2", + "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "related_object_type": "voucher", + "created_at": "2022-09-19T08:27:59.160Z", + "object": "validation_rules_assignment" } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Percent Discount": { + "value": { + "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "code": "PercentDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 3, + "percent_off_formula": "CUSTOMER_METADATA(\"age\")", + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 + "barcode": { + "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T10:20:46.467Z", + "updated_at": "2022-09-15T10:43:51.116Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_EuYasM5fyDR9G2r4", + "rule_id": "val_0k19OQHjNZRT", + "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "related_object_type": "voucher", + "created_at": "2022-09-15T10:20:46.460Z", + "object": "validation_rules_assignment" } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 3, + "object": "list", + "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Fixed Discount": { + "value": { + "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", + "code": "FixedDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ORDER", + "fixed_amount": 200, + "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } + "barcode": { + "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T12:46:55.818Z", + "updated_at": "2022-09-16T10:03:25.057Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 5, + "object": "list", + "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount": { + "value": { + "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", + "code": "UnitDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", + "unit_type": "sku_0b661e41eccd35a8e9", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 + "barcode": { + "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T13:36:27.838Z", + "updated_at": "2022-09-16T10:03:25.057Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 5, + "object": "list", + "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Multiple Unit Discount": { + "value": { + "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", + "code": "UnitDiscountUsingFormulaForMultipleProductVariants", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 3, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "unit_type": "sku_0b661e41fc8d35a8f7", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 4, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", + "unit_type": "sku_0b661e41fc8d35a8f6", + "effect": "ADD_NEW_ITEMS" } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } + "barcode": { + "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", - "name": "Get", - "banner": "Free shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "campaign": { - "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "is_referral_code": false, + "created_at": "2022-09-16T05:44:50.722Z", + "updated_at": "2022-09-19T09:25:17.303Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 3, + "object": "list", + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Free Shipping": { + "value": { + "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", + "code": "FreeShipping", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, "start_date": null, "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, "active": true, - "object": "campaign" + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" + }, + "barcode": { + "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-16T07:19:53.945Z", + "updated_at": "2022-09-16T07:26:35.361Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" + }, + "object": "voucher" + } + } + } + } + } + }, + "404": { + "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", + "request_id": "v-0bb3403b9a158c87b2", + "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", + "resource_type": "voucher" + } + } + } + } + } + } + } + }, + "put": { + "operationId": "update-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Voucher", + "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_PUT" + }, + "examples": { + "Percent Discount": { + "value": { + "category": "Second", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "amount_limit": 1800, + "effect": "APPLY_TO_ORDER" }, - "hierarchy": 1, + "start_date": "2020-02-01T00:00:00Z", + "expiration_date": "2023-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT2H", + "interval": "P3D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": false, + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", "metadata": { - "has_budget": true, - "audience_restricted": false + "Season": "Winter" + } + } + }, + "Gift Card": { + "value": { + "category": "Existing Customers", + "gift": { + "amount": 20000, + "effect": "APPLY_TO_ITEMS" }, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, + "start_date": "2021-01-01T00:00:00Z", + "active": false, + "additional_info": "This gift card is disabled.", + "metadata": { + "test": false, + "locale": "de-en-pl" + } + } + }, + "Loyalty Card": { + "value": { + "category": "Existing Customers", + "loyalty_card": { + "points": 20000 + }, + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", + "metadata": { + "test": false, + "locale": "de-en-pl" + } + } + }, + "Amount Discount": { + "value": { + "category": "Existing Customers", + "discount": { + "amount_off": 2000, + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z" + } + }, + "Fixed Discount": { + "value": { + "category": "Existing Customers", + "discount": { + "type": "FIXED", + "fixed_amount": 2000, + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z" + } + }, + "Unit Discount": { + "value": { + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ { - "object": "sku", - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "product_source_id": "Books", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" }, { - "object": "product", - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the voucher object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Percent Discount": { + "value": { + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", + "campaign": null, + "campaign_id": null, + "category": "Second", + "category_id": "cat_0bb81a481615a37b5e", + "categories": [ { - "object": "product", - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" + "id": "cat_0bb81a481615a37b5e", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-09-20T05:58:01.561Z", + "object": "category" } ], - "total": 6, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "items_discount_amount": 67300, - "total_discount_amount": 67300, - "total_amount": 4800, - "items_applied_discount_amount": 67300, - "total_applied_discount_amount": 67300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 1800, + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-02-01T00:00:00.000Z", + "expiration_date": "2023-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "PT2H" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": false, + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", + "metadata": { + "Season": "Winter" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "discount_amount": 2300, - "applied_discount_amount": 2300, - "price": 3100, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } + "barcode": { + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:41:30.976Z", + "updated_at": "2022-09-20T06:00:50.202Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 101, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Card": { + "value": { + "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", + "code": "welcomegiftcard", + "campaign": null, + "campaign_id": null, + "category": "Existing Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 20000, + "balance": 20000, + "effect": "APPLY_TO_ITEMS" + }, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This gift card is disabled.", + "metadata": { + "test": false, + "locale": "de-en-pl" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } + "barcode": { + "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:09:49.665Z", + "updated_at": "2022-02-17T11:11:48.071Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Loyalty Card": { + "value": { + "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", + "code": "welcomeloyalty", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "Existing Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 20000, + "balance": 20000 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", + "metadata": { + "test": false, + "locale": "de-en-pl" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "discount_amount": 900, - "applied_discount_amount": 900, - "price": 1700, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } + "barcode": { + "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:12:01.428Z", + "updated_at": "2022-02-17T11:20:12.447Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount": { + "value": { + "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "code": "WelcomeDiscountAmount", + "campaign": null, + "campaign_id": null, + "category": "Existing Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 1500, - "subtotal_amount": 800, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 + "barcode": { + "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T11:41:05.236Z", + "updated_at": "2022-02-17T11:45:29.269Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_tDN7MJNayjrf1wyn", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "related_object_type": "voucher", + "created_at": "2022-02-17T11:41:05.210Z", + "object": "validation_rules_assignment" } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Fixed Discount": { + "value": { + "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", + "code": "wou4w1Og", + "campaign": "Fixed", + "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", + "category": "Existing Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS", + "fixed_amount": 2000 + }, + "gift": null, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "discount_amount": 59200, - "applied_discount_amount": 59200, - "price": 60000, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } + "barcode": { + "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-02-17T11:54:37.766Z", + "updated_at": "2022-02-17T12:04:53.346Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount": { + "value": { + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", "metadata": { - "payment_mean": [ - "credit-card" - ] + "test": true, + "locale": "de-en" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", - "name": "Get Amount Off", - "banner": "Every product is worth 8", + "assets": { + "qr": { + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": "2022-02-18T06:31:08.630Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 5, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + }, + "object": "voucher" + } + } + } + } + } + }, + "400": { + "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Voucher": { + "value": { + "code": 400, + "key": "invalid_voucher", + "message": "Invalid Voucher", + "details": "It is not possible to change Voucher discount type", + "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Delete Voucher", + "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the voucher with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Voucher Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id 10OFF", + "request_id": "v-0ae28d3cec96bb1b7e", + "resource_id": "10OFF", + "resource_type": "voucher" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "create-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Create Voucher", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the voucher that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_POST" + }, + "examples": { + "Percentage Discount": { + "value": { + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" + "percent_off": 10, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" }, - "campaign": { - "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" + "start_date": "2022-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 10 }, - "hierarchy": 2, - "discount_amount": 67300, - "applied_discount_amount": 67300, "metadata": { - "has_budget": true, - "audience_restricted": false + "test": true, + "locale": "de-en" }, - "object": "promotion_tier" + "validation_rules": [ + "val_4j7DCRm2IS59" + ] } - ] - } - }, - "Campaign specific": { - "value": { - "valid": true, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "promotions": [ - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + }, + "Gift Card": { + "value": { + "category": "New Customers", + "type": "GIFT_VOUCHER", + "gift": { + "amount": 10000, + "effect": "APPLY_TO_ORDER" }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 72000, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" + "start_date": "2022-01-01T00:00:00Z", + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + } + } + }, + "Loyalty Card": { + "value": { + "category": "New Customers", + "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 10000 }, - "id": "promo_g83qUzYZpfX0OMAFOVoQuOYG", - "name": "1", + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + } + } + }, + "Amount Discount with Formula": { + "value": { + "category": "First", + "type": "DISCOUNT_VOUCHER", "discount": { "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 100 + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, - "campaign": { - "id": "camp_nYcAyjFXmEaBU0nB7EQ4hVTr", - "start_date": null, - "expiration_date": null, - "active": true, - "categories": [ - { - "id": "cat_0b5f66bc97ce5be3c6", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T08:27:14.926Z", - "object": "category" - } - ], - "object": "campaign" + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" }, - "hierarchy": 1, - "discount_amount": 100, - "applied_discount_amount": 100, - "metadata": {}, - "object": "promotion_tier" + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "redemption": { + "quantity": 100 + }, + "metadata": { + "Season": "Spring" + } } - ] - } - }, - "Promotion Tier Metadata": { - "value": { - "valid": true, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "promotions": [ - { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + }, + "Percent Discount with Formula": { + "value": { + "category": "First", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "amount_limit": 1700, + "effect": "APPLY_TO_ORDER" }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" }, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "order": { - "amount": 72100, - "total_amount": 72100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } + "validity_day_of_week": [ + 0, + 1 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "redemption": { + "quantity": 101 + }, + "metadata": { + "Season": "Fall" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Percentage Discount": { + "value": { + "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "code": "welcome", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 + "barcode": { + "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:05:34.668Z", + "updated_at": null, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_74F7QZoYbUoljwQO", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "related_object_type": "voucher", + "created_at": "2022-02-17T09:05:34.642Z", + "object": "validation_rules_assignment" } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcome/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Card": { + "value": { + "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", + "code": "welcomegiftcard", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 10000, + "balance": 10000, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } + "barcode": { + "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", - "name": "Get", - "banner": "Free shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "campaign": { - "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "is_referral_code": false, + "created_at": "2022-02-17T09:09:49.665Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Loyalty Card": { + "value": { + "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", + "code": "welcomeloyalty", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "New Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 10000, + "balance": 10000 + }, "start_date": null, "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" - }, - { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "sku", - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "product_source_id": "Books", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" }, + "barcode": { + "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:12:01.428Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount with Formula": { + "value": { + "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", + "code": "amount1", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ { - "object": "product", - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } ], - "total": 6, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "order": { - "amount": 72100, - "items_discount_amount": 67300, - "total_discount_amount": 67300, - "total_amount": 4800, - "items_applied_discount_amount": 67300, - "total_applied_discount_amount": 67300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "discount_amount": 2300, - "applied_discount_amount": 2300, - "price": 3100, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "discount_amount": 900, - "applied_discount_amount": 900, - "price": 1700, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 1500, - "subtotal_amount": 800, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "metadata": { + "Season": "Spring" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" }, + "barcode": { + "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:22:50.552Z", + "updated_at": null, + "redemption": { + "quantity": 100, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/amount1/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Percent Discount with Formula": { + "value": { + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "discount_amount": 59200, - "applied_discount_amount": 59200, - "price": 60000, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } ], - "metadata": { - "payment_mean": [ - "credit-card" - ] + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 1700, + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", - "name": "Get Amount Off", - "banner": "Every product is worth 8", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" - }, - "campaign": { - "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", - "start_date": null, - "expiration_date": null, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 0, + 1 + ], "active": true, - "object": "campaign" - }, - "hierarchy": 2, - "discount_amount": 67300, - "applied_discount_amount": 67300, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" + "additional_info": "This voucher can be used with other coupons.", + "metadata": { + "Season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:41:30.976Z", + "updated_at": null, + "redemption": { + "quantity": 101, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + }, + "object": "voucher" + } } - ] - } - } - } - } - } - } - } - } - }, - "/v1/promotions/tiers/{tierId}/validation": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "post": { - "operationId": "validate-promotion-tier", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Promotion Tier [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify whether the promotion tier discount can be applied to an order. This method is designed for server side integration which means that it is accessible only through private keys.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the customer and order context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_promotion_tier" - }, - "examples": { - "Using IDs": { - "value": { - "customer": { - "source_id": "test-user@email.io" - }, - "order": { - "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS" + } } } }, - "Using Redemption Metadata": { - "value": { - "customer": { - "source_id": "test-user@email.com" - }, - "order": { - "amount": 200000, - "items": [ - { - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2 - }, - { - "sku_id": "sku_0KtP4rvwEECQ2U", - "related_object": "sku", - "quantity": 1 + "409": { + "description": "Returns an error if a voucher code already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Duplicate Code": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated voucher exists with id CODE", + "request_id": "v-0ae786a8f786b73dfa", + "resource_id": "CODE", + "resource_type": "voucher" + } } - ] - }, - "metadata": { - "store_names": "Store 1 - New York - Broadway" + } } } } } } - } - }, - "responses": { - "200": { - "description": "Returns validation result in `valid` key of the promotion tier object. Returns `true` if the promotion tier rules and validation rules are satisfied given the request body parameters. Returns `false` if the data provided in the payload does not meet validation rules or promotion tier requirements.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_res_validate_promotion_tier" - }, - "examples": { - "Promotion Valid": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1qnieLLNygh19A0Ia7FsJck", - "order": { - "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS", - "source_id": null, - "created_at": "2022-11-17T12:17:55.096Z", - "updated_at": null, - "status": "CREATED", - "amount": 9918200, - "initial_amount": 468200, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 468200, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500 - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000 - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000 + }, + "/v1/vouchers/": { + "post": { + "operationId": "generate-random-code", + "tags": [ + "VOUCHERS API" + ], + "summary": "Generate Random Code", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the voucher that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers__POST" + }, + "examples": { + "Percentage Discount": { + "value": { + "category": "New Customers", + "code": "NEW-WELCOME-COUPON", + "type": "DISCOUNT_VOUCHER", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "discount": { + "percent_off": 10, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000 + "start_date": "2016-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 10 }, - { - "object": "order_item", - "product_id": "prod_0bae32322150fd0546", - "quantity": 2, - "amount": 420000, - "price": 210000, - "subtotal_amount": 420000, - "product": { - "id": "prod_0bae32322150fd0546", - "name": "Samsung Phone", - "price": 210000 - } + "metadata": { + "test": true, + "locale": "de-en" }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "name": "Add new SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 45, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" - }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" + "validation_rules": [ + "val_4j7DCRm2IS59" + ] } }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 4, - "discount_amount": 9450000, - "applied_discount_amount": 9450000, - "metadata": {}, - "object": "promotion_tier" - } - }, - "Promotion Invalid with Error Message": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Promotion Tier cannot be redeemed because of violated validation rules: val_eqSA1dXOv491", - "request_id": "v-0c034585fd16cf6958" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae" - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true - }, - "object": "promotion_tier" - } - }, - "Promotion Invalid with Custom Message": { - "value": { - "valid": false, - "reason": "Inactive Promotion", - "error": { - "message": "Promotion is inactive this weekend." - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae" - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true - }, - "object": "promotion_tier" - } - } - } - } - } - } - } - } - }, - "/v1/redemption-object": { - "get": { - "operationId": "redemption-object", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redemption Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Redemption Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_obj_redemption_object" - } - } - } - } - } - } - }, - "/v1/rollback-redemption-object": { - "get": { - "operationId": "rollback-redemption-object", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Rollback Redemption Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Rollback Redemption Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended" - } - } - } - } - } - } - }, - "/v1/stackable-redemptions-object": { - "get": { - "operationId": "stackable-redemptions-object", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Stackable Redemptions Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Stackable Redemptions Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" - } - } - } - } - } - } - }, - "/v1/redemptions": { - "get": { - "operationId": "list-redemptions", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "List Redemptions", - "description": "Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. \n\n## Filtering results\nThe result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date:\n`https://api.voucherify.io/v1/redemptions?limit=3&[created_at][before]=2017-09-08T13:52:18.227Z`. A filter based on the object `created_at` field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: `[created_at][after]`, `[created_at][before]`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`.\n\n## Failed Redemptions\n\nA redemption may fail for various reasons. You can figure out an exact reason from the `failure_code`:\n- `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "result", - "description": "A filter on the list based on the redemption result. Available options are: `SUCCESS`, `FAILURE`. You can provide multiple values by repeating the param." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign", - "description": "A filter by the campaign **name** that the redemption resources originate from." - }, - { - "schema": { - "type": "string", - "example": "cust_IkrTR674vvQvr9a4rDMiqglY" - }, - "in": "query", - "name": "customer", - "description": "Return redemptions performed by the customer with given `id`." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "name": "filters", - "in": "query", - "schema": { - "type": "object", - "properties": { - "voucher_code": { - "type": "object", - "description": "Unique voucher code.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "related_object_id": { - "type": "object", - "description": "Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "related_object_parent_id": { - "type": "object", - "description": "Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "parent_redemption_id": { - "type": "object", - "description": "Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "failure_code": { - "type": "object", - "description": "Failure code, i.e. quantity_exceeded.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "result": { - "type": "object", - "description": "Result, i.e. `SUCCESS` or `FAILURE`.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "object": { - "type": "object", - "description": "Specify which type of object to return, i.e. `redemption` or `redemption_rollback`.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "customer_id": { - "type": "object", - "description": "Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "campaign_name": { - "type": "object", - "description": "Campaign name.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "user_login": { - "type": "object", - "description": "User login used to login to Voucherify, i.e. name.lastname@email.com", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - } - } - }, - "description": "Filters for listing responses.", - "style": "deepObject", - "explode": true - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of redemption objects. Each entry in the array is a separate redemption object. If no more redemptions are available, the resulting array will be empty. If you provide a non-existent customer ID, this call returns an empty object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_list_redemptions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "redemptions", - "redemptions": [ - { - "id": "r_0c0469eaf705889d99", - "object": "redemption", - "date": "2022-11-18T12:30:32.622Z", - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulhyMBo7VratI", - "metadata": { - "store_names": "Store 2 - Florida - Miami" - }, - "result": "SUCCESS", - "order": { - "id": "ord_ndw5rQJt12zvZ4upF72a3ljh", - "source_id": null, - "created_at": "2022-11-18T12:30:31.338Z", - "updated_at": null, - "status": "PAID", - "amount": 9680000, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 230000, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "object": "customer" - }, - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c0469eaf705889d99": { - "date": "2022-11-18T12:30:31.388Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "related_object_parent_id": "camp_40LC42P5NFbkkD4RWoJ4btks" - } - } + "Gift Card": { + "value": { + "category": "New Customers", + "type": "GIFT_VOUCHER", + "gift": { + "amount": 10000, + "effect": "APPLY_TO_ORDER" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "start_date": "2022-01-01T00:00:00Z", + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" }, - "customer": { - "id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5_a", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" + "code_config": { + "pattern": "GIFT-CARD-##########", + "prefix": "New-", + "postfix": "0", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + } + } + }, + "Loyalty Card": { + "value": { + "category": "New Customers", + "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 10000 }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "voucher": null, - "promotion_tier": { - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks" - } + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "code_config": { + "pattern": "LOYALTY-CARD-##", + "prefix": "New-", + "postfix": "1", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" } - }, - { - "id": "r_0bf9cf0a8b12dc5ba6", - "object": "redemption", - "date": "2022-11-10T06:49:03.835Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "amount": 200, - "result": "SUCCESS", - "order": { - "id": "ord_jAifScsbOqxgb12hLu7hXrLU", - "source_id": null, - "created_at": "2022-11-10T06:49:02.703Z", - "updated_at": null, - "status": "PAID", - "amount": 4500, - "discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 500, - "applied_discount_amount": 4000, - "total_applied_discount_amount": 4000, - "items": [ + } + }, + "Unit Discount Multiple Items": { + "value": { + "category": "New Customers", + "code": "MultipleUnitTypesUnitDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 3, - "amount": 4500, - "price": 1500, - "subtotal_amount": 4500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bf9cf0a8b12dc5ba6": { - "date": "2022-11-10T06:49:02.764Z", - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "related_object_parent_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" } - } + ] }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", - "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 - }, - "object": "customer" + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 5 }, - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "voucher": { - "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "code": "LT1-wMPnRhxb", - "campaign": "Loyalty Campaign - Tiers - 1", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + "metadata": { + "test": true, + "locale": "de-en" + } + } + }, + "Unit Discount Single Item": { + "value": { + "category": "New Customers", + "code": "AddMissingItemDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" }, - "reward": { - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", - "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 3 + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Percentage Discount": { + "value": { + "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "code": "NEW-WELCOME-COUPON", + "campaign": "Bug fix", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2016-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" }, - "object": "customer" + "barcode": { + "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" + } }, - "assignment_id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", - "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "object": "reward", - "name": "100 Points = $20", - "created_at": "2022-09-09T06:41:54.496Z", + "is_referral_code": false, + "created_at": "2022-02-17T07:14:40.096Z", "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_COu5PJAsWmAwuCqR", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "related_object_type": "voucher", + "created_at": "2022-02-17T07:14:40.280Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 }, - "type": "COIN" - }, - "loyalty_card": { - "points": 200 + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" + }, + "object": "voucher" } }, - { - "id": "rf_0bf9caf744d2dc593a", - "object": "redemption", - "date": "2022-11-10T06:31:15.477Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "FAILURE", - "failure_code": "loyalty_card_points_exceeded", - "failure_message": "loyalty card points exceeded", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", + "Gift Voucher": { + "value": { + "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", + "code": "New-GIFT-CARD-8tqB6FcyhE0", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 10000, + "balance": 10000, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 + "test": true, + "locale": "de-en" }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "voucher": { - "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "code": "LT1-wMPnRhxb", - "campaign": "Loyalty Campaign - Tiers - 1", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + "assets": { + "qr": { + "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T07:49:10.834Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" + }, + "object": "voucher" } }, - { - "id": "rf_0bf8c023eb4d4aa4ad", - "object": "redemption", - "date": "2022-11-09T11:05:28.074Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "FAILURE", - "failure_code": "customer_rules_violated", - "failure_message": "customer does not match validation rules", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "source_id": "bob.smith@email.com", + "Loyalty Card": { + "value": { + "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", + "code": "New-LOYALTY-CARD-UC1", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "New Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 10000, + "balance": 10000 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This loyalty card is enabled immediately upon creation.", "metadata": { - "acquisition_channel": "Facebook" + "test": true, + "locale": "de-en" }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "voucher": { - "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "code": "3rqWOTAh", - "campaign_id": null + "assets": { + "qr": { + "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" + }, + "barcode": { + "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T08:06:41.091Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" + }, + "object": "voucher" } }, - { - "id": "r_0ba9fa02fcd28ed8f1", - "object": "redemption", - "date": "2022-09-09T06:38:20.085Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", - "source_id": null, - "created_at": "2022-09-09T06:38:17.984Z", - "updated_at": null, - "status": "PAID", - "amount": 4600, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 4300, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 1600 + "Unit Discount Multiple Items": { + "value": { + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0a65b3ff8592d7a5b5", - "quantity": 1, - "amount": 3000, - "discount_amount": 300, - "applied_discount_amount": 300, - "price": 3000, - "subtotal_amount": 2700, - "product": { - "id": "prod_0a65b3ff8592d7a5b5", - "name": "Koffee Cup", - "price": 3000 + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" } - } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fa02fcd28ed8f1": { - "date": "2022-09-09T06:38:18.099Z", - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + "assets": { + "qr": { + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "source_id": "bob.smith@email.com", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "voucher": { - "id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "code": "vTcguVLE", - "campaign": "SL-Gift", - "campaign_id": "camp_hC2GdqYtOmTT45zfhib62cK1" - }, - "gift": { - "amount": 300 + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": null, + "redemption": { + "quantity": 5, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + }, + "object": "voucher" } }, - { - "id": "rf_0bf8bfe0808d4aa473", - "object": "redemption", - "date": "2022-11-09T11:04:19.062Z", - "customer_id": null, - "tracking_id": null, - "metadata": {}, - "result": "FAILURE", - "failure_code": "missing_customer", - "failure_message": "Missing customer", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": null, - "related_object_type": "voucher", - "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "voucher": { - "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "code": "3rqWOTAh", - "campaign_id": null + "Unit Discount Single Item": { + "value": { + "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", + "code": "AddMissingItemDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:46:44.536Z", + "updated_at": null, + "redemption": { + "quantity": 3, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" + }, + "object": "voucher" } } - ], - "total": 6 + } } } } } } - } - } - }, - "post": { - "operationId": "redeem-stacked-discounts", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Redeem Stackable Discounts", - "description": "Use this method to redeem up to 5 redeemables in a single API request.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions). \n\n\n> 📘 Also available on client-side\n>\n> This method is also accessible through public keys which you can use in client-side​ apps: mobile and web browser apps. Go to the dedicated [endpoint](ref:redeem-stacked-discounts-client-side) to learn more.\n> - Use `X-Client-Application-Id` as the application ID header.\n> - Use `X-Client-Token` as the appliction secret key header.\n> - Use client-side base URL.\n> - Use an `origin` header for your custom domain.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_redemptions" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" - } - ], - "session": { - "type": "LOCK", - "key": "session_key" - }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } + }, + "/v1/vouchers/{code}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "2CpRCE2c" + }, + "name": "code", + "in": "path", + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.", + "required": true + } + ], + "post": { + "operationId": "enable-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Enable Voucher", + "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThe method sets the voucher state to **active**. The voucher can be redeemed - only if the redemption occurs after the start date and the voucher is not expired.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2022-09-19T11:54:17.248Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "created_at": "2022-09-19T10:06:07.934Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" } } - ], - "metadata": { - "key": "value" } } } } } } - } - }, - "responses": { - "200": { - "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
`array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
`object` | Represents the final effect of all child redemptions executed during the request. |\n| order
`object` | Represents order details after all discounts are applied. |", - "content": { - "application/json": { + }, + "/v1/vouchers/{code}/disable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" + "type": "string", + "example": "2CpRCE2c" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "disable-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Disable Voucher", + "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThis method sets the voucher state to **inactive**. The voucher cannot be redeemed.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2022-09-19T11:53:23.452Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "created_at": "2022-09-19T10:06:07.934Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } + } + } } } } - } - } - } - }, - "/v1/redemptions/{redemptionId}": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "redemptionId", - "in": "path", - "required": true, - "description": "ID of previously created redemption." - } - ], - "get": { - "operationId": "get-redemption", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Get Redemption", - "description": "Return a redemption or redemption rollback object. This object can either be a successfull or failed redemption or redemption rollback.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { + "/v1/vouchers/{code}/balance": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/7_res_get_redemption" - }, - "examples": { - "Discount Voucher": { - "value": { - "id": "r_0bade27c428db5873e", - "object": "redemption", - "date": "2022-09-12T07:29:28.211Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_ebmAU9uv3dTE2Khqyh7i5ka7", - "source_id": null, - "created_at": "2022-09-12T07:29:26.245Z", - "updated_at": null, - "status": "PAID", - "amount": 22500, - "discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 22200, - "applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 1, - "amount": 22500, - "price": 22500, - "subtotal_amount": 22500, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "add-remove-gift-voucher-balance", + "tags": [ + "VOUCHERS API" + ], + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "Add or Remove Gift Card Balance", + "description": "Add balance to an existing gift card.", + "requestBody": { + "required": true, + "description": "Provide the amount to be added to/subtracted from the gift card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_balance" + }, + "examples": { + "Example": { + "value": { + "amount": 10000 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a balance object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_code_balance" + }, + "examples": { + "Example": { + "value": { + "amount": 10000, + "total": 20100, + "balance": 20100, + "type": "gift_voucher", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" } } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bade27c428db5873e": { - "date": "2022-09-12T07:29:26.282Z", - "related_object_type": "voucher", - "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h" - } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", - "voucher": { - "id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", - "code": "FB-metadata-string", - "campaign": null, - "campaign_id": null, - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" } } - }, - "Loyalty Card - Material Reward Product Type": { - "value": { - "id": "r_0c5bf0e6d601c7d7de", - "object": "redemption", - "date": "2023-01-25T12:08:09.503Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 4, - "result": "SUCCESS", - "order": { - "id": "ord_dSOsWkNCRT24lHPkMu8o5QbX", - "source_id": null, - "created_at": "2023-01-25T12:08:07.750Z", - "updated_at": null, - "status": "PAID", - "items": [], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf0e6d601c7d7de": { - "date": "2023-01-25T12:08:07.768Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" + } + } + } + } + } + } + }, + "/v1/vouchers/{code}/transactions": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "get": { + "operationId": "list-voucher-transactions", + "tags": [ + "VOUCHERS API" + ], + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "List Voucher Transactions", + "description": "List transactions that are associated with credit movements on a gift card or loyalty card.", + "responses": { + "200": { + "description": "Returns a dictionary of transaction objects", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/vouchers_list_transactions_response_body" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dccc4d5813e71bd", + "source_id": "20230317_subtract_1", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "API", + "reason": "Subtracting credits from card", + "type": "CREDITS_REMOVAL", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128020, + "amount": -2000, + "object": "balance", + "balance": 121020, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T15:50:00.786Z" + }, + { + "id": "vtx_0c9dcc920ac0e9ef82", + "source_id": "20230317_add_1", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "API", + "reason": "Adding more points to card", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130020, + "amount": 20, + "object": "balance", + "balance": 123020, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T15:49:08.768Z" + }, + { + "id": "vtx_0c94f018d30bef6689", + "source_id": "HRwc0oHz_reward", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "cash reward", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": 2000, + "object": "balance", + "balance": 123000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:38:02.055Z" + }, + { + "id": "vtx_0c94edbbaccbef5db6", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REFUND", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": 44, + "object": "balance", + "balance": 121000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + }, + "order": { + "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", + "source_id": null + }, + "redemption": { + "id": "r_0c94ed583fcafc31c1" + }, + "rollback": { + "id": "rr_0c94edbb8d0bef5d9e" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:27:42.389Z" + }, + { + "id": "vtx_0c94ed584f4afc31da", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REDEMPTION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": -44, + "object": "balance", + "balance": 120956, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + }, + "order": { + "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", + "source_id": null + }, + "redemption": { + "id": "r_0c94ed583fcafc31c1" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:26:00.640Z" + }, + { + "id": "vtx_0c94e9432c4afc2134", + "source_id": "HRwc0oHz_removal", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "removal", + "type": "CREDITS_REMOVAL", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": -2000, + "object": "balance", + "balance": 121000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:08:10.413Z" + }, + { + "id": "vtx_0c94e8100f8afc1c6c", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REDEMPTION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": -7000, + "object": "balance", + "balance": 123000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + }, + "order": { + "id": "ord_qZX3pEt5rFf5W23qRMDQcVt9", + "source_id": null + }, + "redemption": { + "id": "r_0c94e80fda4afc1c59" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:02:55.935Z" + }, + { + "id": "vtx_0c94e6b82a4bef406c", + "source_id": "walmart", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "return", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": 5000, + "object": "balance", + "balance": 130000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T17:57:03.758Z" + } ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "name": "[Sample] Tiered Wire Basket", - "price": 11995, - "attributes": [], - "metadata": { - "source": "bigcommerce", - "bigcommerce_product_categories": [ - 21, - 23 - ] - }, - "image_url": null, - "created_at": "2022-06-03T13:36:16.084Z", - "updated_at": "2022-06-07T09:10:44.644Z", - "object": "product" - }, - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", - "object": "reward", - "name": "Present", - "created_at": "2022-06-13T06:59:01.694Z", - "updated_at": null, - "parameters": { - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "sku_id": null - } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 4 + "has_more": false + } + } } } - }, - "Loyalty Card - Material Reward SKU Type": { - "value": { - "id": "r_0c5bf18dad48a34392", - "object": "redemption", - "date": "2023-01-25T12:11:00.543Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 6, - "result": "SUCCESS", - "order": { - "id": "ord_dwb6bpqjIlMuXFS71NuHed9S", - "source_id": null, - "created_at": "2023-01-25T12:10:58.598Z", - "updated_at": null, - "status": "PAID", - "items": [], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf18dad48a34392": { - "date": "2023-01-25T12:10:58.613Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", - "product": { - "id": "prod_5h0wc453_2", - "source_id": "jonah-nystrom-bourbon", - "name": "Johan & Nyström - Bourbon", - "price": null, - "attributes": [ - "categories", - "description", - "weight" - ], - "metadata": { - "company": "Johan & Nyström", - "showcase": true - }, - "image_url": null, - "created_at": "2021-12-01T08:00:49.418Z", - "updated_at": null, - "object": "product" - }, - "sku": { - "id": "sku_0a3efc9044dd121803", - "source_id": "jonah-nystrom-bourbon-250g", - "product_id": "prod_5h0wc453_2", - "sku": "250g", - "price": 1750, - "currency": null, - "attributes": { - "categories": "Coffee, Whole Bean", - "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", - "weight": 250 - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-01T08:00:49.427Z", - "updated_at": null, - "object": "sku" - }, - "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", - "object": "reward", - "name": "Present - SKU", - "created_at": "2023-01-25T12:10:16.060Z", - "updated_at": null, - "parameters": { - "product": { - "id": "prod_5h0wc453_2", - "sku_id": "sku_0a3efc9044dd121803" - } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 6 } } - }, - "Loyalty Card - Pay with Points": { - "value": { - "id": "r_0b5e402ad54a3afe9c", - "object": "redemption", - "date": "2022-07-12T11:00:26.247Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 5, - "redemption": "r_0b5e402ad50a3afe98", - "result": "SUCCESS", - "order": { - "id": "ord_9akjPYZNskEhKZ4zCZt6TKwq", - "source_id": null, - "created_at": "2022-07-12T11:00:26.224Z", - "amount": 20000, - "discount_amount": 5100, - "total_discount_amount": 5100, - "total_amount": 14900, - "applied_discount_amount": 500, - "total_applied_discount_amount": 500, - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "assignment_id": "rewa_X3jnD5XFxP6GXCzPZUNknDck", - "id": "rew_6rhNwuuWFQJLvTPO34ilg6jq", - "object": "reward", - "name": "Pay with Points", - "created_at": "2022-07-11T08:18:18.205Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 1, - "points_ratio": 1 + } + } + } + } + }, + "/v1/vouchers/{code}/transactions/export": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "export-gift-card-transactions", + "tags": [ + "VOUCHERS API" + ], + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "Export Gift Card Transactions", + "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
- `CREDITS_ADDITION`
- `CREDITS_REFUND`
- `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "requestBody": { + "description": "Specify the parameters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "source" + ] } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 5 + } } } - }, - "Loyalty Card - Digital Reward - Discount Voucher": { - "value": { - "id": "r_0c5bf3323008a35032", - "object": "redemption", - "date": "2023-01-25T12:18:10.707Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": { - "redemption_location": { - "city": "Warsaw", - "state": "Polyork" - } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_export_transactions_object" }, - "amount": 2, - "result": "SUCCESS", - "order": { - "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", - "source_id": null, - "created_at": "2023-01-25T12:18:09.203Z", - "updated_at": null, - "status": "PAID", - "amount": 2100, - "total_amount": 2100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 3, - "amount": 2100, - "price": 700, - "subtotal_amount": 2100, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } + "examples": { + "Example": { + "value": { + "id": "exp_ARi2UbRjgfrHQJoVcKFrBUgA", + "object": "export", + "created_at": "2023-05-16T08:30:21.496Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id", + "source" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf3323008a35032": { - "date": "2023-01-25T12:18:09.216Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", - "code": "HAPPY-ORDER5My", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "21ceb848-4869-4dac-ba41-f854bda3a101", - "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" - }, - "barcode": { - "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" - } - }, - "is_referral_code": false, - "created_at": "2023-01-25T12:18:09.256Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 2 } } - }, - "Loyalty Card - Digital Reward - Credits on Gift Card": { - "value": { - "id": "r_0c5c1435d053202118", - "object": "redemption", - "date": "2023-01-25T14:42:25.206Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 1, - "result": "SUCCESS", - "order": { - "id": "ord_v0r7JfUQgWRpw28UJm9Z5AaH", - "source_id": null, - "created_at": "2023-01-25T14:42:23.637Z", - "updated_at": null, - "status": "PAID", - "amount": 22500, - "total_amount": 22500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 1, - "amount": 22500, - "price": 22500, - "subtotal_amount": 22500, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5c1435d053202118": { - "date": "2023-01-25T14:42:23.681Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 55080, - "balance": 44780 + } + } + } + } + } + } + }, + "/v1/vouchers/import": { + "post": { + "operationId": "import-vouchers", + "tags": [ + "VOUCHERS API" + ], + "summary": "Import Vouchers", + "description": "Import standalone vouchers and gift cards into the repository.\n\n\n\n> 📘 Important notes\n>\n> - **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z.\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\nAny parameters not provided in the payload will be left blank or null.\n\nFor both **standalone discount vouchers and gift cards**, you can import the following fields: \n\n- code\n- category\n- active\n- type\n- start_date\n- expiration_date\n- redemption.quantity\n- additional_info\n- metadata\n\nFor **gift cards**, you can also import the following field:\n\n- gift.amount\n\nFor **discount vouchers**, you can import the `discount` object. The object will slightly vary depending on the type of discount. Each discount type **requires** the `type` to be defined in the import.\n\n| **Discount Type** | **Required fields** |\n|:---|:---|\n| Amount | amount_off, effect |\n| Percent | percent_off, effect |\n| Fixed | fixed_amount, effect |\n| Unit - One item | unit_off, unit_type, effect |\n| Unit - Multiple items | unit_off, unit_type, effect |\n| Shipping | unit_off, unit_type, effect |\n\nFields other than the ones listed above won't be imported. Even if provided, they will be silently skipped.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "The request body is an array of objects. Each object contains details about a specific voucher. ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_import" + }, + "examples": { + "Example": { + "value": [ + { + "code": "PROMO-CODE30OFF-NO-EFFECT", + "category": "new customer acquisition", + "type": "DISCOUNT_VOUCHER", + "active": true, + "discount": { + "amount_off": 3000, + "type": "AMOUNT" + }, + "start_date": "2020-12-01T23:00:00Z", + "expiration_date": "2023-12-19T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code1" }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } + { + "code": "PROMO-CODE30-PERCENT-NO-EFFECT", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2023-01-11T15:23:02.789Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + { + "code": "GIFT-CARD-100", + "type": "GIFT_VOUCHER", + "active": true, + "category": "new customer acquisition", + "gift": { + "amount": 10000 + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 5 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-GIFT-code2" }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + { + "code": "PROMO-CODE1-PERCENT-EFFECT-ORDER", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "object": "voucher" - }, - "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", - "object": "reward", - "name": "Present Credits on Gift Card", - "created_at": "2023-01-25T14:41:31.858Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "balance": 4000, - "type": "GIFT_VOUCHERS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 - } - } - }, - "Loyalty Card - Digital Reward - Points on Loyalty Card": { - "value": { - "id": "r_0c5c226f498f1a93f0", - "object": "redemption", - "date": "2023-01-25T15:44:34.317Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 1, - "result": "SUCCESS", - "order": { - "id": "ord_1fv4ITwpUQra6iDTHFPVfnRR", - "source_id": null, - "created_at": "2023-01-25T15:44:32.494Z", - "updated_at": null, - "status": "PAID", - "amount": 700, - "total_amount": 700, - "items": [ { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "price": 700, - "subtotal_amount": 700, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5c226f498f1a93f0": { - "date": "2023-01-25T15:44:32.550Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" + "code": "PROMO-CODE2-PERCENT-EFFECT-ITEM", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT", + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "object": "customer" - }, - "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 1000, - "balance": 870 + { + "code": "PROMO-CODE1-PERCENT-NO-EFFECT-REDEEMED-QUANTITY-ATTRIBUTE-DOESNT-GET-PASSED", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1, + "redeemed_quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" - } + { + "code": "PROMO-CODE1-AMOUNT-EFFECT-ITEMS-PROPORTIONALLY", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "amount_off": 30, + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "is_referral_code": false, - "created_at": "2022-07-11T08:19:28.780Z", - "updated_at": "2022-10-01T00:02:05.604Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 26, - "redeemed_points": 130, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" + { + "code": "PROMO-CODE1-FIXED-EFFECT-ORDER", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "fixed_amount": 30, + "type": "FIXED", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + { + "code": "PROMO-CODE1-UNIT-SINGLE-ITEM-EFFECT-MISSING", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" }, - "object": "voucher" - }, - "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", - "object": "reward", - "name": "Present on Loyalty Card", - "created_at": "2023-01-25T15:43:40.716Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "balance": 20, - "type": "LOYALTY_PROGRAM" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 - } - } - }, - "Gift Card": { - "value": { - "id": "r_0b5e7d29ba4fb72ee4", - "object": "redemption", - "date": "2022-07-12T15:26:52.777Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 5000, - "redemption": "r_0b5e7d29ba0fb72ee2", - "result": "SUCCESS", - "order": { - "id": "ord_5iOTjTG4I3Yo2G2bH1qHk66a", - "source_id": null, - "created_at": "2022-07-12T15:26:52.773Z", - "amount": 30200, - "discount_amount": 9530, - "total_discount_amount": 9530, - "total_amount": 20670, - "applied_discount_amount": 5000, - "total_applied_discount_amount": 5000, - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "gift": { - "amount": 5000 - } - } - }, - "Promotion Tier": { - "value": { - "id": "r_0c5d6689b35320059a", - "object": "redemption", - "date": "2023-01-26T15:20:35.916Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_4kVJ1PiXP3TNfik3pM79KZsn", - "source_id": null, - "created_at": "2023-01-26T15:20:34.216Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } + "code": "PROMO-CODE2-UNIT-MULTIPLE-ITEMS", + "type": "DISCOUNT_VOUCHER", + "active": true, + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_NEW_ITEMS" + } + ] + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 }, "metadata": { - "series": "2022-783CV" - } + "unit": "EUR" + }, + "additional_info": "secret-code2" }, { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5d6689b35320059a": { - "date": "2023-01-26T15:20:34.253Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + "code": "PROMO-CODE1-SHIPPING", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" } - } - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "object": "customer" + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "action": null, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": null, - "expiration_date": null, - "object": "campaign" - }, - "campaign_id": null, - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0aac93c6af84485df3" } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + } } } - }, - "Stacked Redemption": { - "value": { - "id": "r_0b5e3e2b7f851d0192", - "object": "redemption", - "date": "2022-07-12T10:51:33.098Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_qjnno0eUQ1fs0RMjejfbZp7q", - "source_id": null, - "created_at": "2022-07-12T10:51:31.687Z", - "updated_at": null, - "status": "PAID", - "amount": 20000, - "discount_amount": 6100, - "total_discount_amount": 6100, - "total_amount": 13900, - "applied_discount_amount": 6100, - "total_applied_discount_amount": 6100, - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0b5e3e2b7f851d0192": { - "date": "2022-07-12T10:51:31.711Z", - "related_object_type": "redemption", - "related_object_id": "r_0b5e3e2b7f851d0192", - "stacked": [ - "r_0b5e3e2b7f851d0193", - "r_0b5e3e2b7fc51d0194", - "r_0b5e3e2b7fc51d0195", - "r_0b5e3e2b7fc51d0196", - "r_0b5e3e2b7fc51d0197" - ] + } + } + } + } + }, + "/v1/vouchers/importCSV": { + "post": { + "operationId": "import-vouchers-using-csv", + "tags": [ + "VOUCHERS API" + ], + "summary": "Import Vouchers using CSV", + "description": "Import standalone vouchers into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties listed in the file headers that cannot be mapped to standard voucher fields will be added to the metadata object. \n\nYou can find an example CSV file [here](https://support.voucherify.io/article/45-import-codes-and-share-them-digitally#coupons).\n___\n\n```cURL cURL example\ncurl -X POST \\\n https://api.voucherify.io/v1/vouchers/importCSV \\\n -F file=@/path/to/vouchers.csv \\\n -H \"X-App-Id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" \\\n -H \"X-App-Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n```\n\n\n\n> 📘 Standard voucher fields mapping\n>\n> - Go to the [import vouchers](ref:import-vouchers) endpoint to see all standard CSV fields description (body params section).\n> - Supported CSV file headers: Code,Voucher Type,Value,Discount Type,Category,Start Date,Expiration Date,Redemption Limit,Redeemed Quantity, Redeemed Amount,Active,Additional Info,Custom Metadata Property Name\n>- **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z. \n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\n\n\n> 📘 Categories\n>\n> In the structure representing your data, you can define a category that the voucher belongs to. You can later use the category of a voucher to group and search by specific criteria in the Dashboard and using the [List Vouchers](ref:list-vouchers) endpoint.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the **response** and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "redemption", - "related_object_id": "r_0b5e3e2b7f851d0192", - "voucher": null - } - }, - "Failed Voucher": { - "value": { - "id": "rf_0c5bd3c15701c78243", - "object": "redemption", - "date": "2023-01-25T10:00:47.812Z", - "customer_id": "cust_w1aRTTkpzeTGtOauISc8CKUN", - "tracking_id": "track_hr0jh/qNQqZWu7gkCEcVwEg27bNVrn2+", - "metadata": { - "location_id": [], - "redemption_location": { - "city": "Albany", - "state": "New York" - } - }, - "result": "FAILURE", - "failure_code": "voucher_disabled", - "failure_message": "voucher is disabled", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_w1aRTTkpzeTGtOauISc8CKUN", - "name": "Bobby's Friend", - "email": null, - "source_id": "create_order_referrer_1", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", - "voucher": { - "id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", - "code": "PROMO-CODE2", - "campaign": null, - "campaign_id": null, - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" } } - }, - "Failed Promotion Tier": { - "value": { - "id": "rf_0c5d6e47050156bfc2", - "object": "redemption", - "date": "2023-01-26T15:54:23.508Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "FAILURE", - "failure_code": "promotion_inactive", - "failure_message": "Inactive Promotion", - "order": null, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "action": null, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": null, - "expiration_date": null, - "object": "campaign" - }, - "campaign_id": null, - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 + } + }, + "400": { + "description": "Invalid payload. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example 1": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'file'", + "request_id": "74e4bb71-5b6d-49b9-98eb-239691c9d67a" } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + } } } - }, - "Failed Redemption": { - "value": { - "id": "rf_0c5bde8dfc0156f0e3", - "object": "redemption", - "date": "2023-01-25T10:47:58.578Z", - "customer_id": null, - "tracking_id": null, - "metadata": null, - "result": "FAILURE", - "failure_code": "not_found", - "failure_message": "Resource not found", - "order": null, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": null, - "related_object_type": "redemption", - "related_object_id": "rf_0c5bde8dfc0156f0e3", - "voucher": null - } } } } } - } - } - } - }, - "/v1/vouchers/{code}/redemption": { - "parameters": [ - { - "$ref": "#/components/parameters/code" - } - ], - "get": { - "operationId": "get-voucher-redemptions", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Get Voucher's Redemptions", - "description": "Retrieve the number of times a voucher was redeemed and each of the redemption details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "A dictionary with a `redemption_entries` property that contains an array of voucher's redemptions.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_get_vouchers_redemptions" - }, - "examples": { - "Example": { - "value": { - "quantity": null, - "redeemed_quantity": 6, - "object": "list", - "url": "/v1/vouchers/Test - FB - Vouchers - 9/redemptions?page=1&limit=10", - "data_ref": "redemption_entries", - "total": 6, - "redemption_entries": [ - { - "id": "r_0bc92f81a6801f9bca", - "object": "redemption", - "date": "2022-10-03T12:24:58.008Z", - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", - "metadata": {}, - "result": "SUCCESS", + }, + "/v1/vouchers/qualification": { + "post": { + "operationId": "examine-vouchers-qualification", + "deprecated": true, + "tags": [ + "VOUCHERS API" + ], + "summary": "Examine Qualification [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nDisplay vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 **standalone vouchers**. \n\n> 👍 Prevailing assumption\n> You data is synced with Voucherify.\n\n ## How does this endpoint work? \n\n A property's value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.\n\nAs a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.\n\n ## What's excluded? \n\n The verification logic won't run against _coupons from bulk unique code campaigns_. For campaigns with multiple unique codes, you should run a [dedicated function](ref:examine-campaigns-qualification) for searching and identifying qualified campaigns.\n\n ## Customizing the response\n\n> 📘 Query parameters let you sort and filter the returned vouchers\n>\n> Customize your response:\n> - If you only care about verifying a customer, use `audienceRulesOnly` set to `true`. \n>- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a `limit`. This will return vouchers sorted by `-created_at`, by default beginning with the most recent vouchers listed at the top.\n> - If you have a preference on the sorting order of the returned vouchers, you can use `order` to customize your response.\n\n ## Sending the request body payload\n\n\n ## Customer\n\nYou have the option of sending customer data via the dedicated `customer` object in the request body or a nested `customer` object within the `order` object.\n ### Available options:\n\n - You can either pass a customer `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal customer identifier e.g., email, database ID, CRM id), \n\n - a combination of the remaining parameters in the customer object, \n\n - a combination of customer `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that customer in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). \n\n## Order\n\n ### Available options:\n\n - You can either pass an order `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal order identifier), \n\n - a combination of the remaining parameters in the order object, \n\n - a combination of order `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that order in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).\n\n## Guidelines:\n\nTo validate against vouchers with total order `amount` requirements, make sure to include the total order `amount` in the order object or alternatively the `amount` for _every_ order item (the application will then add each amount to get the total and perform the qualification checks). If the total order `amount` is provided along with the individual items' amounts, the total order `amount` will take precedence.\n\n\n| **Case** | **Order-Level Parameter Included** | **Item-Level Parameter Included** | **Precedence** | **Calculation Result** | **Parameter included in payload accounts for checks against requirements in these validation rules** |\n|:---:|:---:|:---:|:---:|---|---|\n| **1** | `amount` | `amount` | Order-level | Uses order-level `amount` | - Total order amount |\n| **2** | | `amount` | Item-level | Sums each item-level `amount` | - Total order amount
- subtotal of matched items |\n| **3** | | `price`
`quantity` | Item-level | Multiplies each item's (`price` x `quantity`) to get item `amount` and then adds each item's `amount` to get total order `amount` | - Total order amount
- Subtotal of matched items
- Unit price of any matching order line
- Price of each item/Price of any item |\n| **4** | | `amount`
`price`
`quantity` | Item-level `amount` | Uses item-level `amount` for total order `amount` calculation, ignores (`price` x `quantity`) calculation | - Total order amount (uses item `amount` if provided or `price` x `quantity` for items without `amount` property; `amount` takes precedence in case all 3 properties are provided for an item)
- Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)
- Unit price of any matching order line
- Price of each item/Price of any item |\n| **5** | `amount` | `amount`
`price`
`quantity` | Order-level | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`).
- Subtotal of matched items (see case **4** for details).
- Unit price of any matching order line
- Price of each item/Price of any item |\n \n\n## Reward\n\n ## Gift Card", + "parameters": [ + { + "$ref": "#/components/parameters/audienceRulesOnly" + }, + { + "schema": { + "type": "integer", + "maximum": 50 + }, + "in": "query", + "name": "limit", + "description": "The number of vouchers to be qualified." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Should contain given customer and context such as an order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_qualification" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", + "metadata": { + "key": "value" + } + }, "order": { - "id": "ord_bhp1EH2SDz7UwkkurPFPLPhi", - "source_id": null, - "created_at": "2022-10-03T12:24:56.179Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 229900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ] + }, + "metadata": { + "key": "value" + } + } + }, + "Qualify product using product_id": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "object": "customer" - }, - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92f81a6801f9bca": { - "date": "2022-10-03T12:24:56.219Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, + "metadata": {} + } + }, + "Qualify product using source_id": { + "value": { "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "name": null, - "email": null, - "source_id": "johnnyy@email.com", + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, "metadata": {}, - "object": "customer" + "birthdate": "YYYY-MM-DD" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc92e6a68050e118c", - "object": "redemption", - "date": "2022-10-03T12:20:11.873Z", - "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmKhuFqhawWj", - "metadata": {}, - "result": "SUCCESS", "order": { - "id": "ord_rBsuJYqf4eFZgqj6IxeJgEcN", - "source_id": null, - "created_at": "2022-10-03T12:20:10.222Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 229900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "object": "customer" + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92e6a68050e118c": { - "date": "2022-10-03T12:20:10.272Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, + "metadata": {} + } + }, + "Qualify SKU using sku_id": { + "value": { "customer": { - "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_4", - "metadata": { - "lang": "en", - "test": true + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" }, - "object": "customer" + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc92db6e6001f9aa8", - "object": "redemption", - "date": "2022-10-03T12:17:07.780Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmYlx396Pk4X", - "metadata": {}, - "result": "SUCCESS", "order": { - "id": "ord_JvZbg1LFcXdQ67no5SENGldH", - "source_id": null, - "created_at": "2022-10-03T12:17:06.404Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 1200, - "total_discount_amount": 1200, - "total_amount": 228800, - "applied_discount_amount": 1200, - "total_applied_discount_amount": 1200, + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "object": "customer" + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92db6e6001f9aa8": { - "date": "2022-10-03T12:17:06.456Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, + "metadata": {} + } + }, + "Qualify SKU using source_id": { + "value": { "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" }, - "object": "customer" + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2dc6404426c0ab3", - "object": "redemption", - "date": "2022-09-28T14:30:56.199Z", - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", - "metadata": {}, - "result": "SUCCESS", "order": { - "id": "ord_6uuhGraDuXMOpVRTJT251kKW", - "source_id": null, - "created_at": "2022-09-28T14:30:54.681Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 800, - "total_discount_amount": 800, - "total_amount": 229200, - "applied_discount_amount": 800, - "total_applied_discount_amount": 800, + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "object": "customer" + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2dc6404426c0ab3": { - "date": "2022-09-28T14:30:54.737Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, + "metadata": {} + } + }, + "Qualify redemption metadata": { + "value": { "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "name": null, - "email": null, - "source_id": "jonny@email.com", + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, "metadata": {}, - "object": "customer" + "birthdate": "YYYY-MM-DD" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2d6f0ebc95f1783", - "object": "redemption", - "date": "2022-09-28T14:07:07.516Z", - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "tracking_id": "track_ThofCMTQe4EVIo0zvvOlTor1twaQNd7E", - "metadata": {}, - "result": "SUCCESS", "order": { - "id": "ord_ZQevc2J2sBegsnp5DwanXHsa", - "source_id": null, - "created_at": "2022-09-28T14:07:06.073Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 0, - "total_discount_amount": 0, - "total_amount": 230000, - "applied_discount_amount": 0, - "total_applied_discount_amount": 0, + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2d6f0ebc95f1783": { - "date": "2022-09-28T14:07:06.159Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, + "metadata": {} + } + }, + "Qualify order line item metadata": { + "value": { "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "name": "Bob Smith", - "email": "bob.smith.1@email.com", - "source_id": "bob.smith.1@email.com", - "metadata": { - "lang": "en", - "test": false + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" }, - "object": "customer" + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2d3c4f7495f159a", - "object": "redemption", - "date": "2022-09-28T13:53:16.057Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "SUCCESS", "order": { - "id": "ord_ff6rwr58kmdyuLsi5orplnVW", - "source_id": null, - "created_at": "2022-09-28T13:53:14.604Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 800, - "total_discount_amount": 800, - "total_amount": 229200, - "applied_discount_amount": 800, - "total_applied_discount_amount": 800, + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, "items": [ { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, + "price": 10000, + "metadata": {}, + "related_object": "product", "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } ], - "metadata": {}, "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2d3c4f7495f159a": { - "date": "2022-09-28T13:53:14.717Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } + "referrer": {}, + "metadata": "string" }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "John Smith", - "email": "john.smith@email.com", - "source_id": "john.smith@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } + "metadata": {} } - ] + } + } + } + } + }, + "responses": { + "200": { + "description": "This operation returns the list of valid and active vouchers based on the qualification of given context (e.g., customer profile, redemptions metadata, order).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_qualification" + } } } } } } - } - } - }, - "post": { - "operationId": "redeem-voucher", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Voucher [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher. \n\n## How discounts and order amounts are calculated in the API response?\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |\n| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |\n| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |\n| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n## SDKs \n\nYou can invoke the redemption endpoint with one of the official libraries: \n\n\n[block:html]\n{\n \"html\": \"

\\n\\n\"\n}\n[/block]\n\n## Customer tracking\n\nThe redeem operation is a key part of [Customer tracking] (doc:customer-tracking) workflow. There're 3 ways you can identify your end customer in Voucherify within this request. You can either provide a tracking ID (e.g. your customer's login or a generated id), a customer ID (if the customer is already stored in Voucherify) or a full `customer` object in the payload. Note that you can pass and thus store any customer-related metadata. See examples on the right.\n\n\n```json\n\"customer\": {\n \"source_id\": \"alice.morgan\",\n \"name\": \"Alice Morgan\",\n \"email\": \"alice@morgan.com\",\n \"description\": \"\",\n \"metadata\": {\n \"locale\": \"en-GB\",\n \"shoeSize\": 5,\n \"favourite_brands\": [\"Armani\", \"L’Autre Chose\", \"Vicini\"]\n }\n}\n```\n\nIf you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the redeem function or explicitly by invoking the [Create Customer](ref:create-customer) method, you can identify your customer in redemptions by a generated ID (starting with `cust_`). \n\n\n```json title=Example Customer Identifier [object]\n\"customer\": {\n \"id\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier\n{\n \"customer\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier by Source ID\n{\n \"customer\": \"alice.morgan\"\n}\n```\n\n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).\n\n## Redemption failures\n\nThere are several reasons why a redemption may fail. You will get the reason in the error key:\n - `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified\n\n## Order object\n\nThe purchase of previously defined products (products are stored in Voucherify) by end customers is handled through the order object. You are obligated to pass the order object in case you use validation rules. You can learn more about the [validation rules structure] (doc:validation-rules). \n\n| **Attributes** | **Description** |\n|:---|:---|\n| amount
`integer` | A positive integer representing the total amount for the order. |\n| items
`list` | List of items constituting the order. Order items can be defined either by `product_id` or `sku_id`. Along with every item you must define the `quantity`.

Child attributes:

- `product_id` (*string*) - The ID of the associated product object for this line item.

- `sku_id` (*string*) - The ID of the associated variant (sku) object for this line item.

- `quantity` (*integer*) - A positive integer representing the number of instances of the item that are included in this order line.

- `price` (*integer*) - A positive integer representing the cost of an item.

- `amount` (*integer*) - `quantity` * `price` (you should provide it to retrieve `discount_amount` for a particular order item if the discount is applied only to this item learn more |\n\n\n\n\n> 🚧 Order ID\n>\n> If you use the same order id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order. [Read more in this guide] (https://docs.voucherify.io/docs/manage-stackable-discounts).\n\n\n```json title=Example Order\n\"order\": {\n \"amount\": 10000,\n \"items\": [\n {\n \"product_id\": \"prod_Bi7sRr3kwvxH2I\",\n \"quantity\": 1\n }\n ]\n}\n```\n## Gift Vouchers - redeem Gift Card and control redeemed amount\n\nIn Voucherify,you can also create a gift card for customers. Customers then can use gift card credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.\n\nWhen the user wants to define how many gift credits are to be used from the gift card to complete the order, the `credits` property can be assigned the equivalent value in the lowest currency in the request body. The value of credits being applied to the order cannot be higher than the current balance on the gift card.\n\n\n```cURL title=Example Request - control redeemed amount\ncurl -i -X POST \\\n -H \"Content-Type:application/json\" \\\n -H \"X-App-Id:c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token:3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -d '{\n \"order\": {\n \"amount\": 2500\n },\n \"gift\": {\n \"credits\": 1500\n }\n }' \\ \n 'https://api.voucherify.io/v1/vouchers/aDm4CRR3/redemption'\n```\n## Loyalty Coins - redeem loyalty card and pay with points\n\nVoucherify offers the possibility to set up a reward type in the Loyalty Program, which allows using loyalty points as gift credits. The available balance of credits is counted based on policy rules attached to the reward definition.\n\nIf a user configures just one reward type of paying in points, in the redemption request, there is no additional information required. Voucherify will automatically select as a proper reward definition and will calculate the discount based on the attached policy. \n\n\n```json title=Example Request\n{\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_zv5Qn7cF68RbVX4foKxgwUi1\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:44:20Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 250,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_Tgi2ApelDyl86sm5AYDKCBMZ\",\n \"created_at\": \"2020-05-24T13:44:20Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": \"ltr_3q5dW6GaRC4QkA1oYmfGy1k1\",\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-23T08:18:55Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 489,\n \"balance\": 23\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 8,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 466\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:44:20Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nIn case the user wants to define how much he spends in points, it is configurable by property `points` in a request body.\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 10\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_NJIfNYD8uc2lNm3YBAqXr3FF\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T16:28:29Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_70kKdXIKCSx5cfglKSpz9aHy\",\n \"created_at\": \"2020-05-24T16:28:29Z\",\n \"discount_amount\": 250\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-24T13:44:26Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 539,\n \"balance\": 63\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 9,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 476\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T16:28:29Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nMoreover, it is possible to define many levels of reward in which collected points can be used as gift credits. Per each tier, we can implement different conversion factors. Having many options in the rewards catalog, we will need to select a coins calculation policy (reward ID) that we want to use for calculating a final discount in the redemption request.\n\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 30,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\"\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_se17sLon6YX5wMhYVzfQa2dc\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:41:16Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_EfMmve84JzQIg2MCM3cAvLgF\",\n \"created_at\": \"2020-05-24T13:41:16Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_g3QQwQfhJrjBYzEa1NJkub7N\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\",\n \"name\": \"1 point 25$\",\n \"created_at\": \"2020-05-24T12:57:19Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 25.0\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 439,\n \"balance\": 223\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 7,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 216\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:41:16Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returnee by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. **Although not all information is required, the extra info helps prevent fraud.**" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_voucher" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_redeem_voucher" - }, - "examples": { - "Gift Voucher": { - "value": { - "id": "r_0c5e8a38730ccec0d5", - "object": "redemption", - "date": "2023-01-27T12:34:57.100Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2000, - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 4000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ + }, + "/v1/vouchers/bulk/async": { + "post": { + "operationId": "update-vouchers-in-bulk", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Vouchers in bulk", + "description": "Use this endpoint to update specific metadata parameters for each code, respectively. You can update each code's metadata property separately. \n\n- Update up to **100 records** in one request.\n- Upserts are not supported. \n\n> 🚧 \n> \n> Currently only **metadata** updates are supported.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "List of objects, each containing a code that is being updated and the metadata key/value pairs for that code.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_bulk_async" + }, + "examples": { + "Example": { + "value": [ { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 + "code": "example_code", + "metadata": { + "lang": "en", + "test": false, + "MetadataTest": "Update metadata", + "update_value": 1, + "next_update_date": "2022-11-11T09:00:00.000Z" + } }, { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + "code": "example_code2", + "metadata": { + "lang": "pl", + "test": false, + "MetadataTest": "Update metadata", + "update_value": 2 + } } - } + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 0, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", - "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T12:34:57.102Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 18, - "redeemed_quantity": 1, - "redeemed_amount": 2000, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" } - }, - "gift": { - "amount": 2000 } } - }, - "Discount Coupon": { - "value": { - "id": "r_0c5e8ef10842da0aad", - "object": "redemption", - "date": "2023-01-27T12:55:34.689Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 5700, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "discount_amount": 148, - "applied_discount_amount": 148, - "price": 3000, - "subtotal_amount": 3152 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "discount_amount": 152, - "applied_discount_amount": 152, - "price": 3000, - "subtotal_amount": 3248 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + } + } + }, + "/v1/vouchers/metadata/async": { + "post": { + "operationId": "update-vouchers-metadata-in-bulk", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Vouchers' metadata in bulk", + "description": "Use this endpoint to update the same metadata parameters for a list of codes. \nUpdate up to **100 records** in one request. Upserts are not supported. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Request to update vouchers metadata in bulk. Provide an array of voucher codes in the `codes` parameter along with the `metadata` object. The `metadata` object should contain the key value pairs that you would like to update for all the vouchers included in the `codes` parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_metadata_async" + }, + "examples": { + "Example": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726" + ], + "metadata": { + "lang": "en", + "authorized_internally": true } } + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T12:55:34.690Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" } } } - }, - "Loyalty Card": { - "value": { - "id": "r_0c5e8f2cd78497a372", - "object": "redemption", - "date": "2023-01-27T12:56:35.934Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_MGTimoN4VtSj7iT75bP01FsH", - "source_id": null, - "created_at": "2023-01-27T12:56:35.923Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 0, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "items": [ + } + }, + "400": { + "description": "Returns an error indicating the reason for an unsuccessfull operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 + "$ref": "#/components/schemas/e_400_not_enough_codes" }, { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 + "$ref": "#/components/schemas/e_400_metadata_validation_failed" } ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8f2cd78497a372": { - "date": "2023-01-27T12:56:35.934Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } + "discriminator": { + "propertyName": "key" } }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 6500, - "balance": 5086 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + "examples": { + "Not enough codes": { + "value": { + "code": 400, + "key": "not_enough_codes", + "message": "Not enough codes", + "details": "Specify at least 1 code in codes.", + "request_id": "v-0c4b067a8f161e120f" } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-01-27T12:56:35.935Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1414, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 300 } } } @@ -63141,1855 +49056,2047 @@ } } }, - "400": { - "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", - "content": { - "application/json": { + "/v1/vouchers/{code}/sessions/{sessionKey}": { + "parameters": [ + { + "name": "code", + "in": "path", "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Voucher disabled": { - "value": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "AnsvocvP", - "request_id": "v-0c5d710a63c4110ae9", - "resource_id": "rf_0c5d710a87c8a31f86", - "resource_type": "redemption", - "error": { - "message": "The voucher has been disabled and cannot be used." - } - } - }, - "Invalid Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Customer must be a holder of a loyalty card.", - "details": "AnsvocvP", - "request_id": "v-0c5e628bd14411244b", - "resource_id": "rf_0c5e628bf841c7f248", - "resource_type": "redemption", - "error": { - "message": "The customer is invalid." - } - } - }, - "Voucher Inactive": { - "value": { - "code": 400, - "key": "voucher_not_active_now", - "message": "voucher not active now", - "details": "CODE14", - "request_id": "v-0c5e89b9300d820994", - "resource_id": "rf_0c5e89b945d33b9c02", - "resource_type": "redemption", - "error": { - "message": "The voucher is not active in the given timeframe." + "type": "string", + "example": "7fjWdr" + }, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify.", + "required": true + }, + { + "schema": { + "type": "string", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "name": "sessionKey", + "in": "path", + "required": true, + "description": "A unique session identifier." + } + ], + "delete": { + "operationId": "release-validation-session", + "tags": [ + "VOUCHERS API" + ], + "summary": "Release Validation Session", + "description": "Manually release a validation session that has been set up for the voucher. This method undos the actions that are explained in our guide on how a validation session was established, you can read more [here](doc:locking-validation-session). \n\n> 📘 Release Session using Dashboard\n>\n> You can also use the Validations Manager in the Dashboard to unlock sessions. [Read more](https://support.voucherify.io/article/16-dashboard-sections#validations).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if the validation session was released successfully." + } + } + } + }, + "/v1/campaign-object": { + "get": { + "operationId": "campaign-object", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Campaign Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Campaign Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" } } } } } } - } - } - } - }, - "/client/v1/redeem": { - "post": { - "operationId": "redeem-voucher-client-side", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Voucher (client-side) [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps). \n\nThe client-side redemption works similar to the server-side [voucher redemption](ref:redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.\n\n\n> 📘 Opt-in \n>\n> By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.\n\n\n> ❗️ Security Threat \n>\n> Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.\n\n### Expand Response\nYou may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.\n\n```json\n{\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n}\n```", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "code", - "description": "Voucher code being redeemed.", - "required": true }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud." - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_voucher" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_redeem_voucher" - }, - "examples": { - "Gift Voucher": { - "value": { - "id": "r_0c5e8a38730ccec0d5", - "object": "redemption", - "date": "2023-01-27T12:34:57.100Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2000, - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 4000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 + "/v1/campaigns": { + "post": { + "operationId": "create-campaign", + "tags": [ + "CAMPAIGNS API", + "PROMOTIONS API" + ], + "summary": "Create Campaign", + "description": "Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes. \n\n\n> 📘 Global uniqueness\n>\n> All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code. \n\n> 🚧 Code generation status\n>\n> This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](ref:get-campaign) description.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the campaign that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_create_campaign" + }, + "examples": { + "Discount Campaign": { + "value": { + "name": "Discount Campaign 4", + "campaign_type": "DISCOUNT_COUPONS", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 3, + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "percent_off": 10, + "type": "PERCENT" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "10OFF-#######" + } }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "AMER" } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + } + }, + "Gift Card Campaign": { + "value": { + "name": "Gift Card Campaign", + "campaign_type": "GIFT_VOUCHERS", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "voucher": { + "type": "GIFT_VOUCHER", + "gift": { + "amount": 1000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "GIFT-CARD-#######" + } + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" + } + } + }, + "Loyalty Program": { + "value": { + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "auto_join": true, + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "LOYALTY-CARD-#######" + } + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" + } + } + }, + "Promotion": { + "value": { + "name": "Promotion - API - 4", + "campaign_type": "PROMOTION", + "type": "STATIC", + "category_id": "cat_0bb343dee3cdb5ec0c", + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "active": false, + "promotion": { + "tiers": [ + { + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "B" + }, + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "validation_rules": [ + "val_q8qUBMOh5qIQ" + ] + }, + { + "name": "Order more than $100", + "banner": "Get $30 off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "A" + }, + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "validation_rules": [ + "val_q8qUBMOh5qIQ" + ] + } + ] + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "metadata": { + "region": "APAC" } } }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 0, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", - "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + "Referral Program": { + "value": { + "name": "Referral Campaign 2", + "campaign_type": "REFERRAL_PROGRAM", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "referral_program": { + "conversion_event_type": "redemption" + }, + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 45, + "effect": "APPLY_TO_ORDER", + "amount_limit": 15 + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "REFERRAL-CODE-#######" + }, + "is_referral_code": true + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T12:34:57.102Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 18, - "redeemed_quantity": 1, - "redeemed_amount": 2000, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" } - }, - "gift": { - "amount": 2000 } } - }, - "Discount Coupon": { - "value": { - "id": "r_0c5e8ef10842da0aad", - "object": "redemption", - "date": "2023-01-27T12:55:34.689Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 5700, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "discount_amount": 148, - "applied_discount_amount": 148, - "price": 3000, - "subtotal_amount": 3152 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "discount_amount": 152, - "applied_discount_amount": 152, - "price": 3000, - "subtotal_amount": 3248 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" - } - } + } + } + }, + "responses": { + "200": { + "description": "Returns a campaign object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + "examples": { + "Discount Campaign": { + "value": { + "id": "camp_NdBCAQk1AAZcMcv6kt6X164Q", + "name": "Discount Campaign 4", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10 + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "10OFF-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "AMER" + }, + "created_at": "2022-09-21T09:25:49.617Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" } }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T12:55:34.690Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "effect": "APPLY_TO_EVERY" + "Gift Card Campaign": { + "value": { + "id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "name": "Gift Card Campaign", + "campaign_type": "GIFT_VOUCHERS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "GIFT_VOUCHER", + "gift": { + "amount": 1000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "GIFT-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - } - } - }, - "Loyalty Card": { - "value": { - "id": "r_0c5e8f2cd78497a372", - "object": "redemption", - "date": "2023-01-27T12:56:35.934Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_MGTimoN4VtSj7iT75bP01FsH", - "source_id": null, - "created_at": "2023-01-27T12:56:35.923Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 0, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-21T09:31:16.266Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8f2cd78497a372": { - "date": "2023-01-27T12:56:35.934Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + "Loyalty Program": { + "value": { + "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "LOYALTY-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-21T09:39:45.479Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 6500, - "balance": 5086 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + "Promotion": { + "value": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "name": "Promotion - API - 4", + "campaign_type": "PROMOTION", + "type": "STATIC", + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-23T08:54:38.281Z", + "category": "First", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "promotion": { + "object": "list", + "data_ref": "tiers", + "tiers": [ + { + "id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", + "created_at": "2022-09-23T08:54:38.286Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "B" + }, + "hierarchy": 1, + "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "campaign": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": true, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" + }, + "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_dr3oXeN98YfiTF60", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", + "related_object_type": "promotion_tier", + "created_at": "2022-09-23T08:54:38.286Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + } + }, + { + "id": "promo_uMSxvzhxXDp3Ijs3659npqb2", + "created_at": "2022-09-23T08:54:38.314Z", + "name": "Order more than $100", + "banner": "Get $30 off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "A" + }, + "hierarchy": 2, + "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "campaign": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": true, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" + }, + "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_jgJlWms7GVK59iNR", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_uMSxvzhxXDp3Ijs3659npqb2", + "related_object_type": "promotion_tier", + "created_at": "2022-09-23T08:54:38.314Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + } + } + ], + "total": 2, + "has_more": false + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" } }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-01-27T12:56:35.935Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" + "Referral Program": { + "value": { + "id": "camp_N8rztKAqOYIdFxNLr9eNIjyB", + "name": "Referral Campaign 2", + "campaign_type": "REFERRAL_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 15, + "percent_off": 45, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "REFERRAL-CODE-#######" + }, + "is_referral_code": true, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "referral_program": { + "conversion_event_type": "redemption" + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1414, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-23T09:06:41.757Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 + "object": "campaign" } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 300 + } } } } - } - } - } - }, - "400": { - "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Voucher disabled": { - "value": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "AnsvocvP", - "request_id": "v-0c5d710a63c4110ae9", - "resource_id": "rf_0c5d710a87c8a31f86", - "resource_type": "redemption", - "error": { - "message": "The voucher has been disabled and cannot be used." + }, + "400": { + "description": "Returns an error if an incomplete request body is provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_campaign", + "message": "Invalid Campaign", + "details": "Property 'discount' is required for REFERRAL_PROGRAM campaign", + "request_id": "v-0bb99c9213425fa250" + } + } } } - }, - "Invalid Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Customer must be a holder of a loyalty card.", - "details": "AnsvocvP", - "request_id": "v-0c5e628bd14411244b", - "resource_id": "rf_0c5e628bf841c7f248", - "resource_type": "redemption", - "error": { - "message": "The customer is invalid." + } + }, + "404": { + "description": "When a payload value is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find category with id cat_0bb343dee3cdb5ec0c", + "request_id": "v-0c55671ed1cb0f1a27", + "resource_id": "cat_0bb343dee3cdb5ec0c", + "resource_type": "category" + } + } } } - }, - "Voucher Inactive": { - "value": { - "code": 400, - "key": "voucher_not_active_now", - "message": "voucher not active now", - "details": "CODE14", - "request_id": "v-0c5e89b9300d820994", - "resource_id": "rf_0c5e89b945d33b9c02", - "resource_type": "redemption", - "error": { - "message": "The voucher is not active in the given timeframe." + } + }, + "409": { + "description": "Returns an error if a campaign with the same name already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated campaign exists with name Discount Campaign", + "request_id": "v-0bb98f8c6552250aab", + "resource_id": "Discount Campaign", + "resource_type": "campaign" + } + } } } } } } - } - } - } - } - }, - "/v1/redemptions/{redemptionId}/rollback": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "redemptionId", - "in": "path", - "required": true, - "description": "The original redemption ID to be rolled back (undone)." - } - ], - "post": { - "operationId": "rollback-redemption", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Rollback Redemption", - "description": "Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. \n\n ## Effect \nThe operation \n- creates a rollback entry in voucher's redemption history (`redemption.redemption_entries`) and \n- gives 1 redemption back to the pool (decreases `redeemed_quantity` by 1). \n## Returned funds \nIn case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption.", - "parameters": [ - { - "schema": { - "type": "string" }, - "in": "query", - "name": "reason", - "description": "Reason for the rollback." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_rollback_redemption" - }, - "examples": { - "Promotion": { - "value": { - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemons", - "email": "annie@lemon.com", - "phone": "+1 933 222 3334", - "birthday": "1900-12-02", - "birthdate": "1900-12-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "country": "United States", - "postal_code": "100012" - }, - "metadata": { - "age": 23 + "get": { + "operationId": "list-campaigns", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "List Campaigns", + "description": "Retrieve a list of campaigns in a project. \n\nThe campaigns are returned sorted by creation date, with the most recent campaigns appearing first. \n\nWhen you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.\n\nThis method will return an error when trying to return a limit of more than 100 campaigns.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/campaign_type" + }, + { + "schema": { + "type": "string", + "default": "category" + }, + "in": "query", + "name": "expand", + "description": "Include an expanded `categories` object in the response." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `campaign` property that contains an array of campaigns. The maximum number of campaigns returned is determined by the `limit` query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_res_list_campaigns" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "campaigns", + "campaigns": [ + { + "id": "camp_SibPsDRKQvg3SUtptgPZCNZb", + "name": "Voucher Metadata", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 4400, + "percent_off": 30, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 9, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "#########", + "prefix": "Discount-", + "postfix": "YY" + }, + "is_referral_code": false, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P1D" + } + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 1, + "active": true, + "metadata": { + "region": "AMER" + }, + "created_at": "2022-09-20T09:32:29.530Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_HgsbCKauXmEoPnnh8aas0ISe", + "name": "Static Campaign", + "campaign_type": "DISCOUNT_COUPONS", + "type": "STATIC", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 1 + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-09-20T07:52:34.499Z", + "updated_at": "2022-09-20T11:38:13.501Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "name": "Loyalty Program Fall 2022", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 7, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LOYALTY-CARD-" + }, + "is_referral_code": false + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-09-19T07:56:22.103Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" + }, + { + "id": "camp_4tHsQEDUOER6PeW8SoMdnHH6", + "name": "Dynamic Discounts", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 5, + "percent_off_formula": "IF(ORDER_AMOUNT > 300;15;5)", + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "DYNAMIC-" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": { + "marketing_text": "Purchases above $300 are eligible for a 15% discount." + }, + "created_at": "2022-07-12T15:12:02.575Z", + "updated_at": "2022-07-20T10:48:05.617Z", + "category": "test", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b688929a2476386a8", + "object": "campaign" + }, + { + "id": "camp_JlsseNSDO7l4neFtev6p6945", + "name": "$20 OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "$20OFFORDER-" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:43:36.057Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_Uj3cNbWSgt7Zl4AyHM7Sa5Qk", + "name": "3% OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 3, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "3%OFFORDER-" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:41:12.087Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + } + ], + "total": 6 + } + } } - }, - "order": { - "source_id": "test_rollback_8" - }, - "metadata": { - "location_id": [ - "L2" - ] } } } } } - } - }, - "responses": { - "200": { - "description": "Returns a redemption rollback object indicating the result of the rollback.", - "content": { - "application/json": { + }, + "/v1/campaigns/{campaignId}": { + "parameters": [ + { + "in": "path", + "name": "campaignId", + "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.", "schema": { - "$ref": "#/components/schemas/7_res_rollback_redemption" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "rr_0c5eba630bc4979e70", - "object": "redemption_rollback", - "date": "2023-01-27T16:05:23.631Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": -2, - "redemption": "r_0c5bf3323008a35032", - "reason": "A UI rollback to check for result in API response to listing.", - "result": "SUCCESS", - "order": { - "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", - "source_id": null, - "created_at": "2023-01-25T12:18:09.203Z", - "updated_at": "2023-01-27T16:05:23.687Z", - "status": "CANCELED", - "amount": 2100, - "total_amount": 2100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 3, - "amount": 2100, - "price": 700, - "subtotal_amount": 2100, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf3323008a35032": { - "date": "2023-01-25T12:18:09.216Z", - "rollback_id": "rr_0c5eba630bc4979e70", - "rollback_date": "2023-01-27T16:05:23.631Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "required": true + } + ], + "get": { + "operationId": "get-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Get Campaign", + "description": "Retrieves the campaign with the given campaign ID or campaign name.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a campaign object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_JlsseNSDO7l4neFtev6p6945", + "name": "$20 OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "$20OFFORDER-" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:43:36.057Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": null, + "object": "campaign" } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", - "code": "HAPPY-ORDER5My", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "21ceb848-4869-4dac-ba41-f854bda3a101", - "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" - }, - "barcode": { - "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" - } - }, - "is_referral_code": false, - "created_at": "2023-01-25T12:18:09.256Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": -2 } } - }, - "Discount Coupon": { - "value": { - "id": "rr_0c5eb002b40cce9d62", - "object": "redemption_rollback", - "date": "2023-01-27T15:20:03.536Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "redemption": "r_0c5e8ef10842da0aad", - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": "2023-01-27T15:20:03.743Z", - "status": "CANCELED", - "amount": 6000, - "total_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "rollback_id": "rr_0c5eb002b40cce9d62", - "rollback_date": "2023-01-27T15:20:03.536Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + }, + "404": { + "description": "Returns an error when requesting the campaign that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_jcErmtGAOmHUAy0oUgkwKnP", + "request_id": "v-0bb8694614d58bf2a8", + "resource_id": "camp_jcErmtGAOmHUAy0oUgkwKnP", + "resource_type": "campaign" } } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T15:20:03.707Z", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" } } - }, - "Gift Card": { - "value": { - "id": "rr_0c5eb099214ccea115", - "object": "redemption_rollback", - "date": "2023-01-27T15:22:37.573Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": -2000, - "redemption": "r_0c5e8a38730ccec0d5", - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": "2023-01-27T15:22:37.628Z", - "status": "CANCELED", - "amount": 6000, - "total_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "rollback_id": "rr_0c5eb099214ccea115", - "rollback_date": "2023-01-27T15:22:37.573Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" - } + } + } + } + }, + "put": { + "operationId": "update-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Update Campaign", + "description": "Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. \n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped. \n\n> #### Vouchers will be affected\n>\n> This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the campaign parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_update_campaign" + }, + "examples": { + "Example": { + "value": { + "description": "New description" } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 2000, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", - "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T15:22:37.595Z", - "redemption": { - "quantity": 18, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "gift": { - "amount": -2000 } } - }, - "Promotion Tier": { - "value": { - "id": "rr_0ca286e96cc03f3e76", - "object": "redemption_rollback", - "date": "2023-03-21T07:57:12.526Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": { - "location_id": [ - "L2" - ] + } + } + }, + "responses": { + "200": { + "description": "Returns the campaign object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" }, - "redemption": "r_0ca286d222d2f7dc1f", - "reason": "To undo a redemption.", - "result": "SUCCESS", - "order": { - "id": "ord_0FR01SqYIxV4ITzgs1yZjkK6", - "source_id": "test_rollback_8", - "created_at": "2023-03-21T07:56:48.634Z", - "updated_at": "2023-03-21T07:57:12.546Z", - "status": "CANCELED", - "amount": 200000, - "total_amount": 200000, - "items": [ - { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" + "examples": { + "Example": { + "value": { + "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "LOYALTY-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" } }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "description": "New description", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 2, + "active": true, "metadata": { - "series": "2022-783CV" - } - }, - { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" + "region": "APAC" + }, + "created_at": "2022-09-21T09:39:45.479Z", + "updated_at": "2022-09-23T09:47:00.205Z", + "category": "First", + "creation_status": "MODIFYING", + "vouchers_generation_status": "MODIFYING", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ca286d222d2f7dc1f": { - "date": "2023-03-21T07:56:48.651Z", - "rollback_id": "rr_0ca286e96cc03f3e76", - "rollback_date": "2023-03-21T07:57:12.526Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + ], + "object": "campaign" } } - }, - "channel": { - "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", - "channel_type": "API" - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemons", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 23 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 5 - }, - "orders": { - "total_amount": 616000, - "total_discount_amount": 246400 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null, - "category_id": null, - "categories": [] } } } } } - } - }, - "400": { - "description": "Returns an error if the rollback redemption process failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Already rolledback": { - "value": { - "code": 400, - "key": "already_rolled_back", - "message": "Already rolled back", - "details": "Redemption has been already rolled back.", - "request_id": "v-0c5eb3bd81cd7e3a39", - "resource_id": "rrf_0c5eb3bd884497ed05", - "resource_type": "redemption_rollback" - } - }, - "Invalid Redemption Parent": { - "value": { - "code": 400, - "key": "invalid_redemption_parent", - "message": "Invalid redemption parent", - "details": "You can rollback only a redemption that does not have parent redemption.", - "request_id": "v-0c6382005e03b3bd2f" - } - }, - "Invalid Redemption": { - "value": { - "code": 400, - "key": "invalid_redemption", - "message": "Invalid redemption", - "details": "You can rollback only a single redemption. Use different endpoint for stacked redemption.", - "request_id": "v-0c675e5e2e04e31bb3" - } + }, + "delete": { + "operationId": "delete-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Delete Campaign", + "description": "Permanently deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [ + { + "schema": { + "type": "boolean" }, - "Invalid Order": { - "value": { - "code": 400, - "key": "invalid_order", - "message": "Invalid order", - "details": "Order is not related with redemption.", - "request_id": "v-0ca2770e3fc4047e25" + "in": "query", + "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with exactly the same name.", + "name": "force" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Delete Campaign": { + "$ref": "#/components/examples/res_async_actions" + } + } } - }, - "Invalidate Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Invalid customer", - "details": "Customer is not related with redemption.", - "request_id": "v-0ca284851b0404513f" + } + }, + "404": { + "description": "Returns an error indicating that the campaign with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Spring Campaign", + "request_id": "v-0adac46be8cdbfd921", + "resource_id": "Spring Campaign", + "resource_type": "campaign" + } + } + } } } } } } }, - "404": { - "description": "Returns an error if the rollback redemption process failed.", - "content": { - "application/json": { + "/v1/campaigns/{campaignId}/vouchers": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign to which voucher(s) will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "add-vouchers-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Add Vouchers to Campaign", + "description": "This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "vouchers_count", + "description": "Number of vouchers that should be added." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher parameters that you would like to overwrite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_add_vouchers_to_campaign" + }, + "examples": { + "Example": { + "value": { + "category_id": "cat_0bb81a481615a37b5e", + "start_date": "2022-09-24T00:00:00Z", + "expiration_date": "2022-09-25T23:59:59Z", + "active": false, + "redemption": { + "quantity": null + }, + "code_config": { + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "length": 8, + "prefix": "Add-", + "pattern": null, + "postfix": "-API" + }, + "additional_info": "Voucher added using API", + "metadata": { + "Season": "Fall" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded for a voucher count of 1.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0bb96ebb7ec3720252" + } + } + } + } + } }, - "examples": { - "Cannot find customer": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_eWgXlBBiY6THFRJwX45Iakv4s", - "request_id": "v-0c5ebc5de80a2cf1a5", - "resource_id": "cust_eWgXlBBiY6THFRJwX45Iakv4s", - "resource_type": "customer" + "202": { + "description": "Returns an `async_action_id` if the request was made to create more than 1 voucher.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + } } } } } } - } - } - } - }, - "/v1/promotions/tiers/{promotionTierId}/redemption": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "ID of the promotion tier to be redeemed." - } - ], - "post": { - "operationId": "redeem-promotion", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Promotion [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a promotion, you create a redemption object passing a context.\n\nYou can retrieve a list of active promotions through the [Validate Promotions](ref:validate-promotions) endpoint. That validation method will return a list of active​ promotion tiers identified by thier IDs. \n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_promotion_tier" + "/v1/campaigns/{campaignId}/vouchers/{code}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." }, - "examples": { - "One product one sku": { - "value": { - "customer": { - "source_id": "annie@lemon.com", - "name": "Annie Lemon", - "email": "annie@lemon.com" + { + "schema": { + "type": "string" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A custom **code** that identifies the voucher." + } + ], + "post": { + "operationId": "add-voucher-with-specific-code-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Add Voucher with Specific Code to Campaign", + "description": "This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher parameters that you would like to overwrite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_add_vouchers_with_specific_code_to_campaign" }, - "order": { - "amount": 200000, - "items": [ - { - "source_id": "apple534", - "product_id": "prod_anJ03RZZq74z4v", - "related_object": "product", - "quantity": 2, - "price": 50000, - "product": { - "override": true, - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } + "examples": { + "Example": { + "value": { + "category_id": "cat_0bb81a481615a37b5e", + "start_date": "2022-09-24T00:00:00Z", + "expiration_date": "2022-09-25T23:59:59Z", + "active": false, + "redemption": { + "quantity": null }, + "additional_info": "Voucher added using API", "metadata": { - "series": "2022-783CV" + "Season": "Fall" } - }, - { - "sku_id": "sku_0KtP4rvwEECQ2U", - "source_id": "apple534-ihd5", - "related_object": "sku", - "quantity": 1, - "price": 100000, - "sku": { - "override": true, - "sku": "Apple iPad 10 Silver 64GB", + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_EJwB9Wy2aOIsDpWhnl2QBY51OqjQ5Ukg", + "code": "Code3", + "campaign": "Add Vouchers to Campaign", + "campaign_id": "camp_xxpmFyWO9h9s5cEe7HtmOK5B", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 2000, + "percent_off": 30, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-24T00:00:00.000Z", + "expiration_date": "2022-09-25T23:59:59.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "Voucher added using API", "metadata": { - "category": "electronics" - } + "Season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+p2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6+1N81zXuY6/pnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bp2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6%2B1N81zXuY6%2FpnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5/u9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY+sOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW+NCQg6Ts8clYWWP5lrGyV/fzoA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5%2Fu9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY%2BsOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW%2BNCQg6Ts8clYWWP5lrGyV%2FfzoA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-21T07:14:28.217Z", + "updated_at": null, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/Code3/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/Code3/publications?page=1&limit=10" + }, + "object": "voucher" } } - ] + } + } + } + }, + "409": { + "description": "Returns an error if a voucher with the same code already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Duplicate": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated voucher exists with id Code1", + "request_id": "v-0bb974be99d22504cd", + "resource_id": "Code1", + "resource_type": "voucher" + } + } + } } } } } } - } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { + }, + "/v1/campaigns/{campaignId}/import": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended" - }, - "examples": { - "One product one sku": { - "value": { - "id": "r_0ca2699201c03f121b", - "object": "redemption", - "date": "2023-03-21T05:49:00.807Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_IVEF85NZCXmP4S1fGmImSTwH", - "source_id": null, - "created_at": "2023-03-21T05:49:00.772Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The ID of an existing campaign to which you're importing the codes. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "import-vouchers-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Import Vouchers to Campaign", + "description": "Imports vouchers to an **existing** campaign.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Discount type, expiration date and the remaining attributes will be taken from the [Campaign](ref:get-campaign) settings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_import_vouchers_to_campaign" + }, + "examples": { + "Example": { + "value": [ { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } + "code": "CODE7", + "category": "First", + "redemption": { + "quantity": 1 }, "metadata": { - "series": "2022-783CV" - } + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true }, { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ca2699201c03f121b": { - "date": "2023-03-21T05:49:00.807Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + "code": "CODE8", + "category": "Second", + "redemption": { + "quantity": 18 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true + }, + { + "code": "CODE9", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true } - } - }, - "channel": { - "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", - "channel_type": "API" + ] }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 5 + "Gift Cards": { + "value": [ + { + "code": "CODE13", + "category": "First", + "redemption": { + "quantity": 1 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "gift": { + "amount": 500 + }, + "active": true }, - "orders": { - "total_amount": 616000, - "total_discount_amount": 246400 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_z6MvMg2Zf2UABNWN", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_type": "promotion_tier", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "category_id": null, - "categories": [] - } - } - }, - "Example": { - "value": { - "id": "r_0c64c10b8ece60bd91", - "object": "redemption", - "date": "2023-02-01T08:25:22.235Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_7n58dbLV2jMG4C14XjEYEbjh", - "source_id": null, - "created_at": "2023-02-01T08:25:22.192Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } + "code": "CODE14", + "category": "Second", + "redemption": { + "quantity": 18 }, "metadata": { - "series": "2022-783CV" - } + "season": "Fall" + }, + "additional_info": "secret-code1", + "gift": { + "amount": 2000 + }, + "active": true }, { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } + "code": "CODE15", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": false } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c64c10b8ece60bd91": { - "date": "2023-02-01T08:25:22.235Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + ] + }, + "Loyalty Cards": { + "value": [ + { + "code": "CODE10", + "category": "First", + "redemption": { + "quantity": 1 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "loyalty_card": { + "points": 300 + }, + "active": true + }, + { + "code": "CODE11", + "category": "Second", + "redemption": { + "quantity": 18 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "loyalty_card": { + "points": 2000 + }, + "active": true + }, + { + "code": "CODE12", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true } + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" } + } + } + } + }, + "400": { + "description": "Returns an error if the request includes incorrect data, e.g. a wrong data type or duplicated codes.", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_voucher" + }, + { + "$ref": "#/components/schemas/e_400_duplicate_key" + } + ] }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" + "examples": { + "Duplicate Codes": { + "value": { + "code": 400, + "key": "duplicate_key", + "message": "Duplicate codes", + "details": "2 voucher codes(s) already exist.", + "request_id": "v-0adaccaba61502e4b3" } }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 3 - }, - "orders": { - "total_amount": 408000, - "total_discount_amount": 163200 + "Missing Code": { + "value": { + "code": 400, + "key": "invalid_voucher", + "message": "Invalid Voucher", + "details": "Found 1 voucher(s) without 'code' value", + "request_id": "v-0bbc38ce088c8b2f9a" } }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_z6MvMg2Zf2UABNWN", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_type": "promotion_tier", - "object": "validation_rules_assignment" - } - ], - "total": 1 + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redemption.quantity should be number,null", + "request_id": "v-0c545db3808418908f" + } } } } @@ -64998,838 +51105,1331 @@ } } }, - "400": { - "description": "Returns an error if the promotion tier is inactive.", - "content": { - "application/json": { + "/v1/campaigns/{campaignId}/importCSV": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Inactive Promotion": { - "value": { - "code": 400, - "key": "promotion_inactive", - "message": "Inactive Promotion", - "details": "Promotion Tier with id: promo_DE1N30D731Tg2F6NoMwNas2W is disabled.", - "request_id": "v-0c64b722160294496b", - "resource_id": "rf_0c64b7223cce60eec6", - "resource_type": "redemption", - "error": { - "message": "The promotion is inactive." - } + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "import-vouchers-to-campaign-using-csv", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Import Vouchers to Campaign by CSV", + "description": "Imports vouchers to an **existing** campaign. \n\n\nThe CSV file has to include headers in the first line. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \\\n -F file=@/path/to/campaigns.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nYou can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties. \n\nDiscount type, time limits, and validation rules will be taken from the [campaign object](ref:get-campaign) settings. \n\n\n| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |\n|---|---|---|---|---|---|---|---|\n| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.
Context: `LOYALTY_PROGRAM` | The initial gift card balance.
Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |\n|\n\n> 📘 Active\n>\n> The CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" } } - } - } - } - } - } - } - }, - "/client/v1/redemptions": { - "post": { - "operationId": "redeem-stacked-discounts-client-side", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Redeem Stackable Discounts (client-side)", - "description": "Use this method to redeem up to 5 redeemables in a single API request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions).", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_redemptions" + }, + "description": "The file path is stored in the form `file` header." }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" + "responses": { + "200": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" + } } - ], - "session": { - "type": "LOCK", - "key": "session_key" - }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } + } + } + }, + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_FZL4iTTdZw36nZOoXYQ172fQ", + "request_id": "v-0bc26adad888b6fed1", + "resource_id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "resource_type": "campaign" } } - ], - "metadata": { - "key": "value" } } } } } } - } - }, - "responses": { - "200": { - "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
`array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
`object` | Represents the final effect of all child redemptions executed during the request. |\n| order
`object` | Represents order details after all discounts are applied. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" + }, + "/v1/campaigns/qualification": { + "post": { + "operationId": "examine-campaigns-qualification", + "deprecated": true, + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Examine Qualification [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nThe method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order). \n\nThe maximum number of **returned campaigns is 50**.\n\n## What campaign types are included in the response?\n\n- `DISCOUNT_COUPONS`\n- `GIFT_VOUCHERS`\n- `REFERRAL_PROGRAM`\n\n## What's excluded?\n\nA checking logic will be run only among campaigns and will ignore _standalone vouchers_. For standalone vouchers, you should run a [dedicated endpoint](ref:examine-vouchers-qualification) for searching and identifing vouchers. \n\n## Subsequent Steps\n\nAs a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](ref:create-publication) will return a unique code which will belong to a given customer.\n\n## Sample use case\n\nAs a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "audienceRulesOnly", + "description": "This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)" + }, + { + "schema": { + "type": "integer", + "maximum": 50 + }, + "in": "query", + "name": "limit", + "description": "The number of campaigns to be qualified. The maximum number is 50." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "type", + "-type", + "code", + "-code", + "category", + "-category", + "campaign", + "-campaign" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." } - } - } - } - } - } - }, - "/v1/validations": { - "post": { - "operationId": "validate-stacked-discounts", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Validate Stackable Discounts", - "description": "Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings.\n \n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_validations" - }, - "examples": { - "1 Redeemable": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" - } - ], - "session": { - "type": "LOCK" + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_examine_qualification" }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", "metadata": { "key": "value" } + }, + "order": { + "amount": 10000, + "items": [ + { + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ] + }, + "metadata": { + "key": "value" } } - ], - "metadata": { - "key": "value" } } } + } + }, + "responses": { + "200": { + "description": "This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_res_examine_qualification" + } + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" }, - "5 Redeemables": { - "value": { - "customer": { - "source_id": "36_bob" - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "GNcuPKGe" - }, - { - "object": "voucher", - "id": "AnsvocvP", - "reward": { - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - } - }, - { - "object": "voucher", - "id": "M3X8IwW8", - "gift": { - "credits": 100 + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "enable-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Enable Campaign", + "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an empty json `{}`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/res_empty_json" + }, + "examples": { + "Empty JSON": { + "value": {} } - }, - { - "object": "promotion_tier", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W" - }, - { - "object": "promotion_tier", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" } - ], - "session": { - "type": "LOCK" - }, - "order": { - "items": [ - { - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1 - }, - { - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1 + } + } + }, + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_h8RyP6FV94F3Ev2odP24j5p", + "request_id": "v-0adaf4847c9502879b", + "resource_id": "camp_h8RyP6FV94F3Ev2odP24j5p", + "resource_type": "campaign" + } } - ] + } } } } } } - } - }, - "responses": { - "200": { - "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
`boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
`array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
`object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", - "content": { - "application/json": { + }, + "/v1/campaigns/{campaignId}/disable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/19_res_validations" + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" }, - "examples": { - "False": { - "value": { - "valid": false, - "redeemables": [ - { - "status": "INAPPLICABLE", - "id": "eee33463", - "object": "voucher", - "result": { - "error": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id eee33463", - "request_id": "v-0c6c6e20dc42940f0b", - "resource_id": "eee33463", - "resource_type": "voucher" - } + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being disabled. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "disable-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Disable Campaign", + "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an empty json `{}`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/res_empty_json" + }, + "examples": { + "Empty JSON": { + "value": {} + } + } + } + } + }, + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Spring Campaign", + "request_id": "v-0adaf3735116bb298b", + "resource_id": "Spring Campaign", + "resource_type": "campaign" } - }, - { - "status": "SKIPPED", - "id": "promo_Mwy9XpA0TLctSGriM5kum0qp", - "object": "promotion_tier", - "result": {} } - ], - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==" + } + } + } + } + } + } + }, + "/v1/promotion-tier-object": { + "get": { + "operationId": "promotion-tier-object", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Promotion Tier Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Promotion Tier Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } } + } + } + } + } + }, + "/v1/promotions/tiers": { + "get": { + "operationId": "list-promotion-tiers", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers", + "description": "This method enables you to list promotion tiers.", + "parameters": [ + { + "schema": { + "type": "boolean" }, - "True - 5 Redeemables": { - "value": { - "valid": true, - "redeemables": [ - { - "status": "APPLICABLE", - "id": "GNcuPKGe", - "object": "voucher", - "order": { - "amount": 2700, - "items_discount_amount": 1700, - "total_discount_amount": 1700, - "total_amount": 1000, - "items_applied_discount_amount": 1700, - "total_applied_discount_amount": 1700, - "items": [ + "in": "query", + "name": "is_available", + "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "category_id": "cat_0bb81a481615a37b5e", + "object": "campaign" + }, + "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null }, { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 3, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS", - "amount_off": 1000, - "is_dynamic": false - } - }, - "metadata": {}, - "categories": [] - }, - { - "status": "APPLICABLE", - "id": "AnsvocvP", - "object": "voucher", - "order": { - "amount": 2700, - "items_discount_amount": 1700, - "total_discount_amount": 1700, - "total_amount": 1000, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" + "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "created_at": "2021-12-15T11:34:01.358Z", + "updated_at": "2022-02-09T09:20:08.619Z", + "name": "Hot Promotion - Tier 2", + "banner": "Get Tier 2 Discount $20 Off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + } }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 33 + }, + "orders": { + "total_amount": 519200, + "total_discount_amount": 66000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_pEe1inoYSfmO12p7", + "rule_id": "val_5h0wc453_5", + "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.358Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } }, { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 + "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "created_at": "2021-12-15T11:34:01.333Z", + "updated_at": "2022-02-09T09:20:05.603Z", + "name": "Hot Promotion - Tier 1", + "banner": "Get Tier 1 Discount 10zl", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "ProductionMetaData": "Hot Promotion - Tier 1" + }, + "hierarchy": 1, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 11 + }, + "orders": { + "total_amount": 1414979, + "total_discount_amount": 11000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_QqYs7GGVy7cuh3L9", + "rule_id": "val_5h0wc453_4", + "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.333Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } } ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "loyalty_card": { - "points": 4 - } - }, - "metadata": {}, - "categories": [ - { - "id": "cat_0bb81a481615a37b5e", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-09-20T05:58:01.561Z", - "object": "category" - } - ] - }, - { - "status": "APPLICABLE", - "id": "M3X8IwW8", - "object": "voucher", - "order": { - "amount": 2700, - "discount_amount": 100, - "items_discount_amount": 1700, - "total_discount_amount": 1800, - "total_amount": 900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ + "total": 3 + } + } + } + } + } + } + } + } + }, + "/client/v1/promotions/tiers": { + "get": { + "operationId": "list-promotion-tiers-client-side", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers (client-side)", + "description": "This method enables you to list promotion tiers.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "is_available", + "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "category_id": "cat_0bb81a481615a37b5e", + "object": "campaign" + }, + "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null }, { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "gift": { - "credits": 100 - } - }, - "metadata": {}, - "categories": [] - }, - { - "status": "APPLICABLE", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "object": "promotion_tier", - "order": { - "amount": 2700, - "discount_amount": 460, - "items_discount_amount": 1700, - "total_discount_amount": 2160, - "total_amount": 540, - "applied_discount_amount": 360, - "total_applied_discount_amount": 360, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" + "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "created_at": "2021-12-15T11:34:01.358Z", + "updated_at": "2022-02-09T09:20:08.619Z", + "name": "Hot Promotion - Tier 2", + "banner": "Get Tier 2 Discount $20 Off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + } }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 33 + }, + "orders": { + "total_amount": 519200, + "total_discount_amount": 66000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_pEe1inoYSfmO12p7", + "rule_id": "val_5h0wc453_5", + "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.358Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } }, { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 + "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "created_at": "2021-12-15T11:34:01.333Z", + "updated_at": "2022-02-09T09:20:05.603Z", + "name": "Hot Promotion - Tier 1", + "banner": "Get Tier 1 Discount 10zl", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "ProductionMetaData": "Hot Promotion - Tier 1" + }, + "hierarchy": 1, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 11 + }, + "orders": { + "total_amount": 1414979, + "total_discount_amount": 11000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_QqYs7GGVy7cuh3L9", + "rule_id": "val_5h0wc453_4", + "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.333Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } } ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ + "total": 3 + } + } + } + } + } + } + } + } + }, + "/v1/promotions/{campaignId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID assigned by Voucherify." + } + ], + "get": { + "operationId": "list-promotion-tiers-from-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers from Campaign", + "description": "This method enables you to list promotion tiers from a specified campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" + "id": "promo_xyOKjAmysZrwt3aqq1dMUwMU", + "created_at": "2022-04-07T08:43:53.730Z", + "updated_at": "2022-08-26T05:22:43.220Z", + "name": "Amount", + "banner": "Get $10 off entire order", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "campaign": { + "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b5f67863083bf7c05", + "object": "campaign" + }, + "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 1 + }, + "orders": { + "total_amount": 2187, + "total_discount_amount": 1000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null }, { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" + "id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", + "created_at": "2022-04-07T08:43:53.581Z", + "updated_at": "2022-08-26T05:22:43.008Z", + "name": "Percentage", + "banner": "Get 10% OFF on entire order", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "campaign": { + "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b5f67863083bf7c05", + "object": "campaign" + }, + "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 1 + }, + "orders": { + "total_amount": 71600, + "total_discount_amount": 7160 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } ], "total": 2, - "data_ref": "data", - "object": "list" + "has_more": false + } + } + } + } + } + } + } + }, + "post": { + "operationId": "add-promotion-tier-to-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Add Promotion Tier to Campaign", + "description": "This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion tier parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" + }, + "examples": { + "Example": { + "value": { + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } }, - "inapplicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "strict": false, - "effect": "APPLY_TO_EVERY" + "metadata": {}, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "validation_rules": [ + "val_q8qUBMOh5qIQ" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a promotion tier object if the promotion tier was successfully added to the campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_JcYGIKJsnv0SpZcx2njZm69x", + "created_at": "2022-09-22T11:21:57.808Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" } + }, + "metadata": {}, + "hierarchy": 6, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 ], - "total": 1, - "data_ref": "data", - "object": "list" - }, - "result": { + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_AmeYPmiLZKaIxq01", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_JcYGIKJsnv0SpZcx2njZm69x", + "related_object_type": "promotion_tier", + "created_at": "2022-09-22T11:21:57.808Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + } + } + } + } + } + } + } + } + } + }, + "/v1/promotions/tiers/{promotionTierId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "promo_2EnAik6Jt7dKTOMkRTIgEjZH" + }, + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "get": { + "operationId": "get-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Get Promotion Tier", + "description": "This method enables you to retrieve a specific promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a promotion tier object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + } + } + } + } + }, + "put": { + "operationId": "update-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Update Promotion Tier", + "description": "This method updates a promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion tier parameters that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_update_promotion_tier" + }, + "examples": { + "Example": { + "value": { + "name": "Order more than $100 USD", + "banner": "Order more than $100 USD", + "action": { "discount": { "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 40, - "is_dynamic": false + "percent_off": 25, + "effect": "APPLY_TO_ORDER" } }, - "metadata": {} - }, - { - "status": "APPLICABLE", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf", - "object": "promotion_tier", - "order": { - "amount": 2700, - "discount_amount": 490, - "items_discount_amount": 1700, - "total_discount_amount": 2190, - "total_amount": 510, - "applied_discount_amount": 30, - "total_applied_discount_amount": 30, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } + "metadata": { + "level": "A-21" + }, + "hierarchy": 1, + "start_date": "2022-09-22T00:00:00.000Z", + "expiration_date": "2022-09-29T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3 + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a promotion tier object if the update was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_hINAfBAVhmFuSAzi3vptfyxW", + "created_at": "2022-09-22T12:40:23.286Z", + "updated_at": "2022-09-22T12:40:58.626Z", + "name": "Order more than $100 USD", + "banner": "Order more than $100 USD", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 25, + "effect": "APPLY_TO_ORDER" } + }, + "metadata": { + "level": "A-21" + }, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": false, + "start_date": "2022-09-22T00:00:00.000Z", + "expiration_date": "2022-09-29T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3 ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ - { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" + "summary": { + "redemptions": { + "total_redeemed": 0 }, - { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "strict": false, - "effect": "APPLY_TO_EVERY" + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } - ], - "total": 1, - "data_ref": "data", - "object": "list" - }, - "result": { - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 30, - "is_dynamic": false + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_8e3e53ZgDNcoRGAI", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW", + "related_object_type": "promotion_tier", + "created_at": "2022-09-22T12:40:23.286Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } - }, - "metadata": {} + } } - ], - "order": { - "amount": 2700, - "discount_amount": 490, - "items_discount_amount": 1700, - "total_discount_amount": 2190, - "total_amount": 510, - "applied_discount_amount": 490, - "items_applied_discount_amount": 1700, - "total_applied_discount_amount": 2190, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Delete Promotion Tier", + "description": "This method deletes a promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the promotion tier with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_2EnAik6Jt7dKTOMkRTIgEjZ", + "request_id": "v-0ae284707e9027a79d", + "resource_id": "promo_2EnAik6Jt7dKTOMkRTIgEjZ", + "resource_type": "promotion_tier" } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "session": { - "key": "ssn_pkJfPcWAgp9WyHpA62Eky8X8SzxpKub2", - "type": "LOCK", - "ttl": 7, - "ttl_unit": "DAYS" + } } } } @@ -65837,698 +52437,636 @@ } } }, - "400": { - "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", - "content": { - "application/json": { + "/v1/promotions/tiers/{promotionTierId}/enable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" + "type": "string", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redeemables[1] should have required property 'id'", - "request_id": "v-0b4ff38ab8c8164573" - } - }, - "Duplicated Redeemables": { - "value": { - "code": 400, - "key": "duplicated_redeemables", - "message": "Duplicated redeemables detected", - "details": "Duplicated redeemables detected in one redemption", - "request_id": "v-0b4ffecfb408165300" - } - }, - "Invalid Redeemables": { - "value": { - "code": 400, - "key": "invalid_redeemables", - "message": "Invalid redeemables", - "details": "Promotion Stack cannot be use with other redeemables", - "request_id": "v-0b5007812f48165d6b" - } - } - } + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." } - } - } - } - } - }, - "/client/v1/validations": { - "post": { - "operationId": "validate-stacked-discounts-client-side", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Validate Stackable Discounts (client-side)", - "description": "Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_validations" - }, - "examples": { - "1 Redeemable": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" - } - ], - "session": { - "type": "LOCK" - }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } + ], + "post": { + "operationId": "enable-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Enable Promotion Tier", + "description": "This method enables a promotion tier, i.e. makes the `active` parameter = `true`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the promotion tier object with an updated `active` parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "updated_at": "2022-09-22T10:32:07.712Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 2 + }, + "orders": { + "total_amount": 37650, + "total_discount_amount": 6000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } - ], - "metadata": { - "key": "value" } } } }, - "5 Redeemables": { - "value": { - "customer": { - "source_id": "36_bob" - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "GNcuPKGe" - }, - { - "object": "voucher", - "id": "AnsvocvP", - "reward": { - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - } - }, - { - "object": "voucher", - "id": "M3X8IwW8", - "gift": { - "credits": 100 + "404": { + "description": "Returns an error if the promotion tier cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", + "request_id": "v-0bbaea52be14cc9782", + "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", + "resource_type": "promotion_tier" + } } - }, - { - "object": "promotion_tier", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W" - }, - { - "object": "promotion_tier", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" } - ], - "session": { - "type": "LOCK" - }, - "order": { - "items": [ - { - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1 - }, - { - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1 - } - ] } } } } } - } - }, - "responses": { - "200": { - "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
`boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
`array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
`object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_validations" - } - } - } }, - "400": { - "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", - "content": { - "application/json": { + "/v1/promotions/tiers/{promotionTierId}/disable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" + "type": "string", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redeemables[1] should have required property 'id'", - "request_id": "v-0b4ff38ab8c8164573" - } - }, - "Duplicated Redeemables": { - "value": { - "code": 400, - "key": "duplicated_redeemables", - "message": "Duplicated redeemables detected", - "details": "Duplicated redeemables detected in one redemption", - "request_id": "v-0b4ffecfb408165300" + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "post": { + "operationId": "disable-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Disable Promotion Tier", + "description": "This method disables a promotion tier, i.e. makes the `active` parameter = `false`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the promotion tier object with an updated `active` parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "updated_at": "2022-09-22T10:34:09.529Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 2 + }, + "orders": { + "total_amount": 37650, + "total_discount_amount": 6000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null + } + } + } } - }, - "Invalid Redeemables": { - "value": { - "code": 400, - "key": "invalid_redeemables", - "message": "Invalid redeemables", - "details": "Promotion Stack cannot be use with other redeemables", - "request_id": "v-0b5007812f48165d6b" + } + }, + "404": { + "description": "Returns an error if the promotion tier cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", + "request_id": "v-0bbaea52be14cc9782", + "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", + "resource_type": "promotion_tier" + } + } + } } } } } } - } - } - } - }, - "/v1/redemptions/{parentRedemptionId}/rollbacks": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "parentRedemptionId", - "in": "path", - "required": true, - "description": "Unique identifier of a parent redemption, e.g. `r_JQfm73zWSJFQxs3bGxweYjgm`." - } - ], - "post": { - "operationId": "rollback-stacked-redemptions", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Rollback Stackable Redemptions", - "description": "Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an array with the individual redemption rollback results along with the parent rollback result and related order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_parentRedemptionId_rollbacks" - } - } - } }, - "400": { - "description": "Returns an error indicating that the parent redemption ID is invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "/v1/promotions/stacks": { + "get": { + "operationId": "list-all-promotion-stacks", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Stacks", + "description": "This method enables you to list promotion stacks irrespective of the campaign they are associated with. \n\nYou can use filters in the query parameters to specify the stacks to be returned in the response.\n\n## Advanced filters for fetching promotion stacks\n\n| **Filters** | **Examples** |\n| :--- | :--- |\n| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |\n| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`
- `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." }, - "examples": { - "Invalid Redemption Parent": { - "value": { - "code": 400, - "key": "invalid_redemption_parent", - "message": "Invalid redemption parent", - "details": "You can rollback only a redemption that does not have parent redemption.", - "request_id": "v-0b56a1cf1e4d69b375" - } + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "name", + "-name" + ] }, - "Already rolled back": { - "value": { - "code": 400, - "key": "already_rolled_back", - "message": "Already rolled back", - "details": "Redemption has been already rolled back.", - "request_id": "v-0c67af9544c4e3388f", - "resource_id": "rrf_0c67af954e039be56b", - "resource_type": "redemption_rollback" + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `data` property that contains an array of promotion stacks across all your campaigns.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_stacks" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "stack_SLuhQrAt3mXwHg776lYkzZO8", + "name": "Stack 2", + "created_at": "2022-11-03T10:18:58.356Z", + "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Mfww2TuoeU23enqSmnz0f3rh", + "promo_vU5IHaLKS7mmZ3ylABET6ikb", + "promo_TeHA11JlfN29mUftDcpqIWWq", + "promo_bhKBsIX3tO7yqmpTLCLLuaud" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_twQWp1TyaxX5RlSqn061xGVy", + "name": "First stack", + "created_at": "2021-12-27T11:59:21.838Z", + "updated_at": "2022-12-16T08:22:51.970Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga", + "promo_Mwy9XpA0TLctSGriM5kum0qp" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_vhCqN5PY7rmPw8yACRvHRZaz", + "name": "Second stack", + "created_at": "2021-12-27T11:55:47.431Z", + "updated_at": "2022-12-16T08:22:52.221Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga", + "promo_Mwy9XpA0TLctSGriM5kum0qp" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_zwChew7GY1AnDZJQ6GVP2sdT", + "name": "Third stack", + "created_at": "2021-12-27T11:54:26.283Z", + "updated_at": "2022-12-16T08:22:52.483Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_NS5hEUznL9XPa89rbrOZYMey", + "name": "Fourth stack", + "created_at": "2021-12-27T11:48:43.982Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_Rz0NvFtCZOObS3J5R68KET17", + "name": "Third stack", + "created_at": "2021-12-27T11:40:57.426Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_e8pH0nIuANmYRPE0x8hwDrpm", + "name": "Second stack", + "created_at": "2021-12-27T08:43:13.875Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_3Q4EJpZqg3DI5IRwgBYfsb37", + "name": "First stack", + "created_at": "2021-12-27T08:43:13.498Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_KxSD0GahLUg9ULB6TseGfUHJ", + "name": "Stack 1", + "created_at": "2021-12-23T12:28:38.881Z", + "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_NMex647s5UushvbBUJmYT2Fc", + "promo_4TqHr24boFISDrcOHSlfAxwm" + ], + "hierarchy_mode": "MANUAL" + } + } + ], + "total": 9 + } + } + } } } } } } - } - } - } - }, - "/v1/loyalty-campaign-object": { - "get": { - "operationId": "loyalty-campaign-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Campaign Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Campaign Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - } - } - } - } - } - } - }, - "/v1/loyalty-card-object": { - "get": { - "operationId": "loyalty-card-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Card Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Card Object", - "content": { - "application/json": { + }, + "/v1/promotions/{campaignId}/stacks": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - } + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." } - } - } - } - } - }, - "/v1/loyalty-tier-object": { - "get": { - "operationId": "loyalty-tier-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Tier Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Tier Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + ], + "get": { + "operationId": "list-promotion-stacks-in-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Stacks in Campaign", + "description": "This method enables you to list promotion stacks from a specified campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - } - } - }, - "/v1/earning-object": { - "get": { - "operationId": "earning-rule-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Earning Rule Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Earning Rule Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" + ], + "responses": { + "200": { + "description": "Returns a list of promotion stack objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_stacks" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "stack_p0WhtyyDU95crobleMpRabhH", + "name": "First stack", + "created_at": "2022-09-22T13:03:25.740Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_dJNhAEeV5sR5oPQq1UrUdnMC", + "promo_aaAF8mVAzA0PF1igia2OC63d" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_XAzn8AFR3Ks3DBPLAQxV7zHe", + "name": "Second stack", + "created_at": "2022-09-22T13:03:25.903Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" + } + } + ], + "total": 2 + } + } + } + } + } } } - } - } - } - } - }, - "/v1/loyalties": { - "get": { - "operationId": "list-loyalty-programs", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Campaigns", - "description": "Returns a list of your loyalty campaigns.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with loyalty program objects. The loyalty campaigns are returned sorted by creation date, with the most recent campaigns appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_campaigns" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "campaigns", - "campaigns": [ - { - "id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", - "name": "Loyalty Campaign 1", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description.", - "vouchers_count": 6, - "active": true, - "metadata": { - "Season": "Fall" - }, - "created_at": "2022-11-21T13:57:03.712Z", - "updated_at": "2022-11-23T09:59:49.581Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b6152ce12414820dc", - "categories": [], - "object": "campaign" - }, - { - "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "name": "Loyalty Campaign - Tiers", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LT1-", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2022-11-01T00:00:00.000Z" - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "start_date": "2022-11-01T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5, - 6 - ], - "vouchers_count": 3, - "active": true, - "metadata": {}, - "created_at": "2022-11-09T06:26:52.985Z", - "updated_at": "2022-11-10T08:54:46.136Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b8b5a427a0283c854", - "categories": [], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" - } - } - }, - "object": "campaign" - }, - { - "id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW", - "name": "Loyalty Campaign Example", - "campaign_type": "LOYALTY_PROGRAM", - "type": "STATIC", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2021-12-15T00:00:00.000Z", - "expiration_date": "2021-12-31T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "start_date": "2021-12-15T00:00:00.000Z", - "expiration_date": "2021-12-31T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 3, - 4, - 5, - 6 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": false, - "metadata": {}, - "created_at": "2021-12-15T08:02:52.298Z", - "updated_at": "2021-12-15T08:11:43.808Z", - "creation_status": "DRAFT", - "vouchers_generation_status": "DRAFT", - "protected": false, - "category_id": null, - "categories": [], - "object": "campaign" + "post": { + "operationId": "create-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Create Promotion Stack", + "description": "This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the order of promotion tiers for the promotion stack.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_create_promotion_stack" + }, + "examples": { + "Example": { + "value": { + "name": "Fifth Stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" + } } - ], - "total": 3 + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Loyalty Campaign", - "description": "Creates a batch of [loyalty cards](ref:get-member) aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern. \n\n\n> 📘 Global uniqueness\n> All codes are unique across the whole project. Voucherify won't allow to generate the same codes in any of your campaigns.\n\n\n> 🚧 Asyncronous action!\n>\n> This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See `creation_status` field in the [loyalty campaign object](ref:get-loyalty-program) description.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the loyalty campaign details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_cards" }, - "examples": { - "Example": { - "value": { - "name": "Loyalty Program 4", - "description": "This is a campaign description.", - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "start_date": "2016-10-26T00:00:00Z", - "expiration_date": "2024-10-26T00:00:00Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "activity_duration_after_publishing": "P24D", - "category_id": "cat_0b6152ce12414820dc", - "vouchers_count": 2, - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_QUARTER" + "responses": { + "200": { + "description": "Returns a new stack object if a valid promotion campaign identifier was provided in the path and available promotion IDs in the payload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", + "name": "Fifth Stack", + "created_at": "2022-09-23T07:44:53.888Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" + } + } } - }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "pattern": "L-CARD-#######" } - }, - "metadata": { - "test": true - }, - "type": "STATIC", - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" + } + } + }, + "404": { + "description": "Returns an error if the campaign or promotion tier cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", + "request_id": "v-0bbc10de5886137afd", + "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", + "resource_type": "campaign" + } + }, + "Promotion Tier Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_dJNhAEeV5sR5oPQq1UrUdnM", + "request_id": "v-0bbc11186303fa288a", + "resource_id": "promo_dJNhAEeV5sR5oPQq1UrUdnM", + "resource_type": "promotion_tier" + } } } } @@ -66536,1294 +53074,1656 @@ } } } - } - }, - "responses": { - "200": { - "description": "Returns a campaign object with its settings but without the loyalty card codes.", - "content": { - "application/json": { + }, + "/v1/promotions/{campaignId}/stacks/{stackId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", - "name": "Loyalty Program 4", - "campaign_type": "LOYALTY_PROGRAM", - "type": "STATIC", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_QUARTER" + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "stack_KOIde7AUf08at12lZ1r3OfFL" + }, + "name": "stackId", + "in": "path", + "required": true, + "description": "Promotion stack ID." + } + ], + "get": { + "operationId": "get-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Get Promotion Stack", + "description": "This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a stack object if valid identifiers were provided in the path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_p0WhtyyDU95crobleMpRabhH", + "name": "First stack", + "created_at": "2022-09-22T13:03:25.740Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_dJNhAEeV5sR5oPQq1UrUdnMC", + "promo_aaAF8mVAzA0PF1igia2OC63d" + ], + "hierarchy_mode": "MANUAL" + } } - }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "L-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2016-10-26T00:00:00.000Z", - "expiration_date": "2024-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description.", - "start_date": "2016-10-26T00:00:00.000Z", - "expiration_date": "2024-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "test": true - }, - "created_at": "2022-11-29T13:10:30.848Z", - "category": "New Customers", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b6152ce12414820dc", - "categories": [ - { - "id": "cat_0b6152ce12414820dc", - "name": "New Customers", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" } - ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" + } + } + } + }, + "404": { + "description": "Returns an error if the campaign or promotion stack cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Stack Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_stack with id stack_p0WhtyyDU95crobleMpRabh", + "request_id": "v-0bbc0a659591f99d65", + "resource_id": "stack_p0WhtyyDU95crobleMpRabh", + "resource_type": "promotion_stack" + } }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", + "request_id": "v-0bbc0aa77a0c8b78e8", + "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", + "resource_type": "campaign" } } - }, - "object": "campaign" + } } } } } - } - }, - "409": { - "description": "Returns an error if a loyalty campaign with the same name already exists.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated campaign exists with name Loyalty Program 2", - "request_id": "v-0c12951ec58e67577e", - "resource_id": "Loyalty Program 2", - "resource_type": "campaign" + }, + "put": { + "operationId": "update-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Update Promotion Stack", + "description": "This methods allows for editing an existing stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion stack parameters that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_create_promotion_stack" + }, + "examples": { + "Example": { + "value": { + "name": "Fifth Stack Modified", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE" + ], + "hierarchy_mode": "MANUAL" + } + } + } } } } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "get-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Loyalty Campaign", - "description": "Retrieve a specific loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a loyalty campaign object for a given loyalty campaign ID. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "name": "Loyalty Campaign - Tiers - 1", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LT1-", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2022-11-01T00:00:00.000Z" - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "start_date": "2022-11-01T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5, - 6 - ], - "vouchers_count": 3, - "active": true, - "metadata": {}, - "created_at": "2022-11-09T06:26:52.985Z", - "updated_at": "2022-11-10T08:54:46.136Z", - "category": "Eighth", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b8b5a427a0283c854", - "categories": [ - { - "id": "cat_0b8b5a427a0283c854", - "name": "Eighth", - "hierarchy": 8, - "created_at": "2022-08-16T11:45:54.171Z", - "object": "category" + }, + "responses": { + "200": { + "description": "Returns a promotion stack with updated parameters if the update was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", + "name": "Fifth Stack Modified", + "created_at": "2022-09-23T07:44:53.888Z", + "updated_at": "2022-09-23T07:59:44.172Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE" + ], + "hierarchy_mode": "MANUAL" + } + } } - ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" + } + } + } + } + } + }, + "delete": { + "operationId": "delete-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Delete Promotion Stack", + "description": "This method deletes a promotion stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the stack or campaign with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Stack Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_stack with id stack_KOIde7AUf08at12lZ1r3OfFp", + "request_id": "v-0ae289ca779027b030", + "resource_id": "stack_KOIde7AUf08at12lZ1r3OfFp", + "resource_type": "promotion_stack" + } }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer % Promotion", + "request_id": "v-0ae28a621c46af534b", + "resource_id": "Summer % Promotion", + "resource_type": "campaign" } } - }, - "object": "campaign" + } } } } } } }, - "404": { - "description": "Returns an error if the campaign does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "/v1/reward-object": { + "get": { + "operationId": "reward-object", + "tags": [ + "REWARDS API" + ], + "summary": "Reward Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Reward object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" + } + } + } } } } - } - } - }, - "put": { - "operationId": "update-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Loyalty Campaign", - "description": "Updates a loyalty program. \n\nFields other than those specified in the allowed request body payload won't be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged. \n\nThis method will update the [loyalty cards](ref:get-member) which have not been published or redeemed yet.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the new values for the parameters that you would like to update for the given loyalty campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_loyalty_campaign" - }, - "examples": { - "Example": { - "value": { - "description": "This is a campaign description. Updated", - "auto_join": false, - "join_once": false, - "start_date": "2013-10-26T00:00:00Z", - "expiration_date": "2025-10-26T00:00:00Z", - "validity_timeframe": { - "duration": "PT2H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "activity_duration_after_publishing": "P25D", - "category_id": "cat_0b6152ce12414820dd", - "loyalty_card": { - "points": 1, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 4, - "rounding_type": "END_OF_YEAR" + }, + "/v1/reward-assignment-object": { + "get": { + "operationId": "reward-assignment-object", + "tags": [ + "REWARDS API" + ], + "summary": "Reward Assignment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Reward Assignment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" } - }, - "metadata": { - "test": false - }, - "type": "AUTO_UPDATE", - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P4M", - "rounding": { - "type": "CUSTOM", - "unit": "MONTH", - "value": 1 + } + } + } + } + } + }, + "/v1/rewards": { + "get": { + "operationId": "list-rewards", + "tags": [ + "REWARDS API" + ], + "summary": "List Rewards", + "description": "Retrieve rewards.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + }, + "in": "query", + "name": "assignment_id", + "description": "A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of reward objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_res_list_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rew_3e7IqghVtTR7L3xQMSCxjFu2", + "name": "Get $10", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "balance": 1000, + "type": "GIFT_VOUCHERS" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-03-10T08:40:20.917Z", + "updated_at": "2022-08-17T07:52:56.965Z", + "metadata": null, + "object": "reward" + }, + { + "id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "name": "Get 100 Points", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "balance": 100, + "type": "LOYALTY_PROGRAM" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-02-28T11:56:13.764Z", + "updated_at": null, + "metadata": null, + "object": "reward" + }, + { + "id": "rew_BNZ3van6AF2AiquWp8Lfw0xq", + "name": "30% discount", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_ZtHLATYVpItqmuSqmaz1rZ2Y", + "type": "DISCOUNT_COUPONS" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T09:48:50.609Z", + "updated_at": null, + "metadata": {}, + "object": "reward" + }, + { + "id": "rew_nlV8bgWU1jNO9YWQ7CdZmzq7", + "name": "1 point = $0.01", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 0.01, + "points_ratio": 1 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T16:45:21.582Z", + "updated_at": null, + "metadata": { + "Type": "0.01" + }, + "object": "reward" + }, + { + "id": "rew_x6FmF1KFdDs06hYPr9lK6ajf", + "name": "Material Reward", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619" + } + }, + "stock": "4", + "redeemed": "1", + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_wJHdZUAVSpWtYM6ORq4up3I2.png", + "description": "Get a Comic Book in Archie's series." + }, + "created_at": "2022-08-17T07:13:32.781Z", + "updated_at": null, + "metadata": { + "Type": "Personal" + }, + "object": "reward" + } + ], + "total": 5 + } } } } } } } - } - } - }, - "responses": { - "200": { - "description": "Returns the loyalty campaign object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", - "name": "Loyalty Program 4", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 4, - "rounding_type": "END_OF_YEAR" + }, + "post": { + "operationId": "create-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Create Reward", + "description": "Create a new reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define parameters of the new reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_create_reward" + }, + "examples": { + "Gift card credits": { + "value": { + "name": "Digital - Gift Card Reward", + "type": "CAMPAIGN", + "metadata": { + "Type": "Gift" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 3000 + } } - }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "L-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2013-10-26T00:00:00.000Z", - "expiration_date": "2025-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT2H" - } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description. Updated", - "start_date": "2013-10-26T00:00:00.000Z", - "expiration_date": "2025-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT2H" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "activity_duration_after_publishing": "P25D", - "vouchers_count": 2, - "active": true, - "metadata": { - "test": false - }, - "created_at": "2022-11-29T13:10:30.848Z", - "updated_at": "2022-11-29T14:08:30.655Z", - "category": "Lorem_Ipsum", - "creation_status": "MODIFYING", - "vouchers_generation_status": "MODIFYING", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b6152ce12414820dd", - "categories": [ - { - "id": "cat_0b6152ce12414820dd", - "name": "Lorem_Ipsum", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" } - ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P4M", - "rounding": { - "type": "CUSTOM", - "strategy": "END", - "unit": "MONTH", - "value": 1 + }, + "Discount Coupon": { + "value": { + "name": "Digital - Discount Coupon", + "type": "CAMPAIGN", + "metadata": { + "Type": "Discount" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + } + }, + "Loyalty Points": { + "value": { + "name": "Digital - Loyalty Points Reward", + "type": "CAMPAIGN", + "metadata": { + "Type": "Loyalty Points" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 100 + } + } + } + }, + "Pay with Points": { + "value": { + "name": "Pay with Points Reward", + "type": "COIN", + "metadata": { + "Type": "Coin" + }, + "parameters": { + "coin": { + "exchange_ratio": 900, + "points_ratio": 8000 + } } } }, - "object": "campaign" + "Material Reward": { + "value": { + "name": "Get a Comic Book", + "metadata": { + "Type": "Material" + }, + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } + }, + "stock": 2, + "attributes": { + "image_url": "https://www.website.com/img_fPHsk9Ob.png", + "description": "Archie's Series" + } + } + } } } } - } - } - } - } - }, - "delete": { - "operationId": "delete-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Loyalty Campaign", - "description": "This method permanently deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with the same name." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the id of the scheduled asynchronous action, informing you that your request has been accepted and the loyalty campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + }, + "responses": { + "200": { + "description": "Returns a reward object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "examples": { + "Material": { + "value": { + "id": "rew_Crmu3hu2FKZWZIML59AeAs1n", + "name": "Material Reward", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } + }, + "stock": "2", + "redeemed": null, + "attributes": { + "image_url": "https://www.website.com/img_fPH9oOb.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-25T11:20:58.172Z", + "updated_at": null, + "metadata": { + "Type": "Material" + }, + "object": "reward" + } + } + } } } } } } }, - "404": { - "description": "Returns an error indicating that the loyalty campaign with given ID was not found.", - "content": { - "application/json": { + "/v1/rewards/{rewardId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "rew_2erjvECLs92GYzKbak3QkyTV" + }, + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + } + ], + "get": { + "operationId": "get-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Get Reward", + "description": "Retrieve a reward by the reward ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a reward object if a valid identifier was provided. ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" + } + } + } }, - "examples": { - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer Loyalty Perks", - "request_id": "v-0ae2b0092f50c130c7", - "resource_id": "Summer Loyalty Perks", - "resource_type": "campaign" + "404": { + "description": "Not Found. When requesting a reward that has been deleted or does not exist, the resource will not be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkG", + "request_id": "v-0b8c77bcc890215e35", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkG", + "resource_type": "reward" + } + } + } } } } } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID of the loyalty program." - } - ], - "get": { - "operationId": "list-members", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Members", - "description": "Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty cards within a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_members" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "vouchers", - "vouchers": [ - { - "id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655", - "code": "0PmQ7JQI", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 0, - "balance": 0 + "put": { + "operationId": "update-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Update Reward", + "description": "Update the details of a reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define the parameters to be updated for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_update_reward" + }, + "examples": { + "Gift card credits": { + "value": { + "name": "Digital - Gift Card Reward", + "metadata": { + "Type": "Gift" }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA%2Fs6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa%2FYCnKkm63TRuX6OgGJoEggbKMg%2BwLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z%2Bz3B1jkALIbjtw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BhrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP%2BBfBtF%2BpyyQpxCeqbQuB%2FOuSnP%2Fnzec6n0n%2FgTb9%2BXcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ%3D%3D" + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 3000 } + } + } + }, + "Discount Coupon": { + "value": { + "name": "Digital - Discount Coupon", + "metadata": { + "Type": "Discount" }, - "is_referral_code": false, - "created_at": "2022-04-15T05:48:45.509Z", - "updated_at": "2022-07-01T00:01:57.860Z", - "holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10" + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + } + }, + "Loyalty points": { + "value": { + "name": "Digital - Loyalty Points Reward", + "metadata": { + "Type": "Loyalty Points" }, - "object": "voucher" - }, - { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 100 + } + } + } + }, + "Pay with Points": { + "value": { + "name": "Pay with Points Reward", + "metadata": { + "Type": "Coin" }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + "parameters": { + "coin": { + "exchange_ratio": 900, + "points_ratio": 8000 } + } + } + }, + "Material Reward": { + "value": { + "name": "Get a Comic Book", + "metadata": { + "Type": "Physical product" }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } }, - "publish": { + "stock": 2, + "attributes": { + "image_url": "https://www.website.com/img_fPH9.png", + "description": "Comic book" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an updated reward object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "examples": { + "Material": { + "value": { + "id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "name": "Get a Comic Book", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } + }, + "stock": "2", + "redeemed": null, + "attributes": { + "image_url": "https://www.website.com/img_fPH9.png", + "description": "Comic book" + }, + "created_at": "2022-08-25T10:00:12.794Z", + "updated_at": "2022-08-25T10:06:30.655Z", + "metadata": { + "Type": "Physical product" + }, + "object": "reward" + } + } + } + } + } + }, + "400": { + "description": "Returns an error if the balance parameter is not defined correctly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_balance" + }, + "examples": { + "Invalid Balance": { + "value": { + "code": 400, + "key": "invalid_balance", + "message": "Property 'parameters.campaign.balance' is invalid", + "details": "Property 'parameters.campaign.balance' must be greater than zero for campaign type: GIFT_VOUCHERS", + "request_id": "v-0b96d2b90dce48855f" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Delete Reward", + "description": "Delete a reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "400": { + "description": "Bad Request. Returns an error indicating that the reward with given ID is assigned to a resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_resource_in_use" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "resource_in_use", + "message": "Resource in use", + "details": "Resource reward with id rew_fcYALROsORec6cP0VBItCVfq is in use by reward_assignments with ids [rewa_5WV7H3y2lT3GGl03Xjw29IEc]", + "request_id": "v-0b8c7b967950216291", + "related_object_ids": [ + "rewa_5WV7H3y2lT3GGl03Xjw29IEc" + ], + "related_object_type": "reward_assignment" + } + } + } + } + } + }, + "404": { + "description": "Returns an error indicating that the reward with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", + "request_id": "v-0ae29895e8c6b7781a", + "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", + "resource_type": "reward" + } + } + } + } + } + } + } + } + }, + "/v1/rewards/{rewardId}/assignments": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + } + ], + "get": { + "operationId": "list-reward-assignments", + "tags": [ + "REWARDS API" + ], + "summary": "List Reward Assignments", + "description": "Retrieve reward assignments by the reward ID.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" + "data_ref": "data", + "data": [ + { + "id": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_wciTvaOfYmAa3EmIIW3QpXXZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 15 + } + }, + "created_at": "2022-08-17T08:13:02.507Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 20 + } + }, + "created_at": "2022-08-24T11:40:22.418Z", + "updated_at": null, + "object": "reward_assignment" + } + ], + "total": 2 + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the given reward is missing, does not exist or was deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "request_id": "v-0b95a68c678ad5c765", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "resource_type": "reward" + } } - ], - "total": 2 + } } } } } - } - } - } - }, - "post": { - "operationId": "add-member", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add Member", - "description": "This method assigns a loyalty card to a customer. It selects a [loyalty card](ref:get-voucher) suitable for publication, adds a publish entry, and returns the published voucher. \n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide details to whom the loyalty card should be assigned. \n\nYou can choose to either specify the exact loyalty card code that you want to publish from existin (non-assigned) codes, or choose not to specify a voucher code. If you choose not to specify a code in the request paylaod, then the system will choose the next available voucher code available to be assigned to a customer. \n\nYou can also include metadata in the request payload. This metadata will be assigned to the publication object, but will not be returned in the response to this endpoint. To see of publications (assignments of particular codes to customers) and publication metadata, use the [List Publications](ref:list-publications) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_member" - }, - "examples": { - "Using source ID": { - "value": { - "customer": "source_customer_1", - "metadata": { - "year": 2022 + }, + "post": { + "operationId": "create-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Create Reward Assignment", + "description": "Assigns a reward to a specified loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_create_reward_assignment" }, - "channel": "postman", - "voucher": "KpzbHUY5" + "examples": { + "Example": { + "value": { + "campaign": "camp_OTuGGP90PivbvROsRvfM65El", + "parameters": { + "loyalty": { + "points": 39 + } + } + } + } + } } - }, - "Using unique Voucherify assigned ID": { - "value": { - "customer": "cust_8KQmHxAERpgebYcFhSpZRr37", - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" + } + }, + "responses": { + "200": { + "description": "Returns a reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_cqD2XE5x8LcD2c1FLlvqikti", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_OTuGGP90PivbvROsRvfM65El", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 39 + } + }, + "created_at": "2022-08-24T13:44:42.610Z", + "updated_at": null, + "object": "reward_assignment" + } + } + } + } } }, - "Using source ID in object": { - "value": { - "customer": { - "source_id": "source_customer_1" - }, - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" + "400": { + "description": "Returns an error if request body parameters are missing.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_missing_param" + }, + "examples": { + "Missing Parameter": { + "value": { + "code": 400, + "key": "missing_param", + "message": "Missing required parameter", + "details": "Parameter 'parameters.loyalty' is required", + "request_id": "v-0b95c7f3684ad5f06d" + } + } + } + } } }, - "Using unique Voucherify assigned ID in object": { - "value": { - "customer": { - "id": "cust_8KQmHxAERpgebYcFhSpZRr37" - }, - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" + "404": { + "description": "Returns an error when creating a reward assignment for a reward that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "request_id": "v-0b95c0bedf46fcbe83", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "resource_type": "reward" + } + }, + "Missing Campaign": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id null", + "request_id": "v-0b95c68b12cad5eebb", + "resource_id": null, + "resource_type": "campaign" + } + } + } + } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the voucher object that was published to the customer provided in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0TxKw1bm0oZuS5lwA8526vze1OBMV1OH", - "code": "KpzbHUY5", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", - "category": "New Customers", - "category_id": "cat_0b6152ce12414820dc", - "categories": [ - { - "id": "cat_0b6152ce12414820dc", - "name": "New Customers", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" + }, + "409": { + "description": "Returns an error if a conflict is found, i.e. an assignment for the reward has already been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Duplicate Found": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated reward_assignment exists with id rewa_q1Ad955TUZS4nVIxplOw9pL3", + "request_id": "v-0b95c78daa06fcc6bb", + "resource_id": "rewa_q1Ad955TUZS4nVIxplOw9pL3", + "resource_type": "reward_assignment" + } } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 0, - "balance": 0 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": { - "Season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+hdZfzUaz448vIsyf7WpvXiDyqFbyw0+P5wMu12w3B5DyYwA7LCSK+Nr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk+ecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BhdZfzUaz448vIsyf7WpvXiDyqFbyw0%2BP5wMu12w3B5DyYwA7LCSK%2BNr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk%2BecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19VRXApVvZ9/ArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw+YeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19VRXApVvZ9%2FArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw%2BYeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-21T15:48:57.860Z", - "updated_at": "2022-11-21T15:49:36.671Z", - "holder_id": "cust_8KQmHxAERpgebYcFhSpZRr37", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/KpzbHUY5/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/KpzbHUY5/publications?page=1&limit=10" - }, - "object": "voucher" + } } } } } } }, - "400": { - "description": "Returns an error.", - "content": { - "application/json": { + "/v1/rewards/{rewardId}/assignments/{assignmentId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "rew_2erjvECLs92GYzKbak3QkyTV" }, - "examples": { - "No Voucher Suitable for Publication": { - "value": { - "code": 400, - "key": "no_voucher_suitable_for_publication", - "message": "Couldn't find any voucher suitable for publication", - "details": "Couldn't create new vouchers for publication", - "request_id": "v-0c086598620e6704dd" - } - }, - "Voucher already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_ZFjKHQD0d56eMkWkrotJaVbiMuXClRuM' has already been published", - "request_id": "v-0c086aaa7dc24ccfe0" + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + }, + { + "schema": { + "type": "string", + "example": "rewa_YkwQ5ezNYTQV2geodMVhTpy4" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique reward assignment ID." + } + ], + "put": { + "operationId": "update-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Update Reward Assignment", + "description": "Update the number of points needed to successfully redeem the reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define the number of points required to exchange for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_update_reward_assignment" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "loyalty": { + "points": 35 + } + } + } + } } } } - } - } - }, - "404": { - "description": "Returns an error if the voucher code that was specified in the request payload is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "responses": { + "200": { + "description": "Returns the updated reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 35 + } + }, + "created_at": "2022-08-24T11:40:22.418Z", + "updated_at": "2022-08-24T13:02:32.262Z", + "object": "reward_assignment" + } + } + } + } + } }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id Loyalty_Card", - "request_id": "v-0c086a26de424ccf2f", - "resource_id": "Loyalty_Card", - "resource_type": "voucher" + "404": { + "description": "Returns an error indicating that the reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76XI", + "request_id": "v-0b95b8760a4ad5dda1", + "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76XI", + "resource_type": "reward_assignment" + } + } + } } } } } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique code that identifies the loyalty card." - } - ], - "get": { - "operationId": "get-member-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member", - "description": "Retrieves the loyalty card with the given member ID (i.e. voucher code).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns loyalty card details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Program", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "delete": { + "operationId": "delete-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Delete Reward Assignment", + "description": "This method deletes a reward assignment for a particular reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the reward or reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", + "request_id": "v-0ae29f325e1027cde8", + "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", + "resource_type": "reward" + } }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_YkwQ5ezNYTQV2geodMVhTpy", + "request_id": "v-0ae2a0588b9027cf95", + "resource_id": "rewa_YkwQ5ezNYTQV2geodMVhTpy", + "resource_type": "reward_assignment" + } } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" + } } } } } - } - } - } - } - }, - "/v1/loyalties/members/{memberId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card code assigned to a particular customer." - } - ], - "get": { - "operationId": "get-member", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member", - "description": "Retrieve loyalty card with the given member ID (i.e. voucher code). \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-1). The URL was re-designed to allow you to retrieve loyalty card details without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns loyalty card details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Program", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + }, + "get": { + "operationId": "get-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve a reward assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + } + } + }, + "404": { + "description": "Returns an error indicating that the reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76X", + "request_id": "v-0b95b596e98ad5da24", + "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "resource_type": "reward_assignment" + } } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/activities": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "get": { - "operationId": "get-member-activities-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member Activities", - "description": "Retrieves the list of activities for the given member ID related to voucher and customer who is a holder of the voucher.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of event objects related to the loyalty card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_member_activities" - } - } - } - } - } - } - }, - "/v1/loyalties/members/{memberId}/activities": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "get": { - "operationId": "get-member-activities", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member Activities", - "description": "Retrieves a list of activities for the given loyalty card related to the loyalty and customer who is the holder of the loyalty card.\n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-activities-1). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of event objects related to the loyalty card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_member_activities" + "/v1/publication-object": { + "get": { + "operationId": "publication-object", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Publication Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Publication Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_obj_publication_object" + } + } + } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/balance": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { - "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "post": { - "operationId": "add-remove-loyalty-card-balance-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add or Remove Loyalty Card Balance", - "description": "This method adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the point adjustment along with the expiration mechanism.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" - }, - "examples": { - "Add points": { - "value": { - "points": 100, - "expiration_type": "CUSTOM_DATE", - "expiration_date": "2023-05-30" + "/v1/publications/create": { + "get": { + "operationId": "create-publication-1", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Create Publication", + "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet.\n> ❗️ Limited access\n>\n> Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a [dedicated endpoint](ref:create-publication). \n\n\n> 📘 Specifying the voucher to be published\n>\n> - In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign and in the query parameters specify the `campaign` without specifying the voucher.\n> - If you would like to publish a specific code from a specific campaign, then you need to provide the `campaign` and the `voucher` parameters.\n> - If you would like to publish a standalone voucher, then omit the campaign parameter and simply provide the `voucher` parameter. \n\n## Example Request \n```markdown Publication Query \n/publications/create?campaign=camp_T0bUgWGCAV6S0X3smH4MEboG&metadata[year]=2&metadata[Date]=2023-03-03&metadata[DateTime]=2023-03-03T14:06:08.311Z&metadata[Flag]=true&metadata[Number]=222&metadata[String]=stringy&metadata[ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&metadata[Object][payment][payment_tax]=9&metadata[Object][payment][payment_method]=Visa&metadata[Object][payment][payment_date]=2023-03-03&metadata[Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&metadata[Object][payment][payment_completed]=true&metadata[Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[source_id]=try-new-12&customer[name]=John%20Jimmy&customer[description]=This is testing the publication endpoint.&customer[email]=johnjimy2%40email.com&customer[phone]=%2B48%20123%20333%20333&customer[address][city]=Warsaw&customer[address][state]=Mazowieckie&customer[address][line_1]=4499%20Main%20St.&customer[address][line_2]=Blg%202%20APT%204&customer[address][country]=Poland&customer[address][postal_code]=122333&customer[birthday]=2222-01-22&customer[metadata][paid_bill]=true&customer[metadata][age]=22&customer[metadata][location]=Poland&customer[metadata][acquisition_date]=2022-09-09&customer[metadata][birth_date]=2023-03-20T18:44:19.215Z&customer[metadata][ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][location-unknown][city]=Katowice&customer[metadata][location-unknown][state]=slask&customer[metadata][location-unknown][number]=2&customer[metadata][location-unknown][date]=2034-09-11&customer[metadata][location-unknown][dateTime]=2023-03-20T18:44:19.215Z&customer[metadata][Object][payment][payment_date]=2023-03-03&customer[metadata][Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&customer[metadata][Object][payment][payment_completed]=true&customer[metadata][Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][Object][payment][payment_tax]=9&customer[metadata][Object][payment][payment_method]=Visa```", + "parameters": [ + { + "schema": { + "type": "string", + "example": "custom_publication_source_id" + }, + "in": "query", + "name": "source_id", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." + }, + { + "schema": { + "type": "string", + "example": "PROMO-1LwwzYI" + }, + "in": "query", + "name": "voucher", + "description": "Code of voucher being published. If there is a particular code that you would like to publish, then you can use this parameter to specify the code. You can omit this parameter if you would like to publish a random code from a campaign, where the campaign is in `AUTO_UPDATE` mode." + }, + { + "name": "metadata", + "in": "query", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object" + } + }, + { + "name": "customer", + "in": "query", + "required": true, + "description": "Specify the customer who is to receive a code. You can either directly provide the respective ID's as strings or provide them in the form of an object.", + "style": "deepObject", + "explode": true, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_customer" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ] } }, - "Deduct points": { - "value": { - "points": -100 + { + "name": "campaign", + "in": "query", + "required": true, + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. You can use this parameter without having to specify a particular `voucher` code if the campaign is in `AUTO_UPDATE` mode. This parameter not required for a standalone code, however, if you intend to use a code from a campaign, then this parameter is required.", + "style": "deepObject", + "explode": true, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_campaign" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_campaign_id" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_campaign_name" + } + ] } } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a balance object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a publication object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_create_publication" + }, + "examples": { + "Example": { + "value": { + "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", + "object": "publication", + "created_at": "2022-09-30T16:30:32.924Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "pub_source_customer_5", + "metadata": { + "year": 2022 + }, + "channel": "myown", + "source_id": "publication_source_ID_10", + "result": "SUCCESS", + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "voucher": { + "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", + "code": "cEsMn0uA", + "campaign": "Test - Discount Effect - Amount - Items", + "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-30T16:30:32.956Z", + "updated_at": null, + "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "vouchers_id": [ + "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" + ] + } + } + } + } + } }, - "examples": { - "Add balance": { - "value": { - "points": -100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + "400": { + "description": "Returns an error if the query parameters are incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Missing customer": { + "value": { + "code": 400, + "key": "invalid_query_params", + "message": "Invalid query params", + "details": "Query should have required property 'customer'", + "request_id": "v-0c8b6423f3c80ed3e4" + } + }, + "Missing vouchers": { + "value": { + "code": 400, + "key": "missing_vouchers", + "message": "Missing vouchers", + "details": "Either Campaign or Voucher is required" + } + }, + "Voucher cannot be published": { + "value": { + "code": 400, + "key": "voucher_cannot_be_published", + "message": "Voucher cannot be published", + "details": "Voucher cannot be published. Customer already joined program.", + "request_id": "v-0c8b763544080efed2" + } + }, + "Voucher already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_vM7vQZmgV86k0wuz05cFAOfarj4s8BQE' has already been published", + "request_id": "v-0c8baebc67c80e97a0" + } + }, + "Duplicate source ID": { + "value": { + "code": 400, + "key": "duplicate_source_id", + "message": "Duplicate source_id", + "details": "Publication with source_id: 'test_publication_source_id_test_voucher' already exists", + "request_id": "v-0c8b7e8f78c80e94a2" + } + }, + "Too many vouchers requested": { + "value": { + "code": 400, + "key": "too_many_vouchers_requested", + "message": "Too many vouchers requested", + "details": "Only up to 1 can be published", + "request_id": "v-0c8bac9a25c80e912d" + } + }, + "Metadata validation failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "ImageURL: must be a URL pointing to JPG/JPEG or PNG resource (actual value is 'http.com')", + "request_id": "v-0c8bcbd742080ee807" + } + } } } - }, - "Deduct balance": { - "value": { - "points": -100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + } + }, + "403": { + "description": "Returns an error if you don't have a specific credentials set up. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_integration_key" + }, + "examples": { + "Example": { + "value": { + "code": 403, + "message": "Forbidden", + "key": "integration_api_key_required" + } + } + } + } + } + }, + "404": { + "description": "Returns an error if a resource is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Resource not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_xqA7DGj5eYPHg6PHVKwYRWiA", + "request_id": "v-0c8b6b35294af6f192", + "resource_id": "cust_xqA7DGj5eYPHg6PHVKwYRWiA", + "resource_type": "customer" + } + } } } } @@ -67831,100 +54731,523 @@ } } }, - "400": { - "description": "Returns an error if the expiration date was defined incorrectly in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "/v1/publications": { + "get": { + "operationId": "list-publications", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "List Publications", + "description": "Retrieve a list of publications. To return a **particular** publication, you can use the `source_id` query parameter and provide the `source_id` of the publication you are looking for specifically.\n\n## Pagination\n\n\n> 🚧 Important!\n>\n> If you want to scroll through a huge set of records, it is recommended to use the [Exports API](ref:create-export). This API will return an error `page_over_limit` if you reach a page above 1000.\n\n## Filter Query\n\nThe `filters` query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:\n\n\n```url\nfilters[][conditions][][]=\n```\n\n### Operators:\n\n\n```\n \"$in\"\n \"$not_in\"\n \"$is\"\n \"$is_not\"\n \"$has_value\"\n \"$is_unknown\"\n \"$contains\"\n \"$starts_with\"\n \"$ends_with\"\n \"$more_than\"\n \"$less_than\"\n \"$more_than_equal\"\n \"$less_than_equal\"\n```\n\n### Examples\n\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR\n```", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at", + "channel", + "-channel" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign", + "description": "Filters by a given campaign name." + }, + { + "schema": { + "type": "string", + "example": "cust_jl33V8ZDQJp4goU1z8DmFioo" + }, + "in": "query", + "name": "customer", + "description": "Filters by a unique customer ID." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "voucher", + "description": "Filters by a given voucher code." + }, + { + "schema": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ] + }, + "in": "query", + "name": "result", + "description": "Filters by a publication result." + }, + { + "schema": { + "type": "string", + "enum": [ + "discount", + "loyalty", + "lucky_draw" + ] + }, + "in": "query", + "name": "voucher_type", + "description": "Filters by a voucher type." + }, + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "is_referral_code", + "description": "This filter works only for the `true` option. If set to `true`, the query returns only publications of codes from referral campaigns. " + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "filters", + "description": "Allows for combining the filters mentioned in the endpoint description." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "source_id", + "description": "Using this endpoint with a particular publication `source_id`, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of publications you’ve previously created with [create publication](ref:create-publication) or implicitly by the distribution manager. The publications are returned in sorted order, with the most recent ones appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_list_publications" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "publications", + "publications": [ + { + "id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu", + "object": "publication", + "created_at": "2022-09-28T13:31:23.522Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "cindy.jones@email.com", + "metadata": { + "distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei", + "source_type": "distribution", + "source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei" + }, + "channel": "Automation", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Cindy Jones", + "email": "cindy.jones@email.com", + "source_id": "cindy.jones@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "voucher": { + "code": "FNV5IrtY", + "object": "voucher", + "campaign": "Loyalty Campaign", + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "is_referral_code": false + }, + "vouchers_id": [ + "v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD" + ] + }, + { + "id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX", + "object": "publication", + "created_at": "2022-09-28T13:31:02.766Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "sandy.jones@email.com", + "metadata": {}, + "channel": "voucherify-website", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Sandy Jones", + "email": "sandy.jones@email.com", + "source_id": "sandy.jones@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "voucher": { + "code": "Voucher-1", + "object": "voucher", + "campaign": null, + "discount": { + "type": "AMOUNT", + "amount_off": 200, + "amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)", + "effect": "APPLY_TO_ORDER" + }, + "is_referral_code": false + }, + "vouchers_id": [ + "v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu" + ] + }, + { + "id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV", + "object": "publication", + "created_at": "2022-09-13T06:15:08.249Z", + "customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G", + "tracking_id": "1", + "metadata": {}, + "channel": "voucherify-website", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_ur1hIPGflbaAe14mLlLdon3G", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "1", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "voucher": { + "code": "GIFT-WOZaK5YF1Fs87tAX", + "object": "voucher", + "campaign": "Gift Cards", + "gift": { + "amount": 0, + "balance": 0 + }, + "is_referral_code": false + }, + "vouchers_id": [ + "v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc" + ] + } + ], + "total": 3 + } + } + } + } + } }, - "examples": { - "Invalid expiration date": { - "value": { - "code": 400, - "key": "invalid_expiration_date", - "message": "Invalid Expiration Date", - "details": "Expiration date cannot be set in the past", - "request_id": "v-0c118b1611424ca899" + "400": { + "description": "Returns an error if you request a page higher than 1000.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "page_over_limit", + "message": "Listing resource above 1000 page is not supported", + "details": "Property .page cannot be higher than 1000", + "request_id": "v-0bc2a39574c61362af" + } + } + } } } } } - } - } - } - } - }, - "/v1/loyalties/members/{memberId}/balance": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "post": { - "operationId": "add-remove-loyalty-card-balance", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add or Remove Loyalty Card Balance", - "description": "This method gives adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:add-remove-loyalty-card-balance-1). The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the point adjustment along with the expiration mechanism.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + }, + "post": { + "operationId": "create-publication", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Create Publication", + "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "join_once", + "description": "Through this flag, you can control if a particular person gets only one and always the same code even if the app sends multiple publication requests. It means that if you have a referral program, a referrer is assigned only to one code if an integration sends publication requests more than once for the same customer." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the publication parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_req_create_publication" + }, + "examples": { + "Example - Specific Voucher": { + "value": { + "campaign": { + "name": "campaign-name" + }, + "customer": { + "source_id": "source-id", + "Name": "Customer Name", + "email": "customer email" + }, + "voucher": "voucher-code", + "metadata": { + "key": "value" + } + } + }, + "Example - Random Voucher": { + "value": { + "campaign": { + "name": "campaign-name", + "count": 1 + }, + "customer": { + "source_id": "source-id", + "Name": "Customer Name", + "email": "customer email" + }, + "voucher": "voucher-code", + "metadata": { + "key": "value" + } + } + }, + "Example 3": { + "value": { + "source_id": "publication_source_ID_10", + "campaign": "Test - Discount Effect - Amount - Items", + "channel": "myown", + "customer": { + "source_id": "pub_source_customer_5", + "name": "Bob Jones", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1901-12-01" + }, + "metadata": { + "year": 2022 + } + } + } + } + } + } }, - "examples": { - "Subtract points": { - "value": { - "points": -100 + "responses": { + "200": { + "description": "Returns a publication object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_create_publication" + }, + "examples": { + "Example": { + "value": { + "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", + "object": "publication", + "created_at": "2022-09-30T16:30:32.924Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "pub_source_customer_5", + "metadata": { + "year": 2022 + }, + "channel": "myown", + "source_id": "publication_source_ID_10", + "result": "SUCCESS", + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "voucher": { + "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", + "code": "cEsMn0uA", + "campaign": "Test - Discount Effect - Amount - Items", + "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-30T16:30:32.956Z", + "updated_at": null, + "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "vouchers_id": [ + "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" + ] + } + } + } + } } }, - "Add Points": { - "value": { - "points": 100, - "expiration_type": "CUSTOM_DATE", - "expiration_date": "2023-05-30" + "400": { + "description": "Returns an error if a publication with the same source ID already exists in the system or some request body parameter is missing.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Missing Parameters": { + "value": { + "code": 400, + "key": "missing_vouchers", + "message": "Missing vouchers", + "details": "Either Campaign or Voucher is required" + } + }, + "Already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_Y5P4UZ1yilkiYOIJmAAgWazUi1wfkNwF' has already been published", + "request_id": "v-0bc40bb800d5651137" + } + }, + "Duplicate Source ID": { + "value": { + "code": 400, + "key": "duplicate_source_id", + "message": "Duplicate source_id", + "details": "Publication with source_id: 'publication_source_ID_1' already exists", + "request_id": "v-0bc40bf81555651191" + } + } + } + } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a balance object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, - "examples": { - "Subtract Points": { - "value": { - "points": 100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + "404": { + "description": "Returns an error if a resource is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id 1", + "request_id": "v-0bc40546e5d56508e5", + "resource_id": "1", + "resource_type": "campaign" + } + } } } } @@ -67932,1367 +55255,2113 @@ } } }, - "400": { - "description": "Returns an error if the expiration date was specified incorrectly in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .expiration_date cannot be recognized as a ISO-8601 compliant date", - "request_id": "v-0c118c6f7c0e6751ab" + "/v1/validation-object": { + "get": { + "operationId": "validation-object", + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validation Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Object", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher" + } + ] + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/transfers": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination)." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination)." - } - ], - "post": { - "operationId": "transfer-points", - "tags": [ - "LOYALTIES API" - ], - "summary": "Transfer Loyalty Points", - "description": "Transfer points between different loyalty cards. You need to provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters in the URL. In the request body, you provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_transfer_loyalty_points" - }, - "examples": { - "Example": { - "value": [ - { - "code": "0PmQ7JQI", - "points": 1 - }, - { - "code": "kCeufB8i", - "points": 1 - } - ] - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a loyalty card object for the loaded loyalty card, ie. the one that that points were transferred to from the other cards(s).", - "content": { - "application/json": { + "/v1/vouchers/{code}/validate": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Example": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Proportional Earning Rules", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13441, - "balance": 13141, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 0 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + "type": "string", + "example": "Testing7fjWdr" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A code that identifies the voucher." + } + ], + "post": { + "operationId": "validate-voucher", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Voucher [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys. \n\n\n> ❗️ Important \n>\n> This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](ref:stackable-discounts-api). The stacking discounts API lets you validate up to 5 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.\n\n#### Gift Vouchers - validate Gift Card and control amount to redeem\nVoucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition. \n\nThis operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.\n\nIf a validation session is established, then the session details will be returned as well. Read more about sessions [here](doc:locking-validation-session).\n\nVoucher validation might fail because of one of these reasons:\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of start date - expiration date time frame\n* `voucher is disabled` - learn more about a [disabled voucher](ref:disable-voucher)\n* `customer does not match segment rules` - learn more [customer tracking](doc:customers#customer-tracking) \n* `order does not match validation rules` - learn more about [validation rules](doc:validation-rules)", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher validation context using the request body parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_voucher" + }, + "examples": { + "Free Shipping": { + "value": { + "customer": { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M" + }, + "order": { + "items": [ + { + "product_id": "prod_0ba621bae5d39762ce", + "quantity": "1" + }, + { + "product_id": "prod_0b661d404787ec6d3b", + "quantity": "1", + "price": 3100 + } + ] + } } }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-28T17:58:25.607Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + "Multiple Product Variants": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" + }, + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP" + } + } }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + "Unit - Add order items": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" + }, + "order": { + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8" + }, + "session": { + "type": "LOCK", + "ttl_unit": "NANOSECONDS", + "ttl": 1 + } + } }, - "object": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/transactions": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." - } - ], - "get": { - "operationId": "list-loyalty-card-transactions-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Card Transactions", - "description": "Retrieve transaction data related to point movements for a specific loyalty card.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty card transaction objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dd3c2e392f78613", - "source_id": "20230317_transfer_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": "Transferring points to card", - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1396, - "object": "balance", - "points": -1, - "balance": 1396, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" + "Fixed": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" } + ] + }, + "session": { + "type": "LOCK" + } + } + }, + "Percentage": { + "value": { + "customer": { + "source_id": "your_customer_source_ID", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1102, - "balance": 1102, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 102 + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1960-12-01" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" }, - "is_referral_code": false - } + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" + } + ] }, - "related_transaction_id": "vtx_0c9dd3c2e392f78614", - "created_at": "2023-03-17T16:20:33.807Z" - }, - { - "id": "vtx_0c9dd2527696ba081b", - "source_id": "20230317_add_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Adding points to card", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1397, - "object": "balance", - "points": 100, - "balance": 1397, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" + "session": { + "type": "LOCK", + "key": "your_custom_key", + "ttl_unit": "NANOSECONDS", + "ttl": 1 + } + } + }, + "Amount": { + "value": { + "customer": { + "source_id": "your_customer_source_ID", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1960-12-01" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" } + ], + "metadata": { + "currency": "EUR" } }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:14:16.524Z" - }, - { - "id": "vtx_0c9dd1ce1d403f4204", - "source_id": "20230317_subtract_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Subtracting points from card", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1297, - "object": "balance", - "points": -1, - "balance": 1297, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" + "session": { + "type": "LOCK", + "key": "your_custom_key", + "ttl_unit": "NANOSECONDS", + "ttl": 1 + } + } + }, + "Loyalty Card": { + "value": { + "order": { + "items": [ + { + "product_id": "prod_0bd76fc58f8038b043", + "quantity": "1" + }, + { + "product_id": "prod_0bd76bd0e204542738", + "quantity": "1" } + ] + }, + "reward": { + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "points": 10 + } + } + }, + "Gift Card": { + "value": { + "customer": { + "source_id": "286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d" + }, + "order": { + "amount": 1000, + "metadata": { + "currency": "USD" + } + }, + "gift": { + "credits": 2 + }, + "metadata": { + "location_id": [ + "L1" + ] + } + } + }, + "Referral Code": { + "value": { + "customer": { + "source_id": "earlybirdcust" + }, + "order": { + "amount": 20000, + "metadata": { + "currency": "USD" } }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:12:00.981Z" + "metadata": { + "location_id": [ + "L1" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the request body.", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + } + ] + }, + "examples": { + "False": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Gift Card cannot be redeemed because of violated validation rules: val_wvipKm99CJuL", + "request_id": "v-0bccef7a9585cf63b6" + }, + "tracking_id": "track_ZGPtmYcM+Mw=", + "code": "vBQvYFEM", + "metadata": {} + } }, - { - "id": "vtx_0c9c21df658d03ce3f", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "Automation", - "reason": null, - "type": "POINTS_ACCRUAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1298, - "object": "balance", - "points": 200, - "balance": 1298, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Free Shipping": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "order": { - "id": "ord_QZEKPzYATFjGoos4DonMg0fd", - "source_id": "s" + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "event": { - "id": "evcus_0c9c21def34e3c05bf", - "type": "customer.order.paid" + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "order": { + "amount": 4300, + "total_amount": 4300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0ba621bae5d39762ce", + "quantity": 1, + "amount": 1200, + "price": 1200, + "subtotal_amount": 1200, + "product": { + "id": "prod_0ba621bae5d39762ce", + "source_id": "arabica_plus", + "name": "Arabica Coffee 250g", + "price": 1200 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d404787ec6d3b", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0b661d404787ec6d3b", + "source_id": "7717f389-4621-4c7a-a6db-d4acfe051a97", + "name": "Kate Moss by Mario Testino" + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "earning_rule": { - "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", - "source": { - "banner": "Order paid" + "code": "Test - Discount - Free Shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-16T08:44:52.333Z" + }, + "metadata": {} + } }, - { - "id": "vtx_0c9b09673f8a862a51", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REFUND", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 1000, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Multiple Product Varients": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "redemption": { - "id": "r_0c9b08fe4b80897849" + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", + "created_at": "2022-09-21T13:09:25.773Z", + "updated_at": "2022-09-21T13:09:27.139Z", + "status": "PAID", + "amount": 237300, + "initial_amount": 28000, + "discount_amount": 8400, + "items_discount_amount": 209300, + "total_discount_amount": 217700, + "total_amount": 19600, + "items_applied_discount_amount": 209300, + "total_applied_discount_amount": 209300, + "items": [ + { + "object": "order_item", + "source_id": "A0E20000000295J", + "related_object": "sku", + "product_id": "prod_0b661d31134b299cc2", + "quantity": 1, + "amount": 9500, + "price": 9500, + "subtotal_amount": 9500, + "product": { + "id": "prod_0b661d31134b299cc2", + "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", + "name": "Keychain D‘Amico" + }, + "sku": { + "id": "sku_0b661d6265cb29ae52", + "source_id": "A0E20000000295J", + "sku": "Keychain D‘Amico", + "metadata": {}, + "price": 9500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000EAT6", + "related_object": "sku", + "quantity": 1, + "amount": 18500, + "price": 18500, + "subtotal_amount": 18500, + "product": { + "name": "Jogging pants Paolo Pecora light grey" + }, + "sku": { + "sku": "Jogging pants Paolo Pecora light grey", + "metadata": {} + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f7", + "quantity": 3, + "discount_quantity": 3, + "initial_quantity": 0, + "amount": 89700, + "discount_amount": 89700, + "initial_amount": 0, + "applied_discount_amount": 89700, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f7", + "source_id": "M0E20000000ELDG", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f6", + "quantity": 4, + "discount_quantity": 4, + "initial_quantity": 0, + "amount": 119600, + "discount_amount": 119600, + "initial_amount": 0, + "applied_discount_amount": 119600, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f6", + "source_id": "M0E20000000ELDF", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bb9c69ca9d5a364b2": { + "date": "2022-09-21T13:09:25.799Z", + "related_object_type": "redemption", + "related_object_id": "r_0bb9c69ca9d5a364b2", + "stacked": [ + "r_0bb9c69ca9d5a364b3", + "r_0bb9c69ca9d5a364b4" + ] + } + } }, - "rollback": { - "id": "rr_0c9b0967244a862a33" + "code": "Test - Discount - Unit - Multiple - Product Variants", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "effect": "ADD_MISSING_ITEMS", + "unit_off": 3, + "unit_type": "sku_0b661e41fc8d35a8f7", + "sku": { + "id": "sku_0b661e41fc8d35a8f7", + "source_id": "M0E20000000ELDG", + "sku": "Casual jacket Michael Kors beige" + }, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + } + }, + { + "effect": "ADD_NEW_ITEMS", + "unit_off": 4, + "unit_type": "sku_0b661e41fc8d35a8f6", + "sku": { + "id": "sku_0b661e41fc8d35a8f6", + "source_id": "M0E20000000ELDF", + "sku": "Casual jacket Michael Kors beige" + }, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + } + } + ] }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:19:29.149Z" + "metadata": {} + } }, - { - "id": "vtx_0c9b08fe530089785c", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REDEMPTION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": -1000, - "balance": 98, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Unit - Add order items": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "redemption": { - "id": "r_0c9b08fe4b80897849" + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "ssn_K7DV3RbAGNCRVrPNZxJfld3FdwAQwOGl", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:17:41.708Z" - }, - { - "id": "vtx_0c9b074afed3b30e4b", - "source_id": "20230309_add_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer purchased points at kiosk.", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 100, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:10:15.917Z" - }, - { - "id": "vtx_0c9b073072408969d1", - "source_id": "20230309_subtract_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer used points to obtain tickets.", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 998, - "object": "balance", - "points": -1, - "balance": 998, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:09:48.735Z" - }, - { - "id": "vtx_0c9afe802593b34b80", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": null, - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 999, - "object": "balance", - "points": -1, - "balance": 999, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", + "created_at": "2022-09-21T13:09:25.773Z", + "updated_at": "2022-09-21T13:09:27.139Z", + "status": "PAID", + "amount": 117700, + "initial_amount": 28000, + "discount_amount": 8400, + "items_discount_amount": 89700, + "total_discount_amount": 98100, + "total_amount": 19600, + "items_applied_discount_amount": 89700, + "total_applied_discount_amount": 89700, + "items": [ + { + "object": "order_item", + "source_id": "A0E20000000295J", + "related_object": "sku", + "product_id": "prod_0b661d31134b299cc2", + "quantity": 1, + "amount": 9500, + "price": 9500, + "subtotal_amount": 9500, + "product": { + "id": "prod_0b661d31134b299cc2", + "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", + "name": "Keychain D‘Amico" + }, + "sku": { + "id": "sku_0b661d6265cb29ae52", + "source_id": "A0E20000000295J", + "sku": "Keychain D‘Amico", + "metadata": {}, + "price": 9500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000EAT6", + "related_object": "sku", + "quantity": 1, + "amount": 18500, + "price": 18500, + "subtotal_amount": 18500, + "product": { + "name": "Jogging pants Paolo Pecora light grey" + }, + "sku": { + "sku": "Jogging pants Paolo Pecora light grey", + "metadata": {} + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f8", + "quantity": 3, + "discount_quantity": 3, + "initial_quantity": 0, + "amount": 89700, + "discount_amount": 89700, + "initial_amount": 0, + "applied_discount_amount": 89700, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bb9c69ca9d5a364b2": { + "date": "2022-09-21T13:09:25.799Z", + "related_object_type": "redemption", + "related_object_id": "r_0bb9c69ca9d5a364b2", + "stacked": [ + "r_0bb9c69ca9d5a364b3", + "r_0bb9c69ca9d5a364b4" + ] + } } }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1001, - "balance": 1001, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 1 + "code": "Test - Discount - Unit - Add new order items", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 3, + "unit_type": "sku_0b661e41fc8d35a8f8", + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige" }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9afe802593b34b81", - "created_at": "2023-03-15T11:31:51.062Z" - } - ], - "has_more": false - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/members/{memberId}/transactions": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." - } - ], - "get": { - "operationId": "list-loyalty-card-transactions", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Card Transactions", - "description": "Retrieve transaction data related to point movements for a specific loyalty card.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty card transaction objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dd3c2e392f78613", - "source_id": "20230317_transfer_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": "Transferring points to card", - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1396, - "object": "balance", - "points": -1, - "balance": 1396, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" } }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1102, - "balance": 1102, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 102 - }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9dd3c2e392f78614", - "created_at": "2023-03-17T16:20:33.807Z" + "metadata": {} + } }, - { - "id": "vtx_0c9dd2527696ba081b", - "source_id": "20230317_add_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Adding points to card", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1397, - "object": "balance", - "points": 100, - "balance": 1397, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:14:16.524Z" + "Fixed": { + "value": { + "valid": true, + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "strict": false, + "price": 2000, + "price_formula": "IF(ORDER_AMOUNT > 400;0;20)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "products_collection", + "id": "pc_2KWKXn09Dk8neCfymqd4xOq8", + "strict": false, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "products_collection", + "id": "pc_x7HELQo52g2uI6nDuuOTRjAW", + "strict": false, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + } + ], + "total": 7, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "ssn_u8rvi3Ac70S5ZRELWrxYsR2bnolpVWNg", + "type": "LOCK", + "ttl": 7, + "ttl_unit": "DAYS" + }, + "order": { + "amount": 46500, + "items_discount_amount": 9300, + "total_discount_amount": 9300, + "total_amount": 37200, + "items_applied_discount_amount": 9300, + "total_applied_discount_amount": 9300, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "discount_amount": 1300, + "applied_discount_amount": 1300, + "price": 6500, + "subtotal_amount": 5200, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "discount_amount": 600, + "applied_discount_amount": 600, + "price": 6000, + "subtotal_amount": 5400, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "discount_amount": 2000, + "applied_discount_amount": 2000, + "price": 2000, + "subtotal_amount": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 5000, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "discount_amount": 4400, + "applied_discount_amount": 4400, + "price": 11000, + "subtotal_amount": 17600, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "SPENDMOREGETMORE-DaIXFJvn", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "metadata": { + "shoutout": "Order more than 200€ to get 10% off pants, more than 300€ to get 20% off sweaters, and more than 400€ to get free shipping." + }, + "campaign": "SPENDMOREGETMORE", + "campaign_id": "camp_Nwb2mppeDTtk23s1FVo6riwp" + } }, - { - "id": "vtx_0c9dd1ce1d403f4204", - "source_id": "20230317_subtract_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Subtracting points from card", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1297, - "object": "balance", - "points": -1, - "balance": 1297, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Voucher expired": { + "value": { + "valid": false, + "reason": "voucher expired", + "error": { + "code": 400, + "key": "voucher_expired", + "message": "voucher expired", + "details": "EarlyBird-tB6zCApA", + "request_id": "v-0be43067028abb6ca8" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "code": "EarlyBird-tB6zCApA", + "metadata": { + "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:12:00.981Z" + } }, - { - "id": "vtx_0c9c21df658d03ce3f", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "Automation", - "reason": null, - "type": "POINTS_ACCRUAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1298, - "object": "balance", - "points": 200, - "balance": 1298, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Percentage": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "session": { + "key": "your_custom_key", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" }, "order": { - "id": "ord_QZEKPzYATFjGoos4DonMg0fd", - "source_id": "s" + "amount": 46500, + "discount_amount": 4650, + "total_discount_amount": 4650, + "total_amount": 41850, + "applied_discount_amount": 4650, + "total_applied_discount_amount": 4650, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "EarlyBird-tB6zCApA", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 10 }, - "event": { - "id": "evcus_0c9c21def34e3c05bf", - "type": "customer.order.paid" + "expiration_date": "2022-10-29T00:00:00.000Z", + "metadata": { + "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." }, - "earning_rule": { - "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", - "source": { - "banner": "Order paid" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-16T08:44:52.333Z" + "campaign": "Webinar - Early Bird Scenario", + "campaign_id": "camp_z1g3iFqQe5qiZ9TTYFVpMwC0" + } }, - { - "id": "vtx_0c9b09673f8a862a51", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REFUND", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 1000, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Amount": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "session": { + "key": "your_custom_key", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" }, "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null + "amount": 46500, + "discount_amount": 1000, + "total_discount_amount": 1000, + "total_amount": 45500, + "applied_discount_amount": 1000, + "total_applied_discount_amount": 1000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } + } + ], + "metadata": { + "currency": "EUR" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "redemption": { - "id": "r_0c9b08fe4b80897849" + "code": "PAYINEUROS", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 1000 + }, + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + } + } + }, + "Loyalty points exceeded": { + "value": { + "valid": false, + "reason": "loyalty card points exceeded", + "error": { + "code": 400, + "key": "loyalty_card_points_exceeded", + "message": "loyalty card points exceeded", + "details": "LOYALTY-CARD-ng3Kb9tM", + "request_id": "v-0be434ae35cabb018a" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "LOYALTY-CARD-ng3Kb9tM", + "metadata": {} + } + }, + "Loyalty Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "order": { + "amount": 14500, + "discount_amount": 50, + "total_discount_amount": 50, + "total_amount": 14450, + "applied_discount_amount": 50, + "total_applied_discount_amount": 50, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bd76fc58f8038b043", + "quantity": 1, + "amount": 8500, + "price": 8500, + "subtotal_amount": 8500, + "product": { + "id": "prod_0bd76fc58f8038b043", + "source_id": "webinar_BF_sweater_yellow", + "name": "Yellow Sweater", + "price": 8500 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bd0e204542738", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "rollback": { - "id": "rr_0c9b0967244a862a33" + "code": "LOYALTY-CARD-ng3Kb9tM", + "loyalty": { + "points_cost": 10 }, "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:19:29.149Z" + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy", + "points": 10 + }, + "metadata": {}, + "campaign": "Loyalty Campaign", + "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" + } }, - { - "id": "vtx_0c9b08fe530089785c", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REDEMPTION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": -1000, - "balance": 98, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Voucher disabled": { + "value": { + "valid": false, + "reason": "voucher is disabled", + "error": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "GIFT-CARD-kW4aEsfB", + "request_id": "v-0be43817d7121a437d" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "GIFT-CARD-kW4aEsfB", + "metadata": {} + } + }, + "Gift Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null + "amount": 1000, + "discount_amount": 2, + "total_discount_amount": 2, + "total_amount": 998, + "applied_discount_amount": 2, + "total_applied_discount_amount": 2, + "metadata": { + "currency": "USD" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "redemption": { - "id": "r_0c9b08fe4b80897849" + "code": "GIFT-CARD-kW4aEsfB", + "gift": { + "amount": 32000, + "balance": 21500, + "effect": "APPLY_TO_ORDER" }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:17:41.708Z" - }, - { - "id": "vtx_0c9b074afed3b30e4b", - "source_id": "20230309_add_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer purchased points at kiosk.", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 100, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:10:15.917Z" + "metadata": {}, + "campaign": "Gift Card Campaign", + "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" + } }, - { - "id": "vtx_0c9b073072408969d1", - "source_id": "20230309_subtract_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer used points to obtain tickets.", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 998, - "object": "balance", - "points": -1, - "balance": 998, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:09:48.735Z" + "Cannot be redeemed by referrer": { + "value": { + "valid": false, + "reason": "voucher cannot be redeemed by referrer", + "error": { + "code": 400, + "key": "referrer_not_permitted_to_redeem", + "message": "voucher cannot be redeemed by referrer", + "details": "REFERRAL-CODE-OxBakPYf", + "request_id": "v-0be43a8a110abb1bd3" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "REFERRAL-CODE-OxBakPYf", + "metadata": {} + } }, - { - "id": "vtx_0c9afe802593b34b80", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": null, - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 999, - "object": "balance", - "points": -1, - "balance": 999, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } + "Referral Code": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1001, - "balance": 1001, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 1 + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", + "order": { + "amount": 20000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 14000, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "metadata": { + "currency": "USD" }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9afe802593b34b81", - "created_at": "2023-03-15T11:31:51.062Z" + "referrer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": null, + "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "order" + }, + "code": "REFERRAL-CODE-OxBakPYf", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 30 + }, + "metadata": {}, + "campaign": "Referral Campaign", + "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" + } } - ], - "has_more": false - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/members/{memberId}/transactions/export": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." - } - ], - "post": { - "operationId": "export-loyalty-card-transactions", - "tags": [ - "LOYALTIES API" - ], - "summary": "Export Loyalty Card Transactions", - "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters and filters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] + } } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", - "object": "export", - "created_at": "2023-03-21T13:50:43.286Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "LOYALTY-CARD-2IAoDNF" - ] + }, + "400": { + "description": "Returns an error if request body is missing parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error" + }, + "examples": { + "Missing reward": { + "value": { + "code": 400, + "key": "missing_reward", + "message": "Missing reward", + "details": "A reward is required when redeeming a LOYALTY_CARD", + "request_id": "v-0bcb925c6d90f7f8fc", + "error": { + "message": "Missing reward = please add one." } } - } - }, - "result": null, - "user_id": null - } - }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] + }, + "Missing Parameter": { + "value": { + "code": 400, + "key": "missing_order_items_amount", + "message": "Missing applicable order items", + "details": "At least one applicable order item with amount is required to redeem this GIFT_VOUCHER", + "request_id": "v-0bcccfd04085cf2540", + "error": { + "message": "Request should contain an amount for the item." } } + }, + "Metadata Validation Failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "location_id: must be an array, and every element: must be a string, must be equal to one of L1,L2,L3 (actual value is 'L1')", + "request_id": "v-0bcced27715305d3fa" + } } - }, - "result": null, - "user_id": null + } } } } } } }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "/client/v1/validate": { + "get": { + "operationId": "validate-voucher-client-side", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Voucher (client-side) [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.\n\n> ❗️ Specifying gift credits and loyalty points\n>\n> This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount. \n\n### Set customer identity (optional)\n\nVoucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.\n\nVoucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.\n\nThe returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `/validate` request, and the version encrypted and returned as part of the validation request.\n\n### Sample workflow\n\nCustomer tracking workflow in a nutshell:\n\n**Client-side:**\n * A customer visits your website.\n * A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.\n\n**Backend:**\n * Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.\n * A customer object is created and within the redemption response, you get a customer `id`.\n * You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.\n \nA customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](ref:get-customer). \n\n\n\n> 📘 Customer identifier\n>\n> The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=PAYINEUROS&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer=cust_4vMj8Twr5nBzvTrNCgipMb6M&[order][metadata][currency]=EUR&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=LOYALTY-CARD-ng3Kb9tM&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=GIFT-CARD-kW4aEsfB&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku&[item][4][sku_id]=sku_0b661e41fc0d35a8f1&[item][4][quantity]=4'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=REFERRAL-CODE-OxBakPYf&amount=10000'\n```\n\n### [JSFiddle Example](https://jsfiddle.net/voucherify/gfu2bgn5/)\n\n```javascript\n\n\n\n```\n\n### Examples with Query Parameters\n\n| **Query Parameters** | **Example URL** |\n|:---|:---|\n| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |\n| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |\n| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |\n\n### Reasons why a validation might fail\n\nVoucher validation might fail because of one of these reasons:\n\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of [start date - expiration date] timeframe\n* `voucher is disabled` - learn more about [disabled vouchers](ref:disable-voucher)\n* `customer does not match segment rules` - learn more customer tracking LINK\n* `order does not match validation rules` - learn more about validation rules LINK", + "parameters": [ + { + "$ref": "#/components/parameters/origin" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/transactions/export": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." - } - ], - "post": { - "operationId": "export-loyalty-card-transactions-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Export Loyalty Card Transactions", - "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters and filters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", - "object": "export", - "created_at": "2023-03-21T13:50:43.286Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "LOYALTY-CARD-2IAoDNF" - ] - } - } - } - }, - "result": null, - "user_id": null - } + { + "schema": { + "type": "string", + "example": "7fjWdr" }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } + "in": "query", + "name": "code", + "description": "A code that identifies the voucher." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that validated the voucher. This identifier is generated during voucher validation based on your internal ID (e.g., email, database ID) during the first request. This is a hashed customer source ID. If the request is performed for the first time, pass the internal ID to track the customer. **Although not all information is required, the extra information helps prevent fraud.**" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "amount", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order. This amount is the sum of the order items' amounts." + }, + { + "schema": { + "type": "string", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "in": "query", + "name": "session_key", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "session_ttl", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session_ttl_unit` parameter." + }, + { + "schema": { + "type": "string", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "in": "query", + "name": "session_ttl_unit", + "description": "Defines the type of unit in which the session time is counted." + }, + { + "$ref": "#/components/parameters/metadata" + }, + { + "$ref": "#/components/parameters/item" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "session_type", + "description": "The session is required to establish a session between multiple parallel validation and redemption requests. This parameter is required to establish a new session. The session locks the **redemption quantity by 1** and additionally the redemption **gift credits** specified within the request for a gift card and the **loyalty points** for a loyalty card." + }, + { + "name": "customer", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "object", + "title": "Customer details", + "description": "Customer source ID and/or customer metadata.", + "properties": { + "source_id": { + "type": "string", + "description": "Customer source ID.", + "example": "name.lastname@email.com" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.", + "style": "deepObject", + "explode": true } - } + }, + "style": "deepObject", + "explode": true }, - "result": null, - "user_id": null - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + { + "type": "string", + "title": "Customer ID", + "description": "Unique customer ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + } + ] + }, + "description": "Customer details." }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "object", + "title": "Order details", + "description": "Order details.", + "properties": { + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.", + "style": "deepObject", + "explode": true + } + }, + "style": "deepObject", + "explode": true + }, + "description": "Order details." } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/points-expiration": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Loyalty card code." - } - ], - "get": { - "operationId": "get-points-expiration", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Points Expiration", - "description": "Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the [Exports API](ref:create-export) to retrieve a list of both `ACTIVE` and `EXPIRED` point buckets.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty points expiration buckets along with an expiration date if the points are due to expire. No expiration date parameter is returned if the loyalty points bucket does not expire.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "lopb_ERSwDxeWTlvWwFrn3AtJxt3s", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 2 + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on [validation sessions](doc:locking-validation-session).", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher" }, - "status": "ACTIVE", - "expires_at": "2022-11-25", - "created_at": "2022-11-25T09:10:20.994Z", - "object": "loyalty_points_bucket" + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + } + ] + }, + "examples": { + "Wrong customer": { + "value": { + "valid": false, + "reason": "customer does not match validation rules", + "error": { + "message": "Only the gift card owner can apply credits from the gift card to the order." + }, + "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+o", + "code": "GIFT-CARD-kW4aEsfB", + "metadata": {} + } }, - { - "id": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 12 - }, - "status": "ACTIVE", - "expires_at": "2022-11-30", - "created_at": "2022-11-21T13:49:54.949Z", - "object": "loyalty_points_bucket" + "Validation Rule Not Satisfied": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Discount Coupon cannot be redeemed because of violated validation rules: val_WuupvE7OVXyo", + "request_id": "v-0be54f4afa0357c12f" + }, + "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychk", + "code": "PAYINEUROS", + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + } + } }, - { - "id": "lopb_Mg80vhZtqHFItWlJFYZ2rJAS", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 0 - }, - "status": "ACTIVE", - "expires_at": "2023-05-30", - "created_at": "2022-06-09T11:07:07.344Z", - "updated_at": "2022-08-30T08:34:45.989Z", - "object": "loyalty_points_bucket" + "Validate Discount Coupon": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 13000, + "discount_amount": 1000, + "total_discount_amount": 1000, + "total_amount": 12000, + "applied_discount_amount": 1000, + "total_applied_discount_amount": 1000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + } + ], + "metadata": { + "currency": "EUR" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "PAYINEUROS", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 1000 + }, + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + } + } }, - { - "id": "lopb_dQE1TwyTkHAJDlVCPlqSC0nu", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 13124 - }, - "status": "ACTIVE", - "created_at": "2022-02-28T12:13:57.749Z", - "updated_at": "2022-11-25T09:09:51.136Z", - "object": "loyalty_points_bucket" - } - ], - "total": 4 - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/points-expiration/export": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - } - ], - "post": { - "operationId": "create-points-expiration-export", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Points Expiration Export", - "description": "Schedule the generation of a points expiration CSV file for a particular campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the data filters, types of data to return and order in which the results should be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_export_points_expirations" - }, - "examples": { - "Specific Vouchers": { - "value": { - "parameters": { - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "order": "-expires_at", - "filters": { - "junction": "and", - "voucher_id": { - "conditions": { - "$in": [ - "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" - ] + "Validate Loyalty Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 121700, + "discount_amount": 5000, + "total_discount_amount": 5000, + "total_amount": 116700, + "applied_discount_amount": 5000, + "total_applied_discount_amount": 5000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bb4aa003890cb", + "quantity": 2, + "amount": 9000, + "price": 4500, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76bb4aa003890cb", + "source_id": "webinar_BF_pants_black_sweat_pants", + "name": "Black Sweat Pants", + "price": 4500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000ELDH", + "related_object": "sku", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "quantity": 3, + "amount": 89700, + "price": 29900, + "subtotal_amount": 89700, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + } + ], + "metadata": { + "currency": "EUR" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "LOYALTY-CARD-ng3Kb9tM", + "loyalty": { + "points_cost": 1000 + }, + "reward": { + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy" + }, + "metadata": {}, + "campaign": "Loyalty Campaign", + "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" + } + }, + "Validate Gift Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 165700, + "discount_amount": 21500, + "total_discount_amount": 21500, + "total_amount": 144200, + "applied_discount_amount": 21500, + "total_applied_discount_amount": 21500, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bb4aa003890cb", + "quantity": 2, + "amount": 9000, + "price": 4500, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76bb4aa003890cb", + "source_id": "webinar_BF_pants_black_sweat_pants", + "name": "Black Sweat Pants", + "price": 4500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000ELDH", + "related_object": "sku", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "quantity": 3, + "amount": 89700, + "price": 29900, + "subtotal_amount": 89700, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd347ec7d26", + "sku_id": "sku_0b661e41fc0d35a8f1", + "quantity": 4, + "amount": 44000, + "price": 11000, + "subtotal_amount": 44000, + "product": { + "id": "prod_0b661d4bd347ec7d26", + "source_id": "975193eb-1911-444a-a0f0-f567efce1a8b", + "name": "Pumps ”Flex” Michael Kors black" + }, + "sku": { + "id": "sku_0b661e41fc0d35a8f1", + "source_id": "M0E20000000DMVX", + "sku": "Pumps ”Flex” Michael Kors black", + "price": 11000 + } + } + ], + "metadata": { + "currency": "EUR" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "GIFT-CARD-kW4aEsfB", + "gift": { + "amount": 32000, + "balance": 21500, + "effect": "APPLY_TO_ORDER" + }, + "metadata": {}, + "campaign": "Gift Card Campaign", + "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" + } + }, + "Validate Referral Code": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", + "order": { + "amount": 10000, + "discount_amount": 3000, + "total_discount_amount": 3000, + "total_amount": 7000, + "applied_discount_amount": 3000, + "total_applied_discount_amount": 3000, + "items": [], + "metadata": {}, + "referrer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": null, + "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "order" + }, + "code": "REFERRAL-CODE-OxBakPYf", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 30 + }, + "metadata": {}, + "campaign": "Referral Campaign", + "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" } } } } } }, - "Specific campaign": { - "value": { - "parameters": { - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "order": "-expires_at", - "filters": { - "junction": "and", - "campaign_id": { - "conditions": { - "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + "400": { + "description": "Returns an error if missing required parameters or tracking IDs come from the same origin.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Missing customer": { + "value": { + "code": 400, + "key": "missing_customer", + "message": "Missing customer", + "details": "Customer is required to validate rules", + "request_id": "v-0be548ae620abb0a73" + } + }, + "Ambiguous tracking ID": { + "value": { + "code": 400, + "key": "ambiguous_tracking_id", + "message": "Ambiguous trackingId ('track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychkbEcMNB5RhcTj+zcKBEcGnUZkAXxg=' vs. 'track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==')", + "details": "The customer cannot be identified as two different identifiers have been used between requests from same origin.", + "request_id": "v-0be550a5a84abb30f8" } } } @@ -69301,5003 +57370,10411 @@ } } } - } - }, - "responses": { - "200": { - "description": "Returns an object with the export ID of the scheduled generation of CSV file with exported points expirations. You can use either the [Get Export](ref:get-export) endpoint to view the status and obtain the URL of the CSV file or [Download Export](ref:download-export) endpoint to download the CSV file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_object_points_expiration" - }, - "examples": { - "Specific Vouchers": { - "value": { - "id": "exp_zC3eXAFss17XTMzMkkov4KGq", - "object": "export", - "created_at": "2022-11-28T13:00:23.621Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "points_expiration", - "parameters": { - "order": "-expires_at", - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "filters": { - "junction": "and", - "voucher_id": { - "conditions": { - "$in": [ - "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" - ] - } - } - } - }, - "result": null, - "user_id": null - } + }, + "/v1/promotions/validation": { + "post": { + "operationId": "validate-promotions", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Promotions [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nUse this method to get valid promotions for a given customer and order.\n\n### Advanced validation filters\n\nYou can narrow down a validation to a specific promotion ID or tier metadata. Here are the examples of filtering queries you can use:\n\n| **Filter** | **Example** |\n|:---|:---|\n| promotion_id | [filters][promotion_id][conditions][$is]={{campaign_id}} |\n| tier metadata | [filters][metadata.{{promotion tier metadata key}}][conditions][$is]={{promotion tier metadata value}} |\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }'/\n 'https://api.voucherify.io/v1/promotions/validation?audienceRulesOnly=true'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n },\n \"metadata\": {\n \"store_names\": \"Store 1 - New York - Broadway\"\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][promotion_id][conditions][$is]=camp_nYcAyjFXmEaBU0nB7EQ4hVTr'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][metadata.has_budget][conditions][$is]=true'\n```", + "parameters": [ + { + "schema": { + "type": "string" }, - "Specific Campaign": { - "value": { - "id": "exp_kfwVDMsavDHl2vOY6vH9q7P7", - "object": "export", - "created_at": "2022-11-28T16:46:34.148Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "points_expiration", - "parameters": { - "order": "-expires_at", - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "filters": { - "junction": "and", - "campaign_id": { - "conditions": { - "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - } - } - } + "in": "query", + "name": "audienceRulesOnly", + "description": "If you add a query param AudienceRulesOnly=true, the request will be validated against customer-related rules only, the rest of attached limits and rules will be ignored." + }, + { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "object", + "title": "Promotion filters", + "description": "Promotion filter conditions.", + "properties": { + "metadata": { + "type": "object", + "description": "Allows you to create a filter based on the conditions set for promotion metadata values. The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that are attached to a promotion tier object. Stores additional information about the promotion tier in a structured format.", + "style": "deepObject", + "explode": true }, - "result": null, - "user_id": null - } - } + "promotion_id": { + "type": "object", + "description": "Allows you to create a filter based on the unique promotion ID.", + "style": "deepObject", + "explode": true + } + }, + "style": "deepObject", + "explode": true + }, + "description": "Filter conditions." } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/earning-rules": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-earning-rules", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Earning Rules", - "description": "Returns a list of all earning rules within a given campaign.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of earning rules.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_earning_rules" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", - "created_at": "2022-11-10T12:25:12.927Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 100, - "type": "FIXED" - }, - "segment": { - "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" - }, - "event": "customer.segment.entered", - "source": { - "banner": "New Customers", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", - "metadata": {} - }, - { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T07:31:42.778Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 20, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" - } - }, - { - "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", - "created_at": "2022-11-24T14:48:36.567Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1000, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", - "metadata": { - "Type": "Order has been paid - Proportional - 1" - } - }, - { - "id": "ern_jwtacKdEEHoc85QbouRw3CR8", - "created_at": "2022-11-24T15:17:11.539Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1100, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", - "metadata": { - "Type": "Order has been paid - Proportional - 2" - } - }, - { - "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", - "created_at": "2022-11-24T15:20:04.392Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 10, - "points": 2, - "property": "number_of_store_visits" - } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the customer and order context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_promotion" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", + "metadata": { + "key": "value" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "options": { + "expand": [ + "category" + ] }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", - "metadata": { - "Type": "Order has been paid - Proportional - 3 - Metadata" - } - }, - { - "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", - "created_at": "2022-11-24T15:23:44.514Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 1000, - "points": 3, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + "order": { + "amount": 10000, + "items": [ + { + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + ] }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", "metadata": { - "Type": "Order has been paid - Proportional - 4" + "key": "value" } - }, - { - "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", - "created_at": "2022-11-24T15:44:45.301Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 1000, - "points": 4, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + } + }, + "Customer Rules Only": { + "value": { + "customer": { + "id": "cust_gN9KgORZECfdhG9qT6n82Zr7" }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", - "metadata": { - "Type": "Order has been paid - Proportional - 5 - Items" - } - }, - { - "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", - "created_at": "2022-11-24T15:56:58.710Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 10000, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "options": { + "expand": [ + "category" + ] + } + } + }, + "Campaign Specific": { + "value": { + "customer": { + "source_id": "test-user@email.com" }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", - "metadata": {} - }, - { - "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", - "created_at": "2022-11-24T16:19:20.571Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 5, - "property": "customer_life_time_value" + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] } }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered Segment", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", - "metadata": {} - }, - { - "id": "ern_L8dFanPxJzhw0f5voTwPurGP", - "created_at": "2022-11-24T16:27:13.917Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "options": { + "expand": [ + "category" + ] }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", "metadata": { - "Type": "Fixed" + "store_names": "Store 1 - New York - Broadway" } - }, - { - "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", - "created_at": "2022-11-24T16:41:48.830Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 2, - "points": 2, - "property": "volume_number" + } + }, + "Promotion Tier Metadata": { + "value": { + "customer": { + "name": "Joe McDonald", + "email": "joey@email.com", + "source_id": "123_source_id" + }, + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] } }, - "custom_event": { - "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "event": "user_subscribed", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", - "metadata": { - "Type": "Event" + "options": { + "expand": [ + "category" + ] } - }, - { - "id": "ern_afo3Ea760hAKv07JYpycnhiE", - "created_at": "2022-11-24T16:50:12.945Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 3, - "property": "customer_life_time_value" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a list of valid promotions for a given context (customer and order). You can then choose which promotion to apply, i.e. the highest discount amount.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_res_validate_promotion" + }, + "examples": { + "Customer Rules Only": { + "value": { + "valid": true, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 9351000, + "initial_amount": 72100, + "items_discount_amount": 9340400, + "total_discount_amount": 9340400, + "total_amount": 10600, + "items_applied_discount_amount": 9340400, + "total_applied_discount_amount": 9340400, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 23, + "discount_quantity": 22, + "initial_quantity": 1, + "amount": 39100, + "discount_amount": 37400, + "initial_amount": 1700, + "applied_discount_amount": 37400, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 222, + "discount_quantity": 222, + "initial_quantity": 1, + "amount": 333000, + "discount_amount": 333000, + "initial_amount": 1500, + "applied_discount_amount": 333000, + "price": 1500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 111, + "discount_quantity": 111, + "initial_quantity": 1, + "amount": 6660000, + "discount_amount": 6660000, + "initial_amount": 60000, + "applied_discount_amount": 6660000, + "price": 60000, + "subtotal_amount": 0, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 11, + "discount_quantity": 11, + "initial_quantity": 0, + "amount": 2310000, + "discount_amount": 2310000, + "initial_amount": 0, + "applied_discount_amount": 2310000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_ByIIAHC1Mz9ouJsitzAWsush", + "name": "Multiple", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "effect": "ADD_MISSING_ITEMS", + "unit_off": 11, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" + }, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" + } + }, + { + "effect": "ADD_NEW_ITEMS", + "unit_off": 22, + "unit_type": "sku_0b7d7dfb090be5c619", + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1" + }, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1" + } + }, + { + "effect": "ADD_MISSING_ITEMS", + "unit_off": 111, + "unit_type": "prod_0b7d7c4e814be5c502", + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12" + } + }, + { + "effect": "ADD_MISSING_ITEMS", + "unit_off": 222, + "unit_type": "prod_0b72b0bd64d198e3ae", + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage" + } + } + ] + }, + "campaign": { + "id": "camp_JtoaZ8Qgpf6FkMAy2wWiOJWH", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "discount_amount": 9340400, + "applied_discount_amount": 9340400, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 9522100, + "initial_amount": 72100, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 72100, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, + "discount_amount": 9450000, + "initial_amount": 0, + "applied_discount_amount": 9450000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "name": "Add new SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 45, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" + }, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" + } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 4, + "discount_amount": 9450000, + "applied_discount_amount": 9450000, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 109500, + "initial_amount": 72100, + "items_discount_amount": 39100, + "total_discount_amount": 39100, + "total_amount": 70400, + "items_applied_discount_amount": 39100, + "total_applied_discount_amount": 39100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 23, + "discount_quantity": 23, + "initial_quantity": 1, + "amount": 39100, + "discount_amount": 39100, + "initial_amount": 1700, + "applied_discount_amount": 39100, + "price": 1700, + "subtotal_amount": 0, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_NcdD0zLo6FUhKWpNrNuP3Pte", + "name": "Add missing SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 23, + "unit_type": "sku_0b7d7dfb090be5c619", + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1" + }, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1" + } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 3, + "discount_amount": 39100, + "applied_discount_amount": 39100, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 76100, + "initial_amount": 72100, + "items_discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 72100, + "items_applied_discount_amount": 4000, + "total_applied_discount_amount": 4000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b00ffed198e344", + "quantity": 8, + "discount_quantity": 8, + "initial_quantity": 0, + "amount": 4000, + "discount_amount": 4000, + "initial_amount": 0, + "applied_discount_amount": 4000, + "price": 500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b00ffed198e344", + "source_id": "roses_1", + "name": "Bouquet - Romantic Roses", + "price": 500 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_nGr1SWuy9vduABkbbJkl8cHb", + "name": "Add new order items", + "banner": "Add Romantic Roses", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 8, + "unit_type": "prod_0b72b00ffed198e344", + "product": { + "id": "prod_0b72b00ffed198e344", + "source_id": "roses_1", + "name": "Bouquet - Romantic Roses" + } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 4000, + "applied_discount_amount": 4000, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 78100, + "initial_amount": 72100, + "items_discount_amount": 7500, + "total_discount_amount": 7500, + "total_amount": 70600, + "items_applied_discount_amount": 7500, + "total_applied_discount_amount": 7500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 5, + "discount_quantity": 5, + "initial_quantity": 1, + "amount": 7500, + "discount_amount": 7500, + "initial_amount": 1500, + "applied_discount_amount": 7500, + "price": 1500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae", + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage" + } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "discount_amount": 7500, + "applied_discount_amount": 7500, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 72100, + "total_amount": 72100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", + "name": "Get", + "banner": "Free shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + "campaign": { + "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [ + { + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "sku", + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "product_source_id": "Books", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 6, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 72100, + "items_discount_amount": 67300, + "total_discount_amount": 67300, + "total_amount": 4800, + "items_applied_discount_amount": 67300, + "total_applied_discount_amount": 67300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "discount_amount": 2300, + "applied_discount_amount": 2300, + "price": 3100, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "discount_amount": 900, + "applied_discount_amount": 900, + "price": 1700, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 1500, + "subtotal_amount": 800, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "discount_amount": 59200, + "applied_discount_amount": 59200, + "price": 60000, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", + "name": "Get Amount Off", + "banner": "Every product is worth 8", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "campaign": { + "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 67300, + "applied_discount_amount": 67300, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" } - } - }, - "custom_event": { - "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" - }, - "event": "cart_abandoned", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", - "metadata": {} - }, - { - "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", - "created_at": "2022-11-24T16:51:31.595Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier joined - Any", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", - "metadata": { - "Type": "Tier joined - any - fixed" + ] } }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" + "Campaign specific": { + "value": { + "valid": true, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 72100, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 72000, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_g83qUzYZpfX0OMAFOVoQuOYG", + "name": "1", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 100 + }, + "campaign": { + "id": "camp_nYcAyjFXmEaBU0nB7EQ4hVTr", + "start_date": null, + "expiration_date": null, + "active": true, + "categories": [ + { + "id": "cat_0b5f66bc97ce5be3c6", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T08:27:14.926Z", + "object": "category" + } + ], + "object": "campaign" + }, + "hierarchy": 1, + "discount_amount": 100, + "applied_discount_amount": 100, + "metadata": {}, + "object": "promotion_tier" } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" + ] } }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" + "Promotion Tier Metadata": { + "value": { + "valid": true, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", + "order": { + "amount": 72100, + "total_amount": 72100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", + "name": "Get", + "banner": "Free shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + "campaign": { + "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [ + { + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "sku", + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "product_source_id": "Books", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 6, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", + "order": { + "amount": 72100, + "items_discount_amount": 67300, + "total_discount_amount": 67300, + "total_amount": 4800, + "items_applied_discount_amount": 67300, + "total_applied_discount_amount": 67300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "discount_amount": 2300, + "applied_discount_amount": 2300, + "price": 3100, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "discount_amount": 900, + "applied_discount_amount": 900, + "price": 1700, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 1500, + "subtotal_amount": 800, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "discount_amount": 59200, + "applied_discount_amount": 59200, + "price": 60000, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", + "name": "Get Amount Off", + "banner": "Every product is worth 8", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "campaign": { + "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 67300, + "applied_discount_amount": 67300, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" } - } + ] + } + } + } + } + } + } + } + } + }, + "/v1/promotions/tiers/{tierId}/validation": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "post": { + "operationId": "validate-promotion-tier", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Promotion Tier [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify whether the promotion tier discount can be applied to an order. This method is designed for server side integration which means that it is accessible only through private keys.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the customer and order context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_promotion_tier" + }, + "examples": { + "Using IDs": { + "value": { + "customer": { + "source_id": "test-user@email.io" }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + "order": { + "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS" + } + } + }, + "Using Redemption Metadata": { + "value": { + "customer": { + "source_id": "test-user@email.com" }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "order": { + "amount": 200000, + "items": [ + { + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2 + }, + { + "sku_id": "sku_0KtP4rvwEECQ2U", + "related_object": "sku", + "quantity": 1 + } + ] }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", "metadata": { - "Type": "Tier left" + "store_names": "Store 1 - New York - Broadway" } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns validation result in `valid` key of the promotion tier object. Returns `true` if the promotion tier rules and validation rules are satisfied given the request body parameters. Returns `false` if the data provided in the payload does not meet validation rules or promotion tier requirements.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_res_validate_promotion_tier" + }, + "examples": { + "Promotion Valid": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1qnieLLNygh19A0Ia7FsJck", + "order": { + "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS", + "source_id": null, + "created_at": "2022-11-17T12:17:55.096Z", + "updated_at": null, + "status": "CREATED", + "amount": 9918200, + "initial_amount": 468200, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 468200, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500 + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000 + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000 + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000 + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae32322150fd0546", + "quantity": 2, + "amount": 420000, + "price": 210000, + "subtotal_amount": 420000, + "product": { + "id": "prod_0bae32322150fd0546", + "name": "Samsung Phone", + "price": 210000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, + "discount_amount": 9450000, + "initial_amount": 0, + "applied_discount_amount": 9450000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "name": "Add new SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 45, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" + }, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 4, + "discount_amount": 9450000, + "applied_discount_amount": 9450000, + "metadata": {}, + "object": "promotion_tier" } }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" + "Promotion Invalid with Error Message": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Promotion Tier cannot be redeemed because of violated validation rules: val_eqSA1dXOv491", + "request_id": "v-0c034585fd16cf6958" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae" + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true + }, + "object": "promotion_tier" } }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} + "Promotion Invalid with Custom Message": { + "value": { + "valid": false, + "reason": "Inactive Promotion", + "error": { + "message": "Promotion is inactive this weekend." + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae" + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true + }, + "object": "promotion_tier" + } } - ], - "total": 18 + } } } } } } - } - } - }, - "post": { - "operationId": "create-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Earning Rule", - "description": "Create earning rules for a loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Customize the request body based on the type of earning rules you would like to create. The request body is an array of objects. The required minimum properties to include in the payload for each object are `event` and `loyalty`. Additionally, if you choose to add a `validity_timeframe`, you must include a `start_date`. Furthermore, an earning rule `event` type: \n\n- `customer.segment.entered` requires a `segment` object\n- a custom event requires a `custom_event` object\n- a `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged` requires a `loyalty_tier` object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_earning_rules" - }, - "examples": { - "Example": { - "value": [ - { - "event": "order.paid", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" - }, - "source": { - "banner": "Order paid 5 points." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - fixed amount of points" + }, + "/v1/redemption-object": { + "get": { + "operationId": "redemption-object", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redemption Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Redemption Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_redemption_object" } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1, - "points": 1 + } + } + } + } + } + }, + "/v1/rollback-redemption-object": { + "get": { + "operationId": "rollback-redemption-object", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Rollback Redemption Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Rollback Redemption Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended" + } + } + } + } + } + } + }, + "/v1/stackable-redemptions-object": { + "get": { + "operationId": "stackable-redemptions-object", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Stackable Redemptions Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Stackable Redemptions Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" + } + } + } + } + } + } + }, + "/v1/redemptions": { + "get": { + "operationId": "list-redemptions", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "List Redemptions", + "description": "Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. \n\n## Filtering results\nThe result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date:\n`https://api.voucherify.io/v1/redemptions?limit=3&[created_at][before]=2017-09-08T13:52:18.227Z`. A filter based on the object `created_at` field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: `[created_at][after]`, `[created_at][before]`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`.\n\n## Failed Redemptions\n\nA redemption may fail for various reasons. You can figure out an exact reason from the `failure_code`:\n- `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "result", + "description": "A filter on the list based on the redemption result. Available options are: `SUCCESS`, `FAILURE`. You can provide multiple values by repeating the param." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign", + "description": "A filter by the campaign **name** that the redemption resources originate from." + }, + { + "schema": { + "type": "string", + "example": "cust_IkrTR674vvQvr9a4rDMiqglY" + }, + "in": "query", + "name": "customer", + "description": "Return redemptions performed by the customer with given `id`." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "name": "filters", + "in": "query", + "schema": { + "type": "object", + "properties": { + "voucher_code": { + "type": "object", + "description": "Unique voucher code.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 1 point for 1 dollar spent excluding discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1, - "points": 1 + "related_object_id": { + "type": "object", + "description": "Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 1 point for 1 dollar spent including discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order total amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 2, - "points": 1, - "property": "number_of_store_visits" + "related_object_parent_id": { + "type": "object", + "description": "Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 2 points for each store visit." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to numerical order metadata property " - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 2, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" + "parent_redemption_id": { + "type": "object", + "description": "Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order items amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 2, - "points": 1, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + "failure_code": { + "type": "object", + "description": "Failure code, i.e. quantity_exceeded.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 2 points for every dollar spent on the product collection." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order items subtotal amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_QUANTITY", - "order_items": { - "quantity": { - "every": 1, - "points": 1, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" + "result": { + "type": "object", + "description": "Result, i.e. `SUCCESS` or `FAILURE`.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid - 1 point for every brand phone in your cart." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." - } - }, - { - "event": "order.paid", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" + "object": { + "type": "object", + "description": "Specify which type of object to return, i.e. `redemption` or `redemption_rollback`.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Order paid 1 point for 1 month of being a customer with us." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - points proportional to customer metadata property" - } - }, - { - "event": "customer.segment.entered", - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" + "customer_id": { + "type": "object", + "description": "Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "source": { - "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Entered segment - points proportional to customer metadata property" - } - }, - { - "event": "customer.segment.entered", - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" - }, - "source": { - "banner": "Customer entered birthday segment - 5 points" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Entered segment - fixed points" - } - }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "source": { - "banner": "See page - 3 points" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - fixed points for viewing a page" - } - }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 1, - "points": 2, - "property": "volume_number" + "campaign_name": { + "type": "object", + "description": "Campaign name.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "source": { - "banner": "See page X - get 2 points multiplied by the page number" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + "user_login": { + "type": "object", + "description": "User login used to login to Voucherify, i.e. name.lastname@email.com", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } } - }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" + } + }, + "description": "Filters for listing responses.", + "style": "deepObject", + "explode": true + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of redemption objects. Each entry in the array is a separate redemption object. If no more redemptions are available, the resulting array will be empty. If you provide a non-existent customer ID, this call returns an empty object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_list_redemptions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "redemptions", + "redemptions": [ + { + "id": "r_0c0469eaf705889d99", + "object": "redemption", + "date": "2022-11-18T12:30:32.622Z", + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulhyMBo7VratI", + "metadata": { + "store_names": "Store 2 - Florida - Miami" + }, + "result": "SUCCESS", + "order": { + "id": "ord_ndw5rQJt12zvZ4upF72a3ljh", + "source_id": null, + "created_at": "2022-11-18T12:30:31.338Z", + "updated_at": null, + "status": "PAID", + "amount": 9680000, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 230000, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, + "discount_amount": 9450000, + "initial_amount": 0, + "applied_discount_amount": 9450000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "object": "customer" + }, + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c0469eaf705889d99": { + "date": "2022-11-18T12:30:31.388Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "related_object_parent_id": "camp_40LC42P5NFbkkD4RWoJ4btks" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5_a", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "voucher": null, + "promotion_tier": { + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks" + } + } + }, + { + "id": "r_0bf9cf0a8b12dc5ba6", + "object": "redemption", + "date": "2022-11-10T06:49:03.835Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "amount": 200, + "result": "SUCCESS", + "order": { + "id": "ord_jAifScsbOqxgb12hLu7hXrLU", + "source_id": null, + "created_at": "2022-11-10T06:49:02.703Z", + "updated_at": null, + "status": "PAID", + "amount": 4500, + "discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 500, + "applied_discount_amount": 4000, + "total_applied_discount_amount": 4000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 3, + "amount": 4500, + "price": 1500, + "subtotal_amount": 4500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bf9cf0a8b12dc5ba6": { + "date": "2022-11-10T06:49:02.764Z", + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "related_object_parent_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", + "metadata": { + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "voucher": { + "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "code": "LT1-wMPnRhxb", + "campaign": "Loyalty Campaign - Tiers - 1", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "reward": { + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", + "metadata": { + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 + }, + "object": "customer" + }, + "assignment_id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", + "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "object": "reward", + "name": "100 Points = $20", + "created_at": "2022-09-09T06:41:54.496Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 200 + } + }, + { + "id": "rf_0bf9caf744d2dc593a", + "object": "redemption", + "date": "2022-11-10T06:31:15.477Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "FAILURE", + "failure_code": "loyalty_card_points_exceeded", + "failure_message": "loyalty card points exceeded", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", + "metadata": { + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "voucher": { + "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "code": "LT1-wMPnRhxb", + "campaign": "Loyalty Campaign - Tiers - 1", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + } + }, + { + "id": "rf_0bf8c023eb4d4aa4ad", + "object": "redemption", + "date": "2022-11-09T11:05:28.074Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "FAILURE", + "failure_code": "customer_rules_violated", + "failure_message": "customer does not match validation rules", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "source_id": "bob.smith@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "voucher": { + "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "code": "3rqWOTAh", + "campaign_id": null + } + }, + { + "id": "r_0ba9fa02fcd28ed8f1", + "object": "redemption", + "date": "2022-09-09T06:38:20.085Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", + "source_id": null, + "created_at": "2022-09-09T06:38:17.984Z", + "updated_at": null, + "status": "PAID", + "amount": 4600, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 4300, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0a65b3ff8592d7a5b5", + "quantity": 1, + "amount": 3000, + "discount_amount": 300, + "applied_discount_amount": 300, + "price": 3000, + "subtotal_amount": 2700, + "product": { + "id": "prod_0a65b3ff8592d7a5b5", + "name": "Koffee Cup", + "price": 3000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fa02fcd28ed8f1": { + "date": "2022-09-09T06:38:18.099Z", + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "source_id": "bob.smith@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "voucher": { + "id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "code": "vTcguVLE", + "campaign": "SL-Gift", + "campaign_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + }, + "gift": { + "amount": 300 + } + }, + { + "id": "rf_0bf8bfe0808d4aa473", + "object": "redemption", + "date": "2022-11-09T11:04:19.062Z", + "customer_id": null, + "tracking_id": null, + "metadata": {}, + "result": "FAILURE", + "failure_code": "missing_customer", + "failure_message": "Missing customer", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": null, + "related_object_type": "voucher", + "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "voucher": { + "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "code": "3rqWOTAh", + "campaign_id": null + } + } + ], + "total": 6 } } - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "source": { - "banner": "Get 2 points for every month you're a customer for viewing a page" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on customer metadata" } + } + } + } + } + }, + "post": { + "operationId": "redeem-stacked-discounts", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Redeem Stackable Discounts", + "description": "Use this method to redeem up to 5 redeemables in a single API request.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions). \n\n\n> 📘 Also available on client-side\n>\n> This method is also accessible through public keys which you can use in client-side​ apps: mobile and web browser apps. Go to the dedicated [endpoint](ref:redeem-stacked-discounts-client-side) to learn more.\n> - Use `X-Client-Application-Id` as the application ID header.\n> - Use `X-Client-Token` as the appliction secret key header.\n> - Use client-side base URL.\n> - Use an `origin` header for your custom domain.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_redemptions" }, - { - "event": "customer.loyalty.tier.prolonged", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK", + "key": "session_key" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ], + "metadata": { + "key": "value" + } } } - }, - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." } } - ] + } + } + }, + "responses": { + "200": { + "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
`array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
`object` | Represents the final effect of all child redemptions executed during the request. |\n| order
`object` | Represents order details after all discounts are applied. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" + } + } + } } } } - } - }, - "responses": { - "200": { - "description": "Returns an array of earning rule objects.", - "content": { - "application/json": { + }, + "/v1/redemptions/{redemptionId}": { + "parameters": [ + { "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } + "type": "string" }, - "examples": { - "Example": { - "value": [ - { - "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" + "name": "redemptionId", + "in": "path", + "required": true, + "description": "ID of previously created redemption." + } + ], + "get": { + "operationId": "get-redemption", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Get Redemption", + "description": "Return a redemption or redemption rollback object. This object can either be a successfull or failed redemption or redemption rollback.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_get_redemption" + }, + "examples": { + "Discount Voucher": { + "value": { + "id": "r_0bade27c428db5873e", + "object": "redemption", + "date": "2022-09-12T07:29:28.211Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ebmAU9uv3dTE2Khqyh7i5ka7", + "source_id": null, + "created_at": "2022-09-12T07:29:26.245Z", + "updated_at": null, + "status": "PAID", + "amount": 22500, + "discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 22200, + "applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 1, + "amount": 22500, + "price": 22500, + "subtotal_amount": 22500, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bade27c428db5873e": { + "date": "2022-09-12T07:29:26.282Z", + "related_object_type": "voucher", + "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", + "voucher": { + "id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", + "code": "FB-metadata-string", + "campaign": null, + "campaign_id": null, + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + } + } }, - "event": "order.paid", - "source": { - "banner": "Order paid 5 points.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "Loyalty Card - Material Reward Product Type": { + "value": { + "id": "r_0c5bf0e6d601c7d7de", + "object": "redemption", + "date": "2023-01-25T12:08:09.503Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 4, + "result": "SUCCESS", + "order": { + "id": "ord_dSOsWkNCRT24lHPkMu8o5QbX", + "source_id": null, + "created_at": "2023-01-25T12:08:07.750Z", + "updated_at": null, + "status": "PAID", + "items": [], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf0e6d601c7d7de": { + "date": "2023-01-25T12:08:07.768Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "name": "[Sample] Tiered Wire Basket", + "price": 11995, + "attributes": [], + "metadata": { + "source": "bigcommerce", + "bigcommerce_product_categories": [ + 21, + 23 + ] + }, + "image_url": null, + "created_at": "2022-06-03T13:36:16.084Z", + "updated_at": "2022-06-07T09:10:44.644Z", + "object": "product" + }, + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", + "object": "reward", + "name": "Present", + "created_at": "2022-06-13T06:59:01.694Z", + "updated_at": null, + "parameters": { + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "sku_id": null + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 4 + } + } + }, + "Loyalty Card - Material Reward SKU Type": { + "value": { + "id": "r_0c5bf18dad48a34392", + "object": "redemption", + "date": "2023-01-25T12:11:00.543Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 6, + "result": "SUCCESS", + "order": { + "id": "ord_dwb6bpqjIlMuXFS71NuHed9S", + "source_id": null, + "created_at": "2023-01-25T12:10:58.598Z", + "updated_at": null, + "status": "PAID", + "items": [], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf18dad48a34392": { + "date": "2023-01-25T12:10:58.613Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", + "product": { + "id": "prod_5h0wc453_2", + "source_id": "jonah-nystrom-bourbon", + "name": "Johan & Nyström - Bourbon", + "price": null, + "attributes": [ + "categories", + "description", + "weight" + ], + "metadata": { + "company": "Johan & Nyström", + "showcase": true + }, + "image_url": null, + "created_at": "2021-12-01T08:00:49.418Z", + "updated_at": null, + "object": "product" + }, + "sku": { + "id": "sku_0a3efc9044dd121803", + "source_id": "jonah-nystrom-bourbon-250g", + "product_id": "prod_5h0wc453_2", + "sku": "250g", + "price": 1750, + "currency": null, + "attributes": { + "categories": "Coffee, Whole Bean", + "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", + "weight": 250 + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-01T08:00:49.427Z", + "updated_at": null, + "object": "sku" + }, + "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", + "object": "reward", + "name": "Present - SKU", + "created_at": "2023-01-25T12:10:16.060Z", + "updated_at": null, + "parameters": { + "product": { + "id": "prod_5h0wc453_2", + "sku_id": "sku_0a3efc9044dd121803" + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 6 + } + } }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "Loyalty Card - Pay with Points": { + "value": { + "id": "r_0b5e402ad54a3afe9c", + "object": "redemption", + "date": "2022-07-12T11:00:26.247Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 5, + "redemption": "r_0b5e402ad50a3afe98", + "result": "SUCCESS", + "order": { + "id": "ord_9akjPYZNskEhKZ4zCZt6TKwq", + "source_id": null, + "created_at": "2022-07-12T11:00:26.224Z", + "amount": 20000, + "discount_amount": 5100, + "total_discount_amount": 5100, + "total_amount": 14900, + "applied_discount_amount": 500, + "total_applied_discount_amount": 500, + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "assignment_id": "rewa_X3jnD5XFxP6GXCzPZUNknDck", + "id": "rew_6rhNwuuWFQJLvTPO34ilg6jq", + "object": "reward", + "name": "Pay with Points", + "created_at": "2022-07-11T08:18:18.205Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 1, + "points_ratio": 1 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 5 + } + } }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", - "metadata": { - "Type": "Order paid - fixed amount of points" - } - }, - { - "id": "ern_Ov5RWerVFubVSjIHOMco34dv", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1, - "points": 1 + "Loyalty Card - Digital Reward - Discount Voucher": { + "value": { + "id": "r_0c5bf3323008a35032", + "object": "redemption", + "date": "2023-01-25T12:18:10.707Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": { + "redemption_location": { + "city": "Warsaw", + "state": "Polyork" + } + }, + "amount": 2, + "result": "SUCCESS", + "order": { + "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", + "source_id": null, + "created_at": "2023-01-25T12:18:09.203Z", + "updated_at": null, + "status": "PAID", + "amount": 2100, + "total_amount": 2100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 3, + "amount": 2100, + "price": 700, + "subtotal_amount": 2100, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf3323008a35032": { + "date": "2023-01-25T12:18:09.216Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", + "code": "HAPPY-ORDER5My", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "21ceb848-4869-4dac-ba41-f854bda3a101", + "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" + }, + "barcode": { + "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" + } + }, + "is_referral_code": false, + "created_at": "2023-01-25T12:18:09.256Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 2 } } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for 1 dollar spent excluding discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_2R4x6pMFVEIPz1Lhz5ZVo33Y", - "metadata": { - "Type": "Order paid- points proportional to order amount" - } - }, - { - "id": "ern_5rWPz4arGlTv4FVc1vETeFfe", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1, + "Loyalty Card - Digital Reward - Credits on Gift Card": { + "value": { + "id": "r_0c5c1435d053202118", + "object": "redemption", + "date": "2023-01-25T14:42:25.206Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 1, + "result": "SUCCESS", + "order": { + "id": "ord_v0r7JfUQgWRpw28UJm9Z5AaH", + "source_id": null, + "created_at": "2023-01-25T14:42:23.637Z", + "updated_at": null, + "status": "PAID", + "amount": 22500, + "total_amount": 22500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 1, + "amount": 22500, + "price": 22500, + "subtotal_amount": 22500, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5c1435d053202118": { + "date": "2023-01-25T14:42:23.681Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 55080, + "balance": 44780 + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" + }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2023-01-11T15:23:02.789Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", + "object": "reward", + "name": "Present Credits on Gift Card", + "created_at": "2023-01-25T14:41:31.858Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "balance": 4000, + "type": "GIFT_VOUCHERS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { "points": 1 } } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for 1 dollar spent including discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_fXasfs6Eh7P2haZkI33PEumI", - "metadata": { - "Type": "Order paid- points proportional to order total amount" - } - }, - { - "id": "ern_Xs3o43dHr1O3RM5ojoeu1l6b", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 2, - "points": 1, - "property": "number_of_store_visits" + "Loyalty Card - Digital Reward - Points on Loyalty Card": { + "value": { + "id": "r_0c5c226f498f1a93f0", + "object": "redemption", + "date": "2023-01-25T15:44:34.317Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 1, + "result": "SUCCESS", + "order": { + "id": "ord_1fv4ITwpUQra6iDTHFPVfnRR", + "source_id": null, + "created_at": "2023-01-25T15:44:32.494Z", + "updated_at": null, + "status": "PAID", + "amount": 700, + "total_amount": 700, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "price": 700, + "subtotal_amount": 700, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5c226f498f1a93f0": { + "date": "2023-01-25T15:44:32.550Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 1000, + "balance": 870 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-11T08:19:28.780Z", + "updated_at": "2022-10-01T00:02:05.604Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 26, + "redeemed_points": 130, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", + "object": "reward", + "name": "Present on Loyalty Card", + "created_at": "2023-01-25T15:43:40.716Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "balance": 20, + "type": "LOYALTY_PROGRAM" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 } } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for each store visit.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_jucMzF25jisrqiG3k6JyyviT", - "metadata": { - "Type": "Order paid- points proportional to numerical order metadata property " - } - }, - { - "id": "ern_9CjMBP2V8zgpsHLga4YOQo0A", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 2, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" + "Gift Card": { + "value": { + "id": "r_0b5e7d29ba4fb72ee4", + "object": "redemption", + "date": "2022-07-12T15:26:52.777Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 5000, + "redemption": "r_0b5e7d29ba0fb72ee2", + "result": "SUCCESS", + "order": { + "id": "ord_5iOTjTG4I3Yo2G2bH1qHk66a", + "source_id": null, + "created_at": "2022-07-12T15:26:52.773Z", + "amount": 30200, + "discount_amount": 9530, + "total_discount_amount": 9530, + "total_amount": 20670, + "applied_discount_amount": 5000, + "total_applied_discount_amount": 5000, + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "gift": { + "amount": 5000 } } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_y60lx7XsW1YdOOOFuDaYjvG4", - "metadata": { - "Type": "Order paid- points proportional to order items amount" - } - }, - { - "id": "ern_uI7hRj8PNodK8xWRsn3gpDdG", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 2, - "points": 1, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + "Promotion Tier": { + "value": { + "id": "r_0c5d6689b35320059a", + "object": "redemption", + "date": "2023-01-26T15:20:35.916Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_4kVJ1PiXP3TNfik3pM79KZsn", + "source_id": null, + "created_at": "2023-01-26T15:20:34.216Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" + } + }, + "metadata": { + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5d6689b35320059a": { + "date": "2023-01-26T15:20:34.253Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } + } + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "action": null, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": null, + "expiration_date": null, + "object": "campaign" + }, + "campaign_id": null, + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for every dollar spent on the product collection.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_Lk1WROGexXA72FabUWhR1p7X", - "metadata": { - "Type": "Order paid- points proportional to order items subtotal amount" - } - }, - { - "id": "ern_dL13AmZEO0ToImOY44YUP1ru", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_QUANTITY", - "order_items": { - "quantity": { - "every": 1, - "points": 1, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } + "Stacked Redemption": { + "value": { + "id": "r_0b5e3e2b7f851d0192", + "object": "redemption", + "date": "2022-07-12T10:51:33.098Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_qjnno0eUQ1fs0RMjejfbZp7q", + "source_id": null, + "created_at": "2022-07-12T10:51:31.687Z", + "updated_at": null, + "status": "PAID", + "amount": 20000, + "discount_amount": 6100, + "total_discount_amount": 6100, + "total_amount": 13900, + "applied_discount_amount": 6100, + "total_applied_discount_amount": 6100, + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0b5e3e2b7f851d0192": { + "date": "2022-07-12T10:51:31.711Z", + "related_object_type": "redemption", + "related_object_id": "r_0b5e3e2b7f851d0192", + "stacked": [ + "r_0b5e3e2b7f851d0193", + "r_0b5e3e2b7fc51d0194", + "r_0b5e3e2b7fc51d0195", + "r_0b5e3e2b7fc51d0196", + "r_0b5e3e2b7fc51d0197" + ] + } + } + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "redemption", + "related_object_id": "r_0b5e3e2b7f851d0192", + "voucher": null } }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for every brand phone in your cart.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_4F9iJG0hmKTiqSsmkfbB8vUF", - "metadata": { - "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." - } - }, - { - "id": "ern_ublD9yGhxPrd9ayPAMTc4aOZ", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "Failed Voucher": { + "value": { + "id": "rf_0c5bd3c15701c78243", + "object": "redemption", + "date": "2023-01-25T10:00:47.812Z", + "customer_id": "cust_w1aRTTkpzeTGtOauISc8CKUN", + "tracking_id": "track_hr0jh/qNQqZWu7gkCEcVwEg27bNVrn2+", "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" + "location_id": [], + "redemption_location": { + "city": "Albany", + "state": "New York" + } + }, + "result": "FAILURE", + "failure_code": "voucher_disabled", + "failure_message": "voucher is disabled", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_w1aRTTkpzeTGtOauISc8CKUN", + "name": "Bobby's Friend", + "email": null, + "source_id": "create_order_referrer_1", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", + "voucher": { + "id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", + "code": "PROMO-CODE2", + "campaign": null, + "campaign_id": null, + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" } } }, - "event": "order.paid", - "source": { - "banner": "Order paid 1 point for 1 month of being a customer with us.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_raft7C1hVw427OnEobmzhXjD", - "metadata": { - "Type": "Order paid - points proportional to customer metadata property" - } - }, - { - "id": "ern_6tBwufmR7UNJInhZq8zNRrj5", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" + "Failed Promotion Tier": { + "value": { + "id": "rf_0c5d6e47050156bfc2", + "object": "redemption", + "date": "2023-01-26T15:54:23.508Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "FAILURE", + "failure_code": "promotion_inactive", + "failure_message": "Inactive Promotion", + "order": null, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "action": null, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": null, + "expiration_date": null, + "object": "campaign" + }, + "campaign_id": null, + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_mQ8SCABGLnrGMBbh8QS6DUpX", - "metadata": { - "Type": "Entered segment - points proportional to customer metadata property" + "Failed Redemption": { + "value": { + "id": "rf_0c5bde8dfc0156f0e3", + "object": "redemption", + "date": "2023-01-25T10:47:58.578Z", + "customer_id": null, + "tracking_id": null, + "metadata": null, + "result": "FAILURE", + "failure_code": "not_found", + "failure_message": "Resource not found", + "order": null, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": null, + "related_object_type": "redemption", + "related_object_id": "rf_0c5bde8dfc0156f0e3", + "voucher": null + } } - }, - { - "id": "ern_yBR0JtdcDyJXgZf30C8KQLPw", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Customer entered birthday segment - 5 points", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_Co7zjgYPIKZ45vcK0jn7qrY8", - "metadata": { - "Type": "Entered segment - fixed points" + } + } + } + } + } + } + }, + "/v1/vouchers/{code}/redemption": { + "parameters": [ + { + "$ref": "#/components/parameters/code" + } + ], + "get": { + "operationId": "get-voucher-redemptions", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Get Voucher's Redemptions", + "description": "Retrieve the number of times a voucher was redeemed and each of the redemption details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "A dictionary with a `redemption_entries` property that contains an array of voucher's redemptions.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_get_vouchers_redemptions" + }, + "examples": { + "Example": { + "value": { + "quantity": null, + "redeemed_quantity": 6, + "object": "list", + "url": "/v1/vouchers/Test - FB - Vouchers - 9/redemptions?page=1&limit=10", + "data_ref": "redemption_entries", + "total": 6, + "redemption_entries": [ + { + "id": "r_0bc92f81a6801f9bca", + "object": "redemption", + "date": "2022-10-03T12:24:58.008Z", + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_bhp1EH2SDz7UwkkurPFPLPhi", + "source_id": null, + "created_at": "2022-10-03T12:24:56.179Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 229900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "object": "customer" + }, + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92f81a6801f9bca": { + "date": "2022-10-03T12:24:56.219Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "name": null, + "email": null, + "source_id": "johnnyy@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc92e6a68050e118c", + "object": "redemption", + "date": "2022-10-03T12:20:11.873Z", + "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmKhuFqhawWj", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_rBsuJYqf4eFZgqj6IxeJgEcN", + "source_id": null, + "created_at": "2022-10-03T12:20:10.222Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 229900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "object": "customer" + }, + "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92e6a68050e118c": { + "date": "2022-10-03T12:20:10.272Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_4", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc92db6e6001f9aa8", + "object": "redemption", + "date": "2022-10-03T12:17:07.780Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmYlx396Pk4X", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_JvZbg1LFcXdQ67no5SENGldH", + "source_id": null, + "created_at": "2022-10-03T12:17:06.404Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 1200, + "total_discount_amount": 1200, + "total_amount": 228800, + "applied_discount_amount": 1200, + "total_applied_discount_amount": 1200, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "object": "customer" + }, + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92db6e6001f9aa8": { + "date": "2022-10-03T12:17:06.456Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc2dc6404426c0ab3", + "object": "redemption", + "date": "2022-09-28T14:30:56.199Z", + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_6uuhGraDuXMOpVRTJT251kKW", + "source_id": null, + "created_at": "2022-09-28T14:30:54.681Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 800, + "total_discount_amount": 800, + "total_amount": 229200, + "applied_discount_amount": 800, + "total_applied_discount_amount": 800, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "object": "customer" + }, + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2dc6404426c0ab3": { + "date": "2022-09-28T14:30:54.737Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "name": null, + "email": null, + "source_id": "jonny@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc2d6f0ebc95f1783", + "object": "redemption", + "date": "2022-09-28T14:07:07.516Z", + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "tracking_id": "track_ThofCMTQe4EVIo0zvvOlTor1twaQNd7E", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ZQevc2J2sBegsnp5DwanXHsa", + "source_id": null, + "created_at": "2022-09-28T14:07:06.073Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 0, + "total_discount_amount": 0, + "total_amount": 230000, + "applied_discount_amount": 0, + "total_applied_discount_amount": 0, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "object": "customer" + }, + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2d6f0ebc95f1783": { + "date": "2022-09-28T14:07:06.159Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "name": "Bob Smith", + "email": "bob.smith.1@email.com", + "source_id": "bob.smith.1@email.com", + "metadata": { + "lang": "en", + "test": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc2d3c4f7495f159a", + "object": "redemption", + "date": "2022-09-28T13:53:16.057Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ff6rwr58kmdyuLsi5orplnVW", + "source_id": null, + "created_at": "2022-09-28T13:53:14.604Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 800, + "total_discount_amount": 800, + "total_amount": 229200, + "applied_discount_amount": 800, + "total_applied_discount_amount": 800, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2d3c4f7495f159a": { + "date": "2022-09-28T13:53:14.717Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "John Smith", + "email": "john.smith@email.com", + "source_id": "john.smith@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + } + ] + } } + } + } + } + } + } + }, + "post": { + "operationId": "redeem-voucher", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Voucher [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher. \n\n## How discounts and order amounts are calculated in the API response?\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |\n| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |\n| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |\n| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n## SDKs \n\nYou can invoke the redemption endpoint with one of the official libraries: \n\n\n[block:html]\n{\n \"html\": \"
\\n\\n
\\n \\n
\\n\\n
\\n\\n
\\n\\n\\n
\\n\\n\\n\\n\\n\\n
\\n\\n
\\n
\\n\\n\"\n}\n[/block]\n\n## Customer tracking\n\nThe redeem operation is a key part of [Customer tracking] (doc:customer-tracking) workflow. There're 3 ways you can identify your end customer in Voucherify within this request. You can either provide a tracking ID (e.g. your customer's login or a generated id), a customer ID (if the customer is already stored in Voucherify) or a full `customer` object in the payload. Note that you can pass and thus store any customer-related metadata. See examples on the right.\n\n\n```json\n\"customer\": {\n \"source_id\": \"alice.morgan\",\n \"name\": \"Alice Morgan\",\n \"email\": \"alice@morgan.com\",\n \"description\": \"\",\n \"metadata\": {\n \"locale\": \"en-GB\",\n \"shoeSize\": 5,\n \"favourite_brands\": [\"Armani\", \"L’Autre Chose\", \"Vicini\"]\n }\n}\n```\n\nIf you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the redeem function or explicitly by invoking the [Create Customer](ref:create-customer) method, you can identify your customer in redemptions by a generated ID (starting with `cust_`). \n\n\n```json title=Example Customer Identifier [object]\n\"customer\": {\n \"id\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier\n{\n \"customer\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier by Source ID\n{\n \"customer\": \"alice.morgan\"\n}\n```\n\n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).\n\n## Redemption failures\n\nThere are several reasons why a redemption may fail. You will get the reason in the error key:\n - `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified\n\n## Order object\n\nThe purchase of previously defined products (products are stored in Voucherify) by end customers is handled through the order object. You are obligated to pass the order object in case you use validation rules. You can learn more about the [validation rules structure] (doc:validation-rules). \n\n| **Attributes** | **Description** |\n|:---|:---|\n| amount
`integer` | A positive integer representing the total amount for the order. |\n| items
`list` | List of items constituting the order. Order items can be defined either by `product_id` or `sku_id`. Along with every item you must define the `quantity`.

Child attributes:

- `product_id` (*string*) - The ID of the associated product object for this line item.

- `sku_id` (*string*) - The ID of the associated variant (sku) object for this line item.

- `quantity` (*integer*) - A positive integer representing the number of instances of the item that are included in this order line.

- `price` (*integer*) - A positive integer representing the cost of an item.

- `amount` (*integer*) - `quantity` * `price` (you should provide it to retrieve `discount_amount` for a particular order item if the discount is applied only to this item learn more |\n\n\n\n\n> 🚧 Order ID\n>\n> If you use the same order id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order. [Read more in this guide] (https://docs.voucherify.io/docs/manage-stackable-discounts).\n\n\n```json title=Example Order\n\"order\": {\n \"amount\": 10000,\n \"items\": [\n {\n \"product_id\": \"prod_Bi7sRr3kwvxH2I\",\n \"quantity\": 1\n }\n ]\n}\n```\n## Gift Vouchers - redeem Gift Card and control redeemed amount\n\nIn Voucherify,you can also create a gift card for customers. Customers then can use gift card credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.\n\nWhen the user wants to define how many gift credits are to be used from the gift card to complete the order, the `credits` property can be assigned the equivalent value in the lowest currency in the request body. The value of credits being applied to the order cannot be higher than the current balance on the gift card.\n\n\n```cURL title=Example Request - control redeemed amount\ncurl -i -X POST \\\n -H \"Content-Type:application/json\" \\\n -H \"X-App-Id:c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token:3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -d '{\n \"order\": {\n \"amount\": 2500\n },\n \"gift\": {\n \"credits\": 1500\n }\n }' \\ \n 'https://api.voucherify.io/v1/vouchers/aDm4CRR3/redemption'\n```\n## Loyalty Coins - redeem loyalty card and pay with points\n\nVoucherify offers the possibility to set up a reward type in the Loyalty Program, which allows using loyalty points as gift credits. The available balance of credits is counted based on policy rules attached to the reward definition.\n\nIf a user configures just one reward type of paying in points, in the redemption request, there is no additional information required. Voucherify will automatically select as a proper reward definition and will calculate the discount based on the attached policy. \n\n\n```json title=Example Request\n{\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_zv5Qn7cF68RbVX4foKxgwUi1\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:44:20Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 250,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_Tgi2ApelDyl86sm5AYDKCBMZ\",\n \"created_at\": \"2020-05-24T13:44:20Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": \"ltr_3q5dW6GaRC4QkA1oYmfGy1k1\",\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-23T08:18:55Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 489,\n \"balance\": 23\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 8,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 466\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:44:20Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nIn case the user wants to define how much he spends in points, it is configurable by property `points` in a request body.\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 10\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_NJIfNYD8uc2lNm3YBAqXr3FF\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T16:28:29Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_70kKdXIKCSx5cfglKSpz9aHy\",\n \"created_at\": \"2020-05-24T16:28:29Z\",\n \"discount_amount\": 250\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-24T13:44:26Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 539,\n \"balance\": 63\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 9,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 476\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T16:28:29Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nMoreover, it is possible to define many levels of reward in which collected points can be used as gift credits. Per each tier, we can implement different conversion factors. Having many options in the rewards catalog, we will need to select a coins calculation policy (reward ID) that we want to use for calculating a final discount in the redemption request.\n\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 30,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\"\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_se17sLon6YX5wMhYVzfQa2dc\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:41:16Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_EfMmve84JzQIg2MCM3cAvLgF\",\n \"created_at\": \"2020-05-24T13:41:16Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_g3QQwQfhJrjBYzEa1NJkub7N\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\",\n \"name\": \"1 point 25$\",\n \"created_at\": \"2020-05-24T12:57:19Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 25.0\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 439,\n \"balance\": 223\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 7,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 216\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:41:16Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returnee by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. **Although not all information is required, the extra info helps prevent fraud.**" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_voucher" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_redeem_voucher" }, - { - "id": "ern_Ic2AUznt4cJInIl1wt6n0Fbv", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "See page - 3 points", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + "examples": { + "Gift Voucher": { + "value": { + "id": "r_0c5e8a38730ccec0d5", + "object": "redemption", + "date": "2023-01-27T12:34:57.100Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2000, + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 4000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 0, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T12:34:57.102Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 18, + "redeemed_quantity": 1, + "redeemed_amount": 2000, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "gift": { + "amount": 2000 + } + } }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "Discount Coupon": { + "value": { + "id": "r_0c5e8ef10842da0aad", + "object": "redemption", + "date": "2023-01-27T12:55:34.689Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 5700, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "discount_amount": 148, + "applied_discount_amount": 148, + "price": 3000, + "subtotal_amount": 3152 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "discount_amount": 152, + "applied_discount_amount": 152, + "price": 3000, + "subtotal_amount": 3248 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T12:55:34.690Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + } + } }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_KWvcBS3bdmJnWD4BTw29eRNT", - "metadata": { - "Type": "Custom Event - fixed points for viewing a page" - } - }, - { - "id": "ern_4SRj1TY1j8Q617R2Y4qiN1sy", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 1, - "points": 2, - "property": "volume_number" + "Loyalty Card": { + "value": { + "id": "r_0c5e8f2cd78497a372", + "object": "redemption", + "date": "2023-01-27T12:56:35.934Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_MGTimoN4VtSj7iT75bP01FsH", + "source_id": null, + "created_at": "2023-01-27T12:56:35.923Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 0, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8f2cd78497a372": { + "date": "2023-01-27T12:56:35.934Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 6500, + "balance": 5086 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-01-27T12:56:35.935Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1414, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 300 } } - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "See page X - get 2 points multiplied by the page number", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_WWESERcKoTRSbCDal7Hr7H0A", - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" } - }, - { - "id": "ern_WXBa4b5a6N5XZt9A9Nf9dagA", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" + } + } + } + }, + "400": { + "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Voucher disabled": { + "value": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "AnsvocvP", + "request_id": "v-0c5d710a63c4110ae9", + "resource_id": "rf_0c5d710a87c8a31f86", + "resource_type": "redemption", + "error": { + "message": "The voucher has been disabled and cannot be used." } } }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Get 2 points for every month you're a customer for viewing a page", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_zv3mCOeZOaHCsFMG0yIKu0ax", - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on customer metadata" - } - }, - { - "id": "ern_DvdegDzcaMUXzf2fayzCqMEV", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" + "Invalid Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Customer must be a holder of a loyalty card.", + "details": "AnsvocvP", + "request_id": "v-0c5e628bd14411244b", + "resource_id": "rf_0c5e628bf841c7f248", + "resource_type": "redemption", + "error": { + "message": "The customer is invalid." } } }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_fpfYyNcpVskgwcrs21kQ91Wx", - "metadata": { - "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." + "Voucher Inactive": { + "value": { + "code": 400, + "key": "voucher_not_active_now", + "message": "voucher not active now", + "details": "CODE14", + "request_id": "v-0c5e89b9300d820994", + "resource_id": "rf_0c5e89b945d33b9c02", + "resource_type": "redemption", + "error": { + "message": "The voucher is not active in the given timeframe." + } + } } } - ] + } } } } } }, - "400": { - "description": "Returns an error if a parameters is defined incorrectly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_missing_param" + "/client/v1/redeem": { + "post": { + "operationId": "redeem-voucher-client-side", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Voucher (client-side) [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps). \n\nThe client-side redemption works similar to the server-side [voucher redemption](ref:redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.\n\n\n> 📘 Opt-in \n>\n> By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.\n\n\n> ❗️ Security Threat \n>\n> Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.\n\n### Expand Response\nYou may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.\n\n```json\n{\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n}\n```", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "code", + "description": "Voucher code being redeemed.", + "required": true }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Loyalty order rules must contain one of the following properties - 'total_amount'", - "request_id": "v-0c127fa5d4424c8411" + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud." + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_voucher" } } } - } - } - }, - "404": { - "description": "Returns an error if a parameter's value is not found in the respository.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_redeem_voucher" + }, + "examples": { + "Gift Voucher": { + "value": { + "id": "r_0c5e8a38730ccec0d5", + "object": "redemption", + "date": "2023-01-27T12:34:57.100Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2000, + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 4000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 0, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T12:34:57.102Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 18, + "redeemed_quantity": 1, + "redeemed_amount": 2000, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "gift": { + "amount": 2000 + } + } + }, + "Discount Coupon": { + "value": { + "id": "r_0c5e8ef10842da0aad", + "object": "redemption", + "date": "2023-01-27T12:55:34.689Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 5700, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "discount_amount": 148, + "applied_discount_amount": 148, + "price": 3000, + "subtotal_amount": 3152 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "discount_amount": 152, + "applied_discount_amount": 152, + "price": 3000, + "subtotal_amount": 3248 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T12:55:34.690Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + } + } + }, + "Loyalty Card": { + "value": { + "id": "r_0c5e8f2cd78497a372", + "object": "redemption", + "date": "2023-01-27T12:56:35.934Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_MGTimoN4VtSj7iT75bP01FsH", + "source_id": null, + "created_at": "2023-01-27T12:56:35.923Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 0, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8f2cd78497a372": { + "date": "2023-01-27T12:56:35.934Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 6500, + "balance": 5086 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-01-27T12:56:35.935Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1414, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 300 + } + } + } + } + } + } }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find loyalty_tier with id ltr_pudTGWasuIqxdiDM0go31OV1", - "request_id": "v-0c12808f33ce673c42", - "resource_id": "ltr_pudTGWasuIqxdiDM0go31OV1", - "resource_type": "loyalty_tier" + "400": { + "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Voucher disabled": { + "value": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "AnsvocvP", + "request_id": "v-0c5d710a63c4110ae9", + "resource_id": "rf_0c5d710a87c8a31f86", + "resource_type": "redemption", + "error": { + "message": "The voucher has been disabled and cannot be used." + } + } + }, + "Invalid Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Customer must be a holder of a loyalty card.", + "details": "AnsvocvP", + "request_id": "v-0c5e628bd14411244b", + "resource_id": "rf_0c5e628bf841c7f248", + "resource_type": "redemption", + "error": { + "message": "The customer is invalid." + } + } + }, + "Voucher Inactive": { + "value": { + "code": 400, + "key": "voucher_not_active_now", + "message": "voucher not active now", + "details": "CODE14", + "request_id": "v-0c5e89b9300d820994", + "resource_id": "rf_0c5e89b945d33b9c02", + "resource_type": "redemption", + "error": { + "message": "The voucher is not active in the given timeframe." + } + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "ern_CFuv1O0IDl8Jgph0ojhMu8bH" }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "A unique earning rule ID." - } - ], - "get": { - "operationId": "get-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Earning Rule", - "description": "Retrieves an earning rule assigned to a campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the earning rule details.", - "content": { - "application/json": { + "/v1/redemptions/{redemptionId}/rollback": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetEarningRuleResponseBody" + "type": "string" }, - "examples": { - "Custom Event": { - "value": { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - }, - "Order Paid": { - "value": { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - }, - "Segment Entered": { - "value": { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } + "name": "redemptionId", + "in": "path", + "required": true, + "description": "The original redemption ID to be rolled back (undone)." + } + ], + "post": { + "operationId": "rollback-redemption", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Rollback Redemption", + "description": "Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. \n\n ## Effect \nThe operation \n- creates a rollback entry in voucher's redemption history (`redemption.redemption_entries`) and \n- gives 1 redemption back to the pool (decreases `redeemed_quantity` by 1). \n## Returned funds \nIn case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption.", + "parameters": [ + { + "schema": { + "type": "string" }, - "Loyalty Tier Joined": { - "value": { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + "in": "query", + "name": "reason", + "description": "Reason for the rollback." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_rollback_redemption" + }, + "examples": { + "Promotion": { + "value": { + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemons", + "email": "annie@lemon.com", + "phone": "+1 933 222 3334", + "birthday": "1900-12-02", + "birthdate": "1900-12-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "country": "United States", + "postal_code": "100012" + }, + "metadata": { + "age": 23 + } + }, + "order": { + "source_id": "test_rollback_8" + }, "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" + "location_id": [ + "L2" + ] } } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" } } - }, - "Loyalty Tier Left": { - "value": { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption rollback object indicating the result of the rollback.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_rollback_redemption" }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - } - }, - "Loyalty Tier Upgraded": { - "value": { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + "examples": { + "Loyalty Card": { + "value": { + "id": "rr_0c5eba630bc4979e70", + "object": "redemption_rollback", + "date": "2023-01-27T16:05:23.631Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": -2, + "redemption": "r_0c5bf3323008a35032", + "reason": "A UI rollback to check for result in API response to listing.", + "result": "SUCCESS", + "order": { + "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", + "source_id": null, + "created_at": "2023-01-25T12:18:09.203Z", + "updated_at": "2023-01-27T16:05:23.687Z", + "status": "CANCELED", + "amount": 2100, + "total_amount": 2100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 3, + "amount": 2100, + "price": 700, + "subtotal_amount": 2100, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf3323008a35032": { + "date": "2023-01-25T12:18:09.216Z", + "rollback_id": "rr_0c5eba630bc4979e70", + "rollback_date": "2023-01-27T16:05:23.631Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", + "code": "HAPPY-ORDER5My", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "21ceb848-4869-4dac-ba41-f854bda3a101", + "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" + }, + "barcode": { + "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" + } + }, + "is_referral_code": false, + "created_at": "2023-01-25T12:18:09.256Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": -2 + } + } + }, + "Discount Coupon": { + "value": { + "id": "rr_0c5eb002b40cce9d62", + "object": "redemption_rollback", + "date": "2023-01-27T15:20:03.536Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "redemption": "r_0c5e8ef10842da0aad", + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": "2023-01-27T15:20:03.743Z", + "status": "CANCELED", + "amount": 6000, + "total_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "rollback_id": "rr_0c5eb002b40cce9d62", + "rollback_date": "2023-01-27T15:20:03.536Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T15:20:03.707Z", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" + } + } + }, + "Gift Card": { + "value": { + "id": "rr_0c5eb099214ccea115", + "object": "redemption_rollback", + "date": "2023-01-27T15:22:37.573Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": -2000, + "redemption": "r_0c5e8a38730ccec0d5", + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": "2023-01-27T15:22:37.628Z", + "status": "CANCELED", + "amount": 6000, + "total_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "rollback_id": "rr_0c5eb099214ccea115", + "rollback_date": "2023-01-27T15:22:37.573Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 2000, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T15:22:37.595Z", + "redemption": { + "quantity": 18, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "gift": { + "amount": -2000 + } + } + }, + "Promotion Tier": { + "value": { + "id": "rr_0ca286e96cc03f3e76", + "object": "redemption_rollback", + "date": "2023-03-21T07:57:12.526Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": { + "location_id": [ + "L2" + ] + }, + "redemption": "r_0ca286d222d2f7dc1f", + "reason": "To undo a redemption.", + "result": "SUCCESS", + "order": { + "id": "ord_0FR01SqYIxV4ITzgs1yZjkK6", + "source_id": "test_rollback_8", + "created_at": "2023-03-21T07:56:48.634Z", + "updated_at": "2023-03-21T07:57:12.546Z", + "status": "CANCELED", + "amount": 200000, + "total_amount": 200000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" + } + }, + "metadata": { + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ca286d222d2f7dc1f": { + "date": "2023-03-21T07:56:48.651Z", + "rollback_id": "rr_0ca286e96cc03f3e76", + "rollback_date": "2023-03-21T07:57:12.526Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } + } + }, + "channel": { + "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemons", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 23 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 5 + }, + "orders": { + "total_amount": 616000, + "total_discount_amount": 246400 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null, + "category_id": null, + "categories": [] + } } } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - } - }, - "Loyalty Tier Downgraded": { - "value": { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" } } - }, - "Loyalty Tier Prolonged": { - "value": { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } } - } - } - } - } - } - }, - "put": { - "operationId": "update-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Earning Rule", - "description": "Update an earning rule definition.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters that you would like to update for the given earning rule.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_earning_rule" - }, - "examples": { - "Example": { - "value": { - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" - }, - "source": { - "banner": "Order paid 5 points." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - fixed amount of points" + }, + "400": { + "description": "Returns an error if the rollback redemption process failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Already rolledback": { + "value": { + "code": 400, + "key": "already_rolled_back", + "message": "Already rolled back", + "details": "Redemption has been already rolled back.", + "request_id": "v-0c5eb3bd81cd7e3a39", + "resource_id": "rrf_0c5eb3bd884497ed05", + "resource_type": "redemption_rollback" + } + }, + "Invalid Redemption Parent": { + "value": { + "code": 400, + "key": "invalid_redemption_parent", + "message": "Invalid redemption parent", + "details": "You can rollback only a redemption that does not have parent redemption.", + "request_id": "v-0c6382005e03b3bd2f" + } + }, + "Invalid Redemption": { + "value": { + "code": 400, + "key": "invalid_redemption", + "message": "Invalid redemption", + "details": "You can rollback only a single redemption. Use different endpoint for stacked redemption.", + "request_id": "v-0c675e5e2e04e31bb3" + } + }, + "Invalid Order": { + "value": { + "code": 400, + "key": "invalid_order", + "message": "Invalid order", + "details": "Order is not related with redemption.", + "request_id": "v-0ca2770e3fc4047e25" + } + }, + "Invalidate Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Invalid customer", + "details": "Customer is not related with redemption.", + "request_id": "v-0ca284851b0404513f" + } + } + } } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the updated earning rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" }, - "examples": { - "Example": { - "value": { - "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": "2022-11-29T11:30:57.652Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 5 points.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", - "metadata": { - "Type": "Order paid - fixed amount of points" + "404": { + "description": "Returns an error if the rollback redemption process failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Cannot find customer": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_eWgXlBBiY6THFRJwX45Iakv4s", + "request_id": "v-0c5ebc5de80a2cf1a5", + "resource_id": "cust_eWgXlBBiY6THFRJwX45Iakv4s", + "resource_type": "customer" + } + } } } } } } } - } - } - }, - "delete": { - "operationId": "delete-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Earning Rule", - "description": "This method deletes an earning rule for a specific loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the loyalty campaign or earning rule with given ID was not found.", - "content": { - "application/json": { + "/v1/promotions/tiers/{promotionTierId}/redemption": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Earning Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_10S9ijStRZsf65xd12aydn4f", - "request_id": "v-0ae2bdc5f11027e81a", - "resource_id": "ern_10S9ijStRZsf65xd12aydn4f", - "resource_type": "earning_rule" - } - }, - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer Loyalty Campaign", - "request_id": "v-0ae2be04d146b71e50", - "resource_id": "Summer Loyalty Campaign", - "resource_type": "campaign" + "type": "string" + }, + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "ID of the promotion tier to be redeemed." + } + ], + "post": { + "operationId": "redeem-promotion", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Promotion [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a promotion, you create a redemption object passing a context.\n\nYou can retrieve a list of active promotions through the [Validate Promotions](ref:validate-promotions) endpoint. That validation method will return a list of active​ promotion tiers identified by thier IDs. \n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_promotion_tier" + }, + "examples": { + "One product one sku": { + "value": { + "customer": { + "source_id": "annie@lemon.com", + "name": "Annie Lemon", + "email": "annie@lemon.com" + }, + "order": { + "amount": 200000, + "items": [ + { + "source_id": "apple534", + "product_id": "prod_anJ03RZZq74z4v", + "related_object": "product", + "quantity": 2, + "price": 50000, + "product": { + "override": true, + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" + } + }, + "metadata": { + "series": "2022-783CV" + } + }, + { + "sku_id": "sku_0KtP4rvwEECQ2U", + "source_id": "apple534-ihd5", + "related_object": "sku", + "quantity": 1, + "price": 100000, + "sku": { + "override": true, + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } + } + } + ] + } + } + } } } } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { - "schema": { - "type": "string", - "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" - }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "Unique earning rule ID." - } - ], - "post": { - "operationId": "enable-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Enable Earning Rule", - "description": "Enable an earning rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the `active` parameter set to `true`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesEnableEarningRulesResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T14:07:39.460Z", - "loyalty": { - "points": 20, - "type": "FIXED" + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended" }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" + "examples": { + "One product one sku": { + "value": { + "id": "r_0ca2699201c03f121b", + "object": "redemption", + "date": "2023-03-21T05:49:00.807Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_IVEF85NZCXmP4S1fGmImSTwH", + "source_id": null, + "created_at": "2023-03-21T05:49:00.772Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" + } + }, + "metadata": { + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ca2699201c03f121b": { + "date": "2023-03-21T05:49:00.807Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } + } + }, + "channel": { + "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 5 + }, + "orders": { + "total_amount": 616000, + "total_discount_amount": 246400 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_z6MvMg2Zf2UABNWN", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_type": "promotion_tier", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "category_id": null, + "categories": [] + } + } + }, + "Example": { + "value": { + "id": "r_0c64c10b8ece60bd91", + "object": "redemption", + "date": "2023-02-01T08:25:22.235Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_7n58dbLV2jMG4C14XjEYEbjh", + "source_id": null, + "created_at": "2023-02-01T08:25:22.192Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" + } + }, + "metadata": { + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c64c10b8ece60bd91": { + "date": "2023-02-01T08:25:22.235Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } + } + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 3 + }, + "orders": { + "total_amount": 408000, + "total_discount_amount": 163200 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_z6MvMg2Zf2UABNWN", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_type": "promotion_tier", + "object": "validation_rules_assignment" + } + ], + "total": 1 + } + } + } + } } } } - } - } - } - }, - "404": { - "description": "Returns an error if the resource cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_raVUcdXruvXGuzm682ESrAz", - "request_id": "v-0c0d849dde0e6737d9", - "resource_id": "ern_raVUcdXruvXGuzm682ESrAz", - "resource_type": "earning_rule" + "400": { + "description": "Returns an error if the promotion tier is inactive.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Inactive Promotion": { + "value": { + "code": 400, + "key": "promotion_inactive", + "message": "Inactive Promotion", + "details": "Promotion Tier with id: promo_DE1N30D731Tg2F6NoMwNas2W is disabled.", + "request_id": "v-0c64b722160294496b", + "resource_id": "rf_0c64b7223cce60eec6", + "resource_type": "redemption", + "error": { + "message": "The promotion is inactive." + } + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { - "schema": { - "type": "string", - "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "Unique earning rule ID." - } - ], - "post": { - "operationId": "disable-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Disable Earning Rule", - "description": "Disable an earning rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the `active` parameter set to `false`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesDisableEarningRulesResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T14:12:57.167Z", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": false, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" + "/client/v1/redemptions": { + "post": { + "operationId": "redeem-stacked-discounts-client-side", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Redeem Stackable Discounts (client-side)", + "description": "Use this method to redeem up to 5 redeemables in a single API request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions).", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redemption object.
- Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
- Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
- Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
- Returns redemption object `metadata`.
- Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_redemptions" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK", + "key": "session_key" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ], + "metadata": { + "key": "value" + } + } + } } } } } - } - } - }, - "404": { - "description": "Returns an error if the resource cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_A2RArBE30Tkt56utVLrRv7r", - "request_id": "v-0c0d842ed5ce67373f", - "resource_id": "ern_A2RArBE30Tkt56utVLrRv7r", - "resource_type": "earning_rule" + }, + "responses": { + "200": { + "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
`array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
`object` | Represents the final effect of all child redemptions executed during the request. |\n| order
`object` | Represents order details after all discounts are applied. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" + } } } } } } - } - } - } - }, - "/v1/loyalties/members/{memberId}/rewards": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "get": { - "operationId": "list-member-rewards", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Member Rewards", - "description": "Retrieves the list of rewards that the given customer (identified by `member_id`, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. \n\nYou can use the `affordable_only` parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). \n\nPlease note that rewards that are disabled (i.e. set to `Not Available` in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.", - "parameters": [ - { - "in": "query", - "name": "affordable_only", - "description": "Limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Set this flag to `true` to return rewards which the customer can actually afford.", - "schema": { - "type": "boolean" - } - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of rewards for the given `member_id`. Returns a filtered list if the query parameter `affordable_only` is set to `true`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_member_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "reward": { - "id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619" - } - }, - "stock": 4, - "redeemed": 1, - "attributes": { - "description": "Get a Comic Book in Archie's series." - }, - "created_at": "2022-08-17T07:46:18.619169+00:00", - "updated_at": "2022-08-17T08:13:48.30747+00:00", - "metadata": {}, - "object": "reward" + "/v1/validations": { + "post": { + "operationId": "validate-stacked-discounts", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Validate Stackable Discounts", + "description": "Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings.\n \n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_validations" + }, + "examples": { + "1 Redeemable": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } }, - "assignment": { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 39 - } - }, - "created_at": "2022-08-24T11:40:22.418972+00:00", - "updated_at": "2022-08-24T13:23:50.409121+00:00", - "object": "reward_assignment" + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", - "name": "Pay with Points", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 1, - "points_ratio": 1 + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-06-23T11:06:06.222736+00:00", - "updated_at": null, - "metadata": null, - "object": "reward" + ], + "metadata": { + "key": "value" + } + } + } + }, + "5 Redeemables": { + "value": { + "customer": { + "source_id": "36_bob" }, - "assignment": { - "id": "rewa_wrVYAfXWolq52gnl15dumPCq", - "reward_id": "rew_31M6Za6zkMRfhxYJz4aDo11h", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", - "name": "20% discount", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", - "type": "DISCOUNT_COUPONS" + "redeemables": [ + { + "object": "voucher", + "id": "GNcuPKGe" + }, + { + "object": "voucher", + "id": "AnsvocvP", + "reward": { + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" } }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T09:52:39.032699+00:00", - "updated_at": null, - "metadata": {}, - "object": "reward" - }, - "assignment": { - "id": "rewa_nFREw86qh1LiqGPRygahNh8Z", - "reward_id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 + { + "object": "voucher", + "id": "M3X8IwW8", + "gift": { + "credits": 100 } }, - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" + { + "object": "promotion_tier", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W" + }, + { + "object": "promotion_tier", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" + } + ], + "session": { + "type": "LOCK" }, - "object": "loyalty_reward" + "order": { + "items": [ + { + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1 + }, + { + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1 + } + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
`boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
`array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
`object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_validations" + }, + "examples": { + "False": { + "value": { + "valid": false, + "redeemables": [ + { + "status": "INAPPLICABLE", + "id": "eee33463", + "object": "voucher", + "result": { + "error": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id eee33463", + "request_id": "v-0c6c6e20dc42940f0b", + "resource_id": "eee33463", + "resource_type": "voucher" + } + } + }, + { + "status": "SKIPPED", + "id": "promo_Mwy9XpA0TLctSGriM5kum0qp", + "object": "promotion_tier", + "result": {} + } + ], + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==" + } }, - { - "reward": { - "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "name": "Get a product", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b2ac1dab28985cb1e", - "sku_id": null + "True - 5 Redeemables": { + "value": { + "valid": true, + "redeemables": [ + { + "status": "APPLICABLE", + "id": "GNcuPKGe", + "object": "voucher", + "order": { + "amount": 2700, + "items_discount_amount": 1700, + "total_discount_amount": 1700, + "total_amount": 1000, + "items_applied_discount_amount": 1700, + "total_applied_discount_amount": 1700, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ + { + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 3, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS", + "amount_off": 1000, + "is_dynamic": false + } + }, + "metadata": {}, + "categories": [] + }, + { + "status": "APPLICABLE", + "id": "AnsvocvP", + "object": "voucher", + "order": { + "amount": 2700, + "items_discount_amount": 1700, + "total_discount_amount": 1700, + "total_amount": 1000, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { + "loyalty_card": { + "points": 4 + } + }, + "metadata": {}, + "categories": [ + { + "id": "cat_0bb81a481615a37b5e", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-09-20T05:58:01.561Z", + "object": "category" + } + ] + }, + { + "status": "APPLICABLE", + "id": "M3X8IwW8", + "object": "voucher", + "order": { + "amount": 2700, + "discount_amount": 100, + "items_discount_amount": 1700, + "total_discount_amount": 1800, + "total_amount": 900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { + "gift": { + "credits": 100 + } + }, + "metadata": {}, + "categories": [] + }, + { + "status": "APPLICABLE", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "object": "promotion_tier", + "order": { + "amount": 2700, + "discount_amount": 460, + "items_discount_amount": 1700, + "total_discount_amount": 2160, + "total_amount": 540, + "applied_discount_amount": 360, + "total_applied_discount_amount": 360, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ + { + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 1, + "data_ref": "data", + "object": "list" + }, + "result": { + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 40, + "is_dynamic": false + } + }, + "metadata": {} + }, + { + "status": "APPLICABLE", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf", + "object": "promotion_tier", + "order": { + "amount": 2700, + "discount_amount": 490, + "items_discount_amount": 1700, + "total_discount_amount": 2190, + "total_amount": 510, + "applied_discount_amount": 30, + "total_applied_discount_amount": 30, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ + { + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 1, + "data_ref": "data", + "object": "list" + }, + "result": { + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 30, + "is_dynamic": false + } + }, + "metadata": {} } + ], + "order": { + "amount": 2700, + "discount_amount": 490, + "items_discount_amount": 1700, + "total_discount_amount": 2190, + "total_amount": 510, + "applied_discount_amount": 490, + "items_applied_discount_amount": 1700, + "total_applied_discount_amount": 2190, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "stock": 1, - "redeemed": 1, - "attributes": { - "description": "Product" - }, - "created_at": "2022-06-13T10:43:15.929621+00:00", - "updated_at": "2022-08-11T15:59:30.820937+00:00", - "metadata": null, - "object": "reward" + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "session": { + "key": "ssn_pkJfPcWAgp9WyHpA62Eky8X8SzxpKub2", + "type": "LOCK", + "ttl": 7, + "ttl_unit": "DAYS" + } + } + } + } + } + } + }, + "400": { + "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redeemables[1] should have required property 'id'", + "request_id": "v-0b4ff38ab8c8164573" + } + }, + "Duplicated Redeemables": { + "value": { + "code": 400, + "key": "duplicated_redeemables", + "message": "Duplicated redeemables detected", + "details": "Duplicated redeemables detected in one redemption", + "request_id": "v-0b4ffecfb408165300" + } + }, + "Invalid Redeemables": { + "value": { + "code": 400, + "key": "invalid_redeemables", + "message": "Invalid redeemables", + "details": "Promotion Stack cannot be use with other redeemables", + "request_id": "v-0b5007812f48165d6b" + } + } + } + } + } + } + } + } + }, + "/client/v1/validations": { + "post": { + "operationId": "validate-stacked-discounts-client-side", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Validate Stackable Discounts (client-side)", + "description": "Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
- Order data with calculated discounts are listed in each child redeemable object.
- Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
- Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_validations" + }, + "examples": { + "1 Redeemable": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ], + "metadata": { + "key": "value" + } + } + } + }, + "5 Redeemables": { + "value": { + "customer": { + "source_id": "36_bob" }, - "assignment": { - "id": "rewa_SV4gMgPXTXDrsoTyqhY1B2ut", - "reward_id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 4000 - } - }, - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", - "name": "Get a comic book", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": null + "redeemables": [ + { + "object": "voucher", + "id": "GNcuPKGe" + }, + { + "object": "voucher", + "id": "AnsvocvP", + "reward": { + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" } }, - "stock": 1, - "redeemed": 2, - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", - "description": "Archie's Series" + { + "object": "voucher", + "id": "M3X8IwW8", + "gift": { + "credits": 100 + } }, - "created_at": "2022-08-11T14:35:44.694611+00:00", - "updated_at": "2022-08-17T07:52:56.965366+00:00", - "metadata": { - "Type": "GR-2" + { + "object": "promotion_tier", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W" }, - "object": "reward" + { + "object": "promotion_tier", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" + } + ], + "session": { + "type": "LOCK" }, - "assignment": { - "id": "rewa_7HHH6TjN7Q9WDr5ZePeZUg5p", - "reward_id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 + "order": { + "items": [ + { + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1 + }, + { + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1 } - }, - "created_at": "2022-08-11T15:44:12.789086+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_reward" + ] + } } - ], - "total": 5 + } + } + } + } + }, + "responses": { + "200": { + "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
`boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
`array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
`object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_validations" + } + } + } + }, + "400": { + "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redeemables[1] should have required property 'id'", + "request_id": "v-0b4ff38ab8c8164573" + } + }, + "Duplicated Redeemables": { + "value": { + "code": 400, + "key": "duplicated_redeemables", + "message": "Duplicated redeemables detected", + "details": "Duplicated redeemables detected in one redemption", + "request_id": "v-0b4ffecfb408165300" + } + }, + "Invalid Redeemables": { + "value": { + "code": 400, + "key": "invalid_redeemables", + "message": "Invalid redeemables", + "details": "Promotion Stack cannot be use with other redeemables", + "request_id": "v-0b5007812f48165d6b" + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "Unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-details", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Details", - "description": "Get reward details in the context of a loyalty campaign and reward assignment ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns reward details in the context of a loyalty *campaign* and reward assignment ID.", - "content": { - "application/json": { + "/v1/redemptions/{parentRedemptionId}/rollbacks": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" - }, - "examples": { - "Material": { - "value": { - "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "name": "Get a product", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b2ac1dab28985cb1e", - "sku_id": null - } - }, - "stock": "1", - "redeemed": "1", - "attributes": { - "description": "Product" - }, - "created_at": "2022-06-13T10:43:15.929Z", - "updated_at": "2022-08-11T15:59:30.820Z", - "metadata": null, - "object": "reward" - } - }, - "Pay with Points": { - "value": { - "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", - "name": "Pay with Points", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 1, - "points_ratio": 1 - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-06-23T11:06:06.222Z", - "updated_at": null, - "metadata": null, - "object": "reward" + "type": "string" + }, + "name": "parentRedemptionId", + "in": "path", + "required": true, + "description": "Unique identifier of a parent redemption, e.g. `r_JQfm73zWSJFQxs3bGxweYjgm`." + } + ], + "post": { + "operationId": "rollback-stacked-redemptions", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Rollback Stackable Redemptions", + "description": "Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an array with the individual redemption rollback results along with the parent rollback result and related order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_parentRedemptionId_rollbacks" + } } - }, - "Discount Coupon": { - "value": { - "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", - "name": "20% discount", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", - "type": "DISCOUNT_COUPONS" - } + } + }, + "400": { + "description": "Returns an error indicating that the parent redemption ID is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T09:52:39.032Z", - "updated_at": null, - "metadata": {}, - "object": "reward" + "examples": { + "Invalid Redemption Parent": { + "value": { + "code": 400, + "key": "invalid_redemption_parent", + "message": "Invalid redemption parent", + "details": "You can rollback only a redemption that does not have parent redemption.", + "request_id": "v-0b56a1cf1e4d69b375" + } + }, + "Already rolled back": { + "value": { + "code": 400, + "key": "already_rolled_back", + "message": "Already rolled back", + "details": "Redemption has been already rolled back.", + "request_id": "v-0c67af9544c4e3388f", + "resource_id": "rrf_0c67af954e039be56b", + "resource_type": "redemption_rollback" + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/reward-assignments": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-reward-assignments-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Reward Assignments", - "description": "Returns reward assignments from a given loyalty campaign.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:list-reward-assignments-2). The URL was re-designed to be more ontextual to the type of data returned in the response.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" }, - { - "$ref": "#/components/parameters/page" + "/v1/loyalty-campaign-object": { + "get": { + "operationId": "loyalty-campaign-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Campaign Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Campaign Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + } + } + } + } + } + } }, - { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" - }, - "in": "query", - "name": "assignmentId", - "description": "A unique reward assignment ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_2EPffrq151ArmjR7j3CumxGE", - "reward_id": "rew_6uCtsIjgcuzi4NW43mKZQWd5", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 18 - } - }, - "created_at": "2022-06-22T11:02:19.564Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_75e6oBjYfIKUDbM4Dsgg6xAU", - "reward_id": "rew_gI4GYbXMeHAJUAIiZCad5LaS", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 25 - } - }, - "created_at": "2022-06-22T11:00:49.034Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_dJ5nFBpmL8DVhmY1j4zYYOqF", - "reward_id": "rew_VSi5rNvb67bn2tqkNwVBBP7u", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-06-22T10:57:24.051Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_874iVl5bHrZFr2FSsG9ilKzF", - "reward_id": "rew_QQ73sIywuMoEj6L8K6ft2Mn7", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "created_at": "2022-06-22T10:47:55.934Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_GgSlEk4bnR09lMMts6CgR6aV", - "reward_id": "rew_URQeO2fgbjxHnulgYVguuidX", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 9 - } - }, - "created_at": "2022-06-22T10:21:53.109Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_i6VcsXr3ovJ2JCpZk9k1JOj1", - "reward_id": "rew_YNr7tRr9TPAiFEJBZBAsuKCq", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "created_at": "2022-06-22T10:18:27.684Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_YjTw2InYSVx1nA88brDASS9e", - "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 30 - } - }, - "created_at": "2022-06-22T09:58:12.133Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 - } - }, - "created_at": "2022-06-13T11:56:49.185Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_gb6U5byuRh12EvdiL46P4Cxy", - "reward_id": "rew_NQB7WbdQLBrFQW1DZmBNcLvH", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-06-13T11:50:23.429Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_hfyF9IGez9i3z5a3Uwlkcg7S", - "reward_id": "rew_87ItIc9P5Bky10eS7vEm7Dc7", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 20 - } - }, - "created_at": "2022-06-13T11:20:43.961Z", - "updated_at": null, - "object": "reward_assignment" - } - ], - "total": 12 + "/v1/loyalty-card-object": { + "get": { + "operationId": "loyalty-card-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Card Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Card Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/rewards": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-reward-assignments-2", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Reward Assignments", - "description": "Returns active rewards from a given loyalty campaign.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" + "/v1/loyalty-tier-object": { + "get": { + "operationId": "loyalty-tier-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Tier Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Tier Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + } + } + } + } + } + } }, - { - "$ref": "#/components/parameters/page" + "/v1/earning-object": { + "get": { + "operationId": "earning-rule-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Earning Rule Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Earning Rule Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + } + } + } + } + } }, - { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + "/v1/loyalties": { + "get": { + "operationId": "list-loyalty-programs", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Campaigns", + "description": "Returns a list of your loyalty campaigns.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with loyalty program objects. The loyalty campaigns are returned sorted by creation date, with the most recent campaigns appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_loyalty_campaigns" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "campaigns", + "campaigns": [ + { + "id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", + "name": "Loyalty Campaign 1", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description.", + "vouchers_count": 6, + "active": true, + "metadata": { + "Season": "Fall" + }, + "created_at": "2022-11-21T13:57:03.712Z", + "updated_at": "2022-11-23T09:59:49.581Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b6152ce12414820dc", + "categories": [], + "object": "campaign" + }, + { + "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "name": "Loyalty Campaign - Tiers", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LT1-", + "initial_count": 1 + }, + "is_referral_code": false, + "start_date": "2022-11-01T00:00:00.000Z" + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "start_date": "2022-11-01T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "vouchers_count": 3, + "active": true, + "metadata": {}, + "created_at": "2022-11-09T06:26:52.985Z", + "updated_at": "2022-11-10T08:54:46.136Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b8b5a427a0283c854", + "categories": [], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + }, + "object": "campaign" + }, + { + "id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW", + "name": "Loyalty Campaign Example", + "campaign_type": "LOYALTY_PROGRAM", + "type": "STATIC", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "initial_count": 1 + }, + "is_referral_code": false, + "start_date": "2021-12-15T00:00:00.000Z", + "expiration_date": "2021-12-31T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "start_date": "2021-12-15T00:00:00.000Z", + "expiration_date": "2021-12-31T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": false, + "metadata": {}, + "created_at": "2021-12-15T08:02:52.298Z", + "updated_at": "2021-12-15T08:11:43.808Z", + "creation_status": "DRAFT", + "vouchers_generation_status": "DRAFT", + "protected": false, + "category_id": null, + "categories": [], + "object": "campaign" + } + ], + "total": 3 + } + } + } + } + } + } + } }, - "in": "query", - "name": "assignment_id", - "description": "A unique reward assignment ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT", - "reward_id": "rew_pjJKIZgjIopIPZyibEAt7oPk", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "created_at": "2022-08-30T08:24:32.171Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_7gFZsNg8oiry63FtzML0N52R", - "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 3000000 - } + "post": { + "operationId": "create-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Loyalty Campaign", + "description": "Creates a batch of [loyalty cards](ref:get-member) aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern. \n\n\n> 📘 Global uniqueness\n> All codes are unique across the whole project. Voucherify won't allow to generate the same codes in any of your campaigns.\n\n\n> 🚧 Asyncronous action!\n>\n> This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See `creation_status` field in the [loyalty campaign object](ref:get-loyalty-program) description.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the loyalty campaign details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_cards" + }, + "examples": { + "Example": { + "value": { + "name": "Loyalty Program 4", + "description": "This is a campaign description.", + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "start_date": "2016-10-26T00:00:00Z", + "expiration_date": "2024-10-26T00:00:00Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "created_at": "2022-05-13T11:14:58.146Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_eAGhQSY4FS4T3q4zMkiarHoN", - "reward_id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "activity_duration_after_publishing": "P24D", + "category_id": "cat_0b6152ce12414820dc", + "vouchers_count": 2, + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_QUARTER" + } + }, + "redemption": { + "quantity": 2 + }, + "code_config": { + "pattern": "L-CARD-#######" } }, - "created_at": "2022-02-28T11:56:55.241Z", - "updated_at": null, - "object": "reward_assignment" + "metadata": { + "test": true + }, + "type": "STATIC", + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + } } - ], - "total": 3 + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Reward Assignment", - "description": "Add rewards to a loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_create_reward_assignment" - }, - "examples": { - "Example": { - "value": [ - { - "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", - "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 2 - } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": null, - "object": "reward_assignment" + }, + "responses": { + "200": { + "description": "Returns a campaign object with its settings but without the loyalty card codes.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" }, - { - "id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv", - "reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 2 + "examples": { + "Example": { + "value": { + "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", + "name": "Loyalty Program 4", + "campaign_type": "LOYALTY_PROGRAM", + "type": "STATIC", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_QUARTER" + } + }, + "redemption": { + "quantity": 2 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "L-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2016-10-26T00:00:00.000Z", + "expiration_date": "2024-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description.", + "start_date": "2016-10-26T00:00:00.000Z", + "expiration_date": "2024-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "test": true + }, + "created_at": "2022-11-29T13:10:30.848Z", + "category": "New Customers", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b6152ce12414820dc", + "categories": [ + { + "id": "cat_0b6152ce12414820dc", + "name": "New Customers", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + }, + "object": "campaign" } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": null, - "object": "reward_assignment" + } } - ] + } + } + }, + "409": { + "description": "Returns an error if a loyalty campaign with the same name already exists.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + }, + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated campaign exists with name Loyalty Program 2", + "request_id": "v-0c12951ec58e67577e", + "resource_id": "Loyalty Program 2", + "resource_type": "campaign" + } + } + } + } } } } } }, - "409": { - "description": "Returns an error if there's a reward assignment created for the given reward.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "get-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Loyalty Campaign", + "description": "Retrieve a specific loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a loyalty campaign object for a given loyalty campaign ID. ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "name": "Loyalty Campaign - Tiers - 1", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LT1-", + "initial_count": 1 + }, + "is_referral_code": false, + "start_date": "2022-11-01T00:00:00.000Z" + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "start_date": "2022-11-01T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "vouchers_count": 3, + "active": true, + "metadata": {}, + "created_at": "2022-11-09T06:26:52.985Z", + "updated_at": "2022-11-10T08:54:46.136Z", + "category": "Eighth", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b8b5a427a0283c854", + "categories": [ + { + "id": "cat_0b8b5a427a0283c854", + "name": "Eighth", + "hierarchy": 8, + "created_at": "2022-08-16T11:45:54.171Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + }, + "object": "campaign" + } + } + } + } + } }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC", - "request_id": "v-0c11a10ed2ce676da9", - "resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC", - "resource_type": "reward_assignment" + "404": { + "description": "Returns an error if the campaign does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + } } } } } - } - } - }, - "requestBody": { - "description": "Define the cost of the rewards in loyalty points.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_reward_assignment" - }, - "examples": { - "Example": { - "value": [ - { - "reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "parameters": { - "loyalty": { - "points": 2 + }, + "put": { + "operationId": "update-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Update Loyalty Campaign", + "description": "Updates a loyalty program. \n\nFields other than those specified in the allowed request body payload won't be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged. \n\nThis method will update the [loyalty cards](ref:get-member) which have not been published or redeemed yet.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the new values for the parameters that you would like to update for the given loyalty campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_loyalty_campaign" + }, + "examples": { + "Example": { + "value": { + "description": "This is a campaign description. Updated", + "auto_join": false, + "join_once": false, + "start_date": "2013-10-26T00:00:00Z", + "expiration_date": "2025-10-26T00:00:00Z", + "validity_timeframe": { + "duration": "PT2H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P25D", + "category_id": "cat_0b6152ce12414820dd", + "loyalty_card": { + "points": 1, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 4, + "rounding_type": "END_OF_YEAR" + } + }, + "metadata": { + "test": false + }, + "type": "AUTO_UPDATE", + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P4M", + "rounding": { + "type": "CUSTOM", + "unit": "MONTH", + "value": 1 + } + } + } } } - }, - { - "reward": "rew_z35ffKoH0tCcck8EL56p6SIs", - "parameters": { - "loyalty": { - "points": 2 + } + } + } + }, + "responses": { + "200": { + "description": "Returns the loyalty campaign object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", + "name": "Loyalty Program 4", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 4, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 2 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "L-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2013-10-26T00:00:00.000Z", + "expiration_date": "2025-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT2H" + } + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description. Updated", + "start_date": "2013-10-26T00:00:00.000Z", + "expiration_date": "2025-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT2H" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P25D", + "vouchers_count": 2, + "active": true, + "metadata": { + "test": false + }, + "created_at": "2022-11-29T13:10:30.848Z", + "updated_at": "2022-11-29T14:08:30.655Z", + "category": "Lorem_Ipsum", + "creation_status": "MODIFYING", + "vouchers_generation_status": "MODIFYING", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b6152ce12414820dd", + "categories": [ + { + "id": "cat_0b6152ce12414820dd", + "name": "Lorem_Ipsum", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P4M", + "rounding": { + "type": "CUSTOM", + "strategy": "END", + "unit": "MONTH", + "value": 1 + } + } + }, + "object": "campaign" + } } } } - ] + } } } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "Unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve specific reward assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns specific reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 + }, + "delete": { + "operationId": "delete-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Loyalty Campaign", + "description": "This method permanently deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with the same name." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the id of the scheduled asynchronous action, informing you that your request has been accepted and the loyalty campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } } - }, - "created_at": "2022-06-13T11:56:49.185Z", - "updated_at": null, - "object": "reward_assignment" + } } } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/rewards/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-assignment-2", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve specific reward assignment.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:get-reward-assignment-2). ", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns specific reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" }, - "examples": { - "Example": { - "value": { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 + "404": { + "description": "Returns an error indicating that the loyalty campaign with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer Loyalty Perks", + "request_id": "v-0ae2b0092f50c130c7", + "resource_id": "Summer Loyalty Perks", + "resource_type": "campaign" + } } - }, - "created_at": "2022-06-13T11:56:49.185Z", - "updated_at": null, - "object": "reward_assignment" + } } } } } } }, - "404": { - "description": "Returns an error if the reward assignment cannot be found.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/members": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "request_id": "v-0c0be6ee648e67609b", - "resource_id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "resource_type": "reward_assignment" - } - } - } + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID of the loyalty program." } - } - } - } - }, - "put": { - "operationId": "update-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Reward Assignment", - "description": "Updates rewards parameters, i.e. the points cost for the specific reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward assignment with an updated points value.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + ], + "get": { + "operationId": "list-members", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Members", + "description": "Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "examples": { - "Example": { - "value": { - "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", - "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 3 - } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": "2022-11-28T19:27:40.604Z", - "object": "reward_assignment" - } - } + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." } - } - } - } - }, - "requestBody": { - "description": "Update the points cost for the reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_reward_assignment" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "loyalty": { - "points": 3 + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty cards within a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_members" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "vouchers", + "vouchers": [ + { + "id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655", + "code": "0PmQ7JQI", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA%2Fs6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa%2FYCnKkm63TRuX6OgGJoEggbKMg%2BwLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z%2Bz3B1jkALIbjtw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BhrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP%2BBfBtF%2BpyyQpxCeqbQuB%2FOuSnP%2Fnzec6n0n%2FgTb9%2BXcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-04-15T05:48:45.509Z", + "updated_at": "2022-07-01T00:01:57.860Z", + "holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10" + }, + "object": "voucher" + }, + { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" + } + ], + "total": 2 + } + } } } } } } - } - } - } - }, - "delete": { - "operationId": "delete-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Reward Assignment", - "description": "This method deletes a reward assignment for a particular loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the loyalty campaign or reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_0b4hqJpVFssxXXrq56Ddtyo", - "request_id": "v-0ae2b69e0cd0c1364f", - "resource_id": "rewa_0b4hqJpVFssxXXrq56Ddtyo", - "resource_type": "reward_assignment" - } - }, - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Loyalty Summer Campaign", - "request_id": "v-0ae2b71e57d027e263", - "resource_id": "Loyalty Summer Campaign", - "resource_type": "campaign" - } - } + }, + "post": { + "operationId": "add-member", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add Member", + "description": "This method assigns a loyalty card to a customer. It selects a [loyalty card](ref:get-voucher) suitable for publication, adds a publish entry, and returns the published voucher. \n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/redemption": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "post": { - "operationId": "redeem-reward-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Redeem Reward", - "description": "Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_redeem_reward" - }, - "examples": { - "Redeem Reward that adds points to a loyalty card": { - "value": { - "id": "r_0c6b3abbfe8e60a9dd", - "object": "redemption", - "date": "2023-02-06T09:07:55.514Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 1, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6887 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:07:55.515Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", + ], + "requestBody": { + "description": "Provide details to whom the loyalty card should be assigned. \n\nYou can choose to either specify the exact loyalty card code that you want to publish from existin (non-assigned) codes, or choose not to specify a voucher code. If you choose not to specify a code in the request paylaod, then the system will choose the next available voucher code available to be assigned to a customer. \n\nYou can also include metadata in the request payload. This metadata will be assigned to the publication object, but will not be returned in the response to this endpoint. To see of publications (assignments of particular codes to customers) and publication metadata, use the [List Publications](ref:list-publications) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_member" + }, + "examples": { + "Using source ID": { + "value": { + "customer": "source_customer_1", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" + "year": 2022 }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 9, - "redeemed_points": 1113, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "channel": "postman", + "voucher": "KpzbHUY5" } }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", + "Using unique Voucherify assigned ID": { + "value": { + "customer": "cust_8KQmHxAERpgebYcFhSpZRr37", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 1020, - "balance": 890 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-11T08:19:28.780Z", - "updated_at": "2023-01-25T15:44:33.500Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 26, - "redeemed_points": 130, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + "year": 2022 }, - "object": "voucher" - }, - "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", - "object": "reward", - "name": "Present on Loyalty Card", - "created_at": "2023-01-25T15:43:40.716Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "balance": 20, - "type": "LOYALTY_PROGRAM" - } - }, - "type": "CAMPAIGN" + "channel": "postman", + "voucher": "KpzbHUY5" + } }, - "loyalty_card": { - "points": 1 - } - } - }, - "Redeem Reward that adds credits to a gift card": { - "value": { - "id": "r_0c6b3bedf3478a0167", - "object": "redemption", - "date": "2023-02-06T09:13:08.813Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 1, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6886 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + "Using source ID in object": { + "value": { + "customer": { + "source_id": "source_customer_1" }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:13:08.814Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" + "year": 2022 }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1114, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "channel": "postman", + "voucher": "KpzbHUY5" } }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 59080, - "balance": 48780 - }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2023-01-25T14:42:25.214Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", - "object": "reward", - "name": "Present Credits on Gift Card", - "created_at": "2023-01-25T14:41:31.858Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "balance": 4000, - "type": "GIFT_VOUCHERS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 - } - } - }, - "Redeem Reward that gives a discount coupon": { - "value": { - "id": "r_0c6b3ca77e0e60b534", - "object": "redemption", - "date": "2023-02-06T09:16:18.808Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6884 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + "Using unique Voucherify assigned ID in object": { + "value": { + "customer": { + "id": "cust_8KQmHxAERpgebYcFhSpZRr37" }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:16:18.809Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" + "year": 2022 }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 11, - "redeemed_points": 1116, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "channel": "postman", + "voucher": "KpzbHUY5" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the voucher object that was published to the customer provided in the request payload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object" }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0TxKw1bm0oZuS5lwA8526vze1OBMV1OH", + "code": "KpzbHUY5", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", + "category": "New Customers", + "category_id": "cat_0b6152ce12414820dc", + "categories": [ + { + "id": "cat_0b6152ce12414820dc", + "name": "New Customers", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" + } ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_a3Ba1neDwPa3rBE0HkDd0C7CbiehBulo", - "code": "HAPPY-ORDERctb", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "7d646e7d-9b5a-40b6-a44e-6bae848e108e", - "url": "https://dl.voucherify.io/api/v1/assets/qr/7d646e7d-9b5a-40b6-a44e-6bae848e108e" - }, - "barcode": { - "id": "dfb3e48d-ce4f-4187-a114-483feb4ca88d", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/dfb3e48d-ce4f-4187-a114-483feb4ca88d" - } - }, - "is_referral_code": false, - "created_at": "2023-02-06T09:16:18.845Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDERctb/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDERctb/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": { + "Season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+hdZfzUaz448vIsyf7WpvXiDyqFbyw0+P5wMu12w3B5DyYwA7LCSK+Nr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk+ecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BhdZfzUaz448vIsyf7WpvXiDyqFbyw0%2BP5wMu12w3B5DyYwA7LCSK%2BNr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk%2BecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19VRXApVvZ9/ArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw+YeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19VRXApVvZ9%2FArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw%2BYeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-21T15:48:57.860Z", + "updated_at": "2022-11-21T15:49:36.671Z", + "holder_id": "cust_8KQmHxAERpgebYcFhSpZRr37", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/KpzbHUY5/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/KpzbHUY5/publications?page=1&limit=10" + }, + "object": "voucher" } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 2 + } } } - }, - "Redeem a Material reward of a SKU type": { - "value": { - "id": "r_0c6b3d1357878a0813", - "object": "redemption", - "date": "2023-02-06T09:18:09.246Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 6, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6878 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "400": { + "description": "Returns an error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "No Voucher Suitable for Publication": { + "value": { + "code": 400, + "key": "no_voucher_suitable_for_publication", + "message": "Couldn't find any voucher suitable for publication", + "details": "Couldn't create new vouchers for publication", + "request_id": "v-0c086598620e6704dd" } }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:18:09.247Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 12, - "redeemed_points": 1122, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "Voucher already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_ZFjKHQD0d56eMkWkrotJaVbiMuXClRuM' has already been published", + "request_id": "v-0c086aaa7dc24ccfe0" + } } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", - "product": { - "id": "prod_5h0wc453_2", - "source_id": "jonah-nystrom-bourbon", - "name": "Johan & Nyström - Bourbon", - "price": null, - "attributes": [ - "categories", - "description", - "weight" - ], - "metadata": { - "company": "Johan & Nyström", - "showcase": true - }, - "image_url": null, - "created_at": "2021-12-01T08:00:49.418Z", - "updated_at": null, - "object": "product" - }, - "sku": { - "id": "sku_0a3efc9044dd121803", - "source_id": "jonah-nystrom-bourbon-250g", - "product_id": "prod_5h0wc453_2", - "sku": "250g", - "price": 1750, - "currency": null, - "attributes": { - "categories": "Coffee, Whole Bean", - "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", - "weight": 250 - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-01T08:00:49.427Z", - "updated_at": null, - "object": "sku" - }, - "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", - "object": "reward", - "name": "Present - SKU", - "created_at": "2023-01-25T12:10:16.060Z", - "updated_at": "2023-01-25T12:10:59.662Z", - "parameters": { - "product": { - "id": "prod_5h0wc453_2", - "sku_id": "sku_0a3efc9044dd121803" + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code that was specified in the request payload is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id Loyalty_Card", + "request_id": "v-0c086a26de424ccf2f", + "resource_id": "Loyalty_Card", + "resource_type": "voucher" } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 6 + } } } - }, - "Redeem a Material Reward of a Product Type": { - "value": { - "id": "r_0c6b3d8c35546f8673", - "object": "redemption", - "date": "2023-02-06T09:20:13.013Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 4, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@voucherify.io", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6874 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique code that identifies the loyalty card." + } + ], + "get": { + "operationId": "get-member-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member", + "description": "Retrieves the loyalty card with the given member ID (i.e. voucher code).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns loyalty card details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Program", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:20:13.014Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 13, - "redeemed_points": 1126, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@voucherify.io", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "name": "[Sample] Tiered Wire Basket", - "price": 11995, - "attributes": [], - "metadata": { - "source": "bigcommerce", - "bigcommerce_product_categories": [ - 21, - 23 - ] - }, - "image_url": null, - "created_at": "2022-06-03T13:36:16.084Z", - "updated_at": "2022-06-07T09:10:44.644Z", - "object": "product" - }, - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", - "object": "reward", - "name": "Present", - "created_at": "2022-06-13T06:59:01.694Z", - "updated_at": "2023-02-03T15:04:14.102Z", - "parameters": { - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "sku_id": null + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card code assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member", + "description": "Retrieve loyalty card with the given member ID (i.e. voucher code). \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-1). The URL was re-designed to allow you to retrieve loyalty card details without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns loyalty card details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Program", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 4 + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/activities": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "get": { + "operationId": "get-member-activities-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member Activities", + "description": "Retrieves the list of activities for the given member ID related to voucher and customer who is a holder of the voucher.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of event objects related to the loyalty card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_member_activities" + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/activities": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member-activities", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member Activities", + "description": "Retrieves a list of activities for the given loyalty card related to the loyalty and customer who is the holder of the loyalty card.\n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-activities-1). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of event objects related to the loyalty card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_member_activities" } } - }, - "Redeem Pay with Points Reward": { - "value": { - "id": "r_0c6b4142ecc78a21d0", - "object": "redemption", - "date": "2023-02-06T09:36:26.547Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2300, - "result": "SUCCESS", - "order": { - "id": "ord_QBnrJlVWA2EEiZoKOptFROnp", - "source_id": null, - "created_at": "2023-02-06T09:36:26.503Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 45000, - "total_discount_amount": 45000, - "total_amount": 0, - "applied_discount_amount": 45000, - "total_applied_discount_amount": 45000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } - }, - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b4142ecc78a21d0": { - "date": "2023-02-06T09:36:26.547Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/balance": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "post": { + "operationId": "add-remove-loyalty-card-balance-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add or Remove Loyalty Card Balance", + "description": "This method adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the point adjustment along with the expiration mechanism.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_remove_points_balance" + }, + "examples": { + "Add points": { + "value": { + "points": 100, + "expiration_type": "CUSTOM_DATE", + "expiration_date": "2023-05-30" } }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 4574 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:36:26.548Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 14, - "redeemed_points": 3426, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "Deduct points": { + "value": { + "points": -100 } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 2300 } } - }, - "Redeem Pay with Points Reward with a specific amount of points": { - "value": { - "id": "r_0c6b423368146fa4bb", - "object": "redemption", - "date": "2023-02-06T09:40:32.800Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 100, - "result": "SUCCESS", - "order": { - "id": "ord_1L67XS8EYDDp5A4B3k62G2tr", - "source_id": null, - "created_at": "2023-02-06T09:40:32.784Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 43000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } - }, - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 + } + } + }, + "responses": { + "200": { + "description": "Returns a balance object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" + }, + "examples": { + "Add balance": { + "value": { + "points": -100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" } } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b423368146fa4bb": { - "date": "2023-02-06T09:40:32.800Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + "Deduct balance": { + "value": { + "points": -100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + } } } + } + } + } + }, + "400": { + "description": "Returns an error if the expiration date was defined incorrectly in the request payload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8500, - "balance": 4974 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + "examples": { + "Invalid expiration date": { + "value": { + "code": 400, + "key": "invalid_expiration_date", + "message": "Invalid Expiration Date", + "details": "Expiration date cannot be set in the past", + "request_id": "v-0c118b1611424ca899" } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:40:32.801Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 15, - "redeemed_points": 3526, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 100 } } } @@ -74305,301 +67782,229 @@ } } }, - "404": { - "description": "Returns an error if the campaign was not found.", - "content": { - "application/json": { + "/v1/loyalties/members/{memberId}/balance": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "MmFAzfDe" }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id :campaignId", - "request_id": "v-0c6b39288084e3435a", - "resource_id": ":campaignId", - "resource_type": "campaign" + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "post": { + "operationId": "add-remove-loyalty-card-balance", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add or Remove Loyalty Card Balance", + "description": "This method gives adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:add-remove-loyalty-card-balance-1). The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the point adjustment along with the expiration mechanism.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_remove_points_balance" + }, + "examples": { + "Subtract points": { + "value": { + "points": -100 + } + }, + "Add Points": { + "value": { + "points": 100, + "expiration_type": "CUSTOM_DATE", + "expiration_date": "2023-05-30" + } + } } } } - } - } - } - }, - "requestBody": { - "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_redeem_reward" }, - "examples": { - "Pay with Points": { - "value": { - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "points": 100 - }, - "order": { - "items": [ - { - "product_id": "prod_0c5d6689b39320059b", - "quantity": "1" - }, - { - "product_id": "prod_0b2c36568000039138", - "quantity": "2" + "responses": { + "200": { + "description": "Returns a balance object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" + }, + "examples": { + "Subtract Points": { + "value": { + "points": 100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + } + } } - ] + } + } + } + }, + "400": { + "description": "Returns an error if the expiration date was specified incorrectly in the request payload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .expiration_date cannot be recognized as a ISO-8601 compliant date", + "request_id": "v-0c118c6f7c0e6751ab" + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/members/{memberId}/redemption": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "post": { - "operationId": "redeem-reward", - "tags": [ - "LOYALTIES API" - ], - "summary": "Redeem Reward", - "description": "\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:redeem-reward-1). The URL was re-designed to allow you to redeem a reward without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/members/{memberId}/transfers": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/8_res_redeem_reward" - }, - "examples": { - "Redeem Pay with Points Reward with a specific number of Points": { - "value": { - "id": "r_0c6b4bf721439bf02b", - "object": "redemption", - "date": "2023-02-06T10:23:12.517Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 100, - "result": "SUCCESS", - "order": { - "id": "ord_71Ayjxq2gFV80v3OP3qrxh37", - "source_id": null, - "created_at": "2023-02-06T10:23:12.485Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 43000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination)." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination)." + } + ], + "post": { + "operationId": "transfer-points", + "tags": [ + "LOYALTIES API" + ], + "summary": "Transfer Loyalty Points", + "description": "Transfer points between different loyalty cards. You need to provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters in the URL. In the request body, you provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_transfer_loyalty_points" + }, + "examples": { + "Example": { + "value": [ { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } + "code": "0PmQ7JQI", + "points": 1 }, { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b4bf721439bf02b": { - "date": "2023-02-06T10:23:12.517Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + "code": "kCeufB8i", + "points": 1 } - } + ] + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a loyalty card object for the loaded loyalty card, ie. the one that that points were transferred to from the other cards(s).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 9000, - "balance": 5374 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + "examples": { + "Example": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Proportional Earning Rules", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13441, + "balance": 13141, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-28T17:58:25.607Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T10:23:12.517Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 16, - "redeemed_points": 3626, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 100 } } } @@ -74607,4303 +68012,8366 @@ } } }, - "400": { - "description": "Returns an error indicating that a reward is missing.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/members/{memberId}/transactions": { + "parameters": [ + { "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/e_400_missing_reward" - }, - { - "$ref": "#/components/schemas/e_400_missing_order" - }, - { - "$ref": "#/components/schemas/e_400_loyalty_card_points_exceeded" + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." + } + ], + "get": { + "operationId": "list-loyalty-card-transactions-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Card Transactions", + "description": "Retrieve transaction data related to point movements for a specific loyalty card.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty card transaction objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dd3c2e392f78613", + "source_id": "20230317_transfer_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": "Transferring points to card", + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1396, + "object": "balance", + "points": -1, + "balance": 1396, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1102, + "balance": 1102, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 102 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9dd3c2e392f78614", + "created_at": "2023-03-17T16:20:33.807Z" + }, + { + "id": "vtx_0c9dd2527696ba081b", + "source_id": "20230317_add_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Adding points to card", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1397, + "object": "balance", + "points": 100, + "balance": 1397, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:14:16.524Z" + }, + { + "id": "vtx_0c9dd1ce1d403f4204", + "source_id": "20230317_subtract_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Subtracting points from card", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1297, + "object": "balance", + "points": -1, + "balance": 1297, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:12:00.981Z" + }, + { + "id": "vtx_0c9c21df658d03ce3f", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "Automation", + "reason": null, + "type": "POINTS_ACCRUAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1298, + "object": "balance", + "points": 200, + "balance": 1298, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_QZEKPzYATFjGoos4DonMg0fd", + "source_id": "s" + }, + "event": { + "id": "evcus_0c9c21def34e3c05bf", + "type": "customer.order.paid" + }, + "earning_rule": { + "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", + "source": { + "banner": "Order paid" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-16T08:44:52.333Z" + }, + { + "id": "vtx_0c9b09673f8a862a51", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REFUND", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 1000, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null + }, + "redemption": { + "id": "r_0c9b08fe4b80897849" + }, + "rollback": { + "id": "rr_0c9b0967244a862a33" + }, + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:19:29.149Z" + }, + { + "id": "vtx_0c9b08fe530089785c", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REDEMPTION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": -1000, + "balance": 98, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null + }, + "redemption": { + "id": "r_0c9b08fe4b80897849" + }, + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:17:41.708Z" + }, + { + "id": "vtx_0c9b074afed3b30e4b", + "source_id": "20230309_add_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer purchased points at kiosk.", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 100, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:10:15.917Z" + }, + { + "id": "vtx_0c9b073072408969d1", + "source_id": "20230309_subtract_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer used points to obtain tickets.", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 998, + "object": "balance", + "points": -1, + "balance": 998, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:09:48.735Z" + }, + { + "id": "vtx_0c9afe802593b34b80", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": null, + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 999, + "object": "balance", + "points": -1, + "balance": 999, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1001, + "balance": 1001, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 1 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9afe802593b34b81", + "created_at": "2023-03-15T11:31:51.062Z" + } + ], + "has_more": false + } + } + } } - ] + } } } } }, - "404": { - "description": "Returns an error indicating a resource was not found.", - "content": { - "application/json": { + "/v1/loyalties/members/{memberId}/transactions": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." + } + ], + "get": { + "operationId": "list-loyalty-card-transactions", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Card Transactions", + "description": "Retrieve transaction data related to point movements for a specific loyalty card.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "examples": { - "Member Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id :memberId", - "request_id": "v-0c6b4b525d8e40cf3e", - "resource_id": ":memberId", - "resource_type": "voucher" + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty card transaction objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dd3c2e392f78613", + "source_id": "20230317_transfer_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": "Transferring points to card", + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1396, + "object": "balance", + "points": -1, + "balance": 1396, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1102, + "balance": 1102, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 102 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9dd3c2e392f78614", + "created_at": "2023-03-17T16:20:33.807Z" + }, + { + "id": "vtx_0c9dd2527696ba081b", + "source_id": "20230317_add_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Adding points to card", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1397, + "object": "balance", + "points": 100, + "balance": 1397, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:14:16.524Z" + }, + { + "id": "vtx_0c9dd1ce1d403f4204", + "source_id": "20230317_subtract_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Subtracting points from card", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1297, + "object": "balance", + "points": -1, + "balance": 1297, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:12:00.981Z" + }, + { + "id": "vtx_0c9c21df658d03ce3f", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "Automation", + "reason": null, + "type": "POINTS_ACCRUAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1298, + "object": "balance", + "points": 200, + "balance": 1298, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_QZEKPzYATFjGoos4DonMg0fd", + "source_id": "s" + }, + "event": { + "id": "evcus_0c9c21def34e3c05bf", + "type": "customer.order.paid" + }, + "earning_rule": { + "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", + "source": { + "banner": "Order paid" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-16T08:44:52.333Z" + }, + { + "id": "vtx_0c9b09673f8a862a51", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REFUND", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 1000, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null + }, + "redemption": { + "id": "r_0c9b08fe4b80897849" + }, + "rollback": { + "id": "rr_0c9b0967244a862a33" + }, + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:19:29.149Z" + }, + { + "id": "vtx_0c9b08fe530089785c", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REDEMPTION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": -1000, + "balance": 98, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null + }, + "redemption": { + "id": "r_0c9b08fe4b80897849" + }, + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:17:41.708Z" + }, + { + "id": "vtx_0c9b074afed3b30e4b", + "source_id": "20230309_add_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer purchased points at kiosk.", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 100, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:10:15.917Z" + }, + { + "id": "vtx_0c9b073072408969d1", + "source_id": "20230309_subtract_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer used points to obtain tickets.", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 998, + "object": "balance", + "points": -1, + "balance": 998, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:09:48.735Z" + }, + { + "id": "vtx_0c9afe802593b34b80", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": null, + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 999, + "object": "balance", + "points": -1, + "balance": 999, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + }, + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1001, + "balance": 1001, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 1 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9afe802593b34b81", + "created_at": "2023-03-15T11:31:51.062Z" + } + ], + "has_more": false + } + } + } } } } } } - } - }, - "requestBody": { - "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_redeem_reward" - }, - "examples": { - "Pay with Points": { - "value": { - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "points": 100 + }, + "/v1/loyalties/members/{memberId}/transactions/export": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." + } + ], + "post": { + "operationId": "export-loyalty-card-transactions", + "tags": [ + "LOYALTIES API" + ], + "summary": "Export Loyalty Card Transactions", + "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters and filters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" }, - "order": { - "items": [ - { - "product_id": "prod_0c5d6689b39320059b", - "quantity": "1" + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_transactions_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", + "object": "export", + "created_at": "2023-03-21T13:50:43.286Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "LOYALTY-CARD-2IAoDNF" + ] + } + } + } + }, + "result": null, + "user_id": null + } }, - { - "product_id": "prod_0b2c36568000039138", - "quantity": "2" + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null + } } - ] + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/tiers": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique loyalty campaign ID or name." - } - ], - "get": { - "operationId": "list-loyalty-tiers", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tiers", - "description": "Retrieve a list of loyalty tiers which were added to the loyalty program.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty tier objects.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/members/{memberId}/transactions/export": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "name": "Bottom", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": {}, - "created_at": "2022-11-10T12:20:52.755Z", - "updated_at": "2022-11-25T11:27:58.616Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 1 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 5 - } - }, - "rewards": { - "rewa_t88DnSdNnE0IzQX6gqH3jHGQ": { - "type": "MULTIPLY", - "multiplier": 4 - } - }, - "config": { - "points": { - "from": 1, - "to": 249 - } - }, - "points": { - "from": 1, - "to": 249 - }, - "object": "loyalty_tier" - }, - { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1", - "name": "Middle", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": {}, - "created_at": "2022-11-10T12:20:52.755Z", - "updated_at": "2022-11-25T11:27:58.579Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 2 - } - }, - "rewards": {}, - "config": { - "points": { - "from": 250, - "to": 499 - } - }, - "points": { - "from": 250, - "to": 499 - }, - "object": "loyalty_tier" + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." + } + ], + "post": { + "operationId": "export-loyalty-card-transactions-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Export Loyalty Card Transactions", + "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
- `POINTS_ADDITION`
- `POINTS_REMOVAL`
- `POINTS_TRANSFER_OUT`
- `POINTS_ACCRUAL`
- `POINTS_REFUND`
- `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
- `voucherify-web-ui`
- `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters and filters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_transactions_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", + "object": "export", + "created_at": "2023-03-21T13:50:43.286Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "LOYALTY-CARD-2IAoDNF" + ] + } + } + } + }, + "result": null, + "user_id": null + } }, - { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 - } - }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 - } - }, - "config": { - "points": { - "from": 500, - "to": 1000 - } - }, - "points": { - "from": 500, - "to": 1000 - }, - "object": "loyalty_tier" + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } } - ], - "total": 3 + } } } } } } - } - } - }, - "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": { + }, + "/v1/loyalties/{campaignId}/members/{memberId}/points-expiration": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltiesCreateTiersResponseBody" - } + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Loyalty card code." } - } - } - }, - "requestBody": { - "description": "Provide tier definitions you want to add to existing loyalty campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesCreateTiersRequestBody" + ], + "get": { + "operationId": "get-points-expiration", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Points Expiration", + "description": "Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the [Exports API](ref:create-export) to retrieve a list of both `ACTIVE` and `EXPIRED` point buckets.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty points expiration buckets along with an expiration date if the points are due to expire. No expiration date parameter is returned if the loyalty points bucket does not expire.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "lopb_ERSwDxeWTlvWwFrn3AtJxt3s", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 2 + }, + "status": "ACTIVE", + "expires_at": "2022-11-25", + "created_at": "2022-11-25T09:10:20.994Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 12 + }, + "status": "ACTIVE", + "expires_at": "2022-11-30", + "created_at": "2022-11-21T13:49:54.949Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_Mg80vhZtqHFItWlJFYZ2rJAS", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 0 + }, + "status": "ACTIVE", + "expires_at": "2023-05-30", + "created_at": "2022-06-09T11:07:07.344Z", + "updated_at": "2022-08-30T08:34:45.989Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_dQE1TwyTkHAJDlVCPlqSC0nu", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 13124 + }, + "status": "ACTIVE", + "created_at": "2022-02-28T12:13:57.749Z", + "updated_at": "2022-11-25T09:09:51.136Z", + "object": "loyalty_points_bucket" + } + ], + "total": 4 + } + } + } + } + } + } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/tiers/{tierId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique loyalty campaign ID or name." - }, - { - "schema": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique loyalty tier ID." - } - ], - "get": { - "operationId": "get-loyalty-tier", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Loyalty Tier", - "description": "Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a loyalty tier object.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/points-expiration/export": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltyTier" - }, - "examples": { - "Example": { - "value": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + } + ], + "post": { + "operationId": "create-points-expiration-export", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Points Expiration Export", + "description": "Schedule the generation of a points expiration CSV file for a particular campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the data filters, types of data to return and order in which the results should be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_export_points_expirations" + }, + "examples": { + "Specific Vouchers": { + "value": { + "parameters": { + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "order": "-expires_at", + "filters": { + "junction": "and", + "voucher_id": { + "conditions": { + "$in": [ + "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" + ] + } + } + } + } } }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 + "Specific campaign": { + "value": { + "parameters": { + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "order": "-expires_at", + "filters": { + "junction": "and", + "campaign_id": { + "conditions": { + "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + } + } + } + } } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an object with the export ID of the scheduled generation of CSV file with exported points expirations. You can use either the [Get Export](ref:get-export) endpoint to view the status and obtain the URL of the CSV file or [Download Export](ref:download-export) endpoint to download the CSV file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_object_points_expiration" }, - "config": { - "points": { - "from": 500, - "to": 1000 + "examples": { + "Specific Vouchers": { + "value": { + "id": "exp_zC3eXAFss17XTMzMkkov4KGq", + "object": "export", + "created_at": "2022-11-28T13:00:23.621Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "points_expiration", + "parameters": { + "order": "-expires_at", + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "filters": { + "junction": "and", + "voucher_id": { + "conditions": { + "$in": [ + "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" + ] + } + } + } + }, + "result": null, + "user_id": null + } + }, + "Specific Campaign": { + "value": { + "id": "exp_kfwVDMsavDHl2vOY6vH9q7P7", + "object": "export", + "created_at": "2022-11-28T16:46:34.148Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "points_expiration", + "parameters": { + "order": "-expires_at", + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "filters": { + "junction": "and", + "campaign_id": { + "conditions": { + "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + } + } + } + }, + "result": null, + "user_id": null + } } - }, - "points": { - "from": 500, - "to": 1000 - }, - "object": "loyalty_tier" + } } } } } } - } - } - } - }, - "/v1/loyalties/members/{memberId}/tiers": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "MmFAzfDe" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "get": { - "operationId": "get-member-loyalty-tier", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Member's Loyalty Tiers", - "description": "Retrieve member tiers using the loyalty card ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a data array containing the member's loyalty tiers.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/earning-rules": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 - } - }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 - } - }, - "config": { - "points": { - "from": 500, - "to": 1000 - } - }, - "points": { - "from": 500, - "to": 1000 - }, - "expiration": { - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "tier_id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "start_date": "2022-11-10", - "expiration_date": "2023-02-28", - "created_at": "2022-11-09T11:26:26.719Z", - "updated_at": "2022-11-10T08:54:47.200Z" - }, - "object": "loyalty_tier" + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "list-earning-rules", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Earning Rules", + "description": "Returns a list of all earning rules within a given campaign.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of earning rules.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_earning_rules" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", + "created_at": "2022-11-10T12:25:12.927Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 100, + "type": "FIXED" + }, + "segment": { + "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" + }, + "event": "customer.segment.entered", + "source": { + "banner": "New Customers", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", + "metadata": {} + }, + { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T07:31:42.778Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" + } + }, + { + "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", + "created_at": "2022-11-24T14:48:36.567Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1000, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", + "metadata": { + "Type": "Order has been paid - Proportional - 1" + } + }, + { + "id": "ern_jwtacKdEEHoc85QbouRw3CR8", + "created_at": "2022-11-24T15:17:11.539Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1100, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", + "metadata": { + "Type": "Order has been paid - Proportional - 2" + } + }, + { + "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", + "created_at": "2022-11-24T15:20:04.392Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 10, + "points": 2, + "property": "number_of_store_visits" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", + "metadata": { + "Type": "Order has been paid - Proportional - 3 - Metadata" + } + }, + { + "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", + "created_at": "2022-11-24T15:23:44.514Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 1000, + "points": 3, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", + "metadata": { + "Type": "Order has been paid - Proportional - 4" + } + }, + { + "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", + "created_at": "2022-11-24T15:44:45.301Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 1000, + "points": 4, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", + "metadata": { + "Type": "Order has been paid - Proportional - 5 - Items" + } + }, + { + "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", + "created_at": "2022-11-24T15:56:58.710Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 10000, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", + "metadata": {} + }, + { + "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", + "created_at": "2022-11-24T16:19:20.571Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 5, + "property": "customer_life_time_value" + } + } + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered Segment", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", + "metadata": {} + }, + { + "id": "ern_L8dFanPxJzhw0f5voTwPurGP", + "created_at": "2022-11-24T16:27:13.917Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", + "metadata": { + "Type": "Fixed" + } + }, + { + "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", + "created_at": "2022-11-24T16:41:48.830Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 2, + "points": 2, + "property": "volume_number" + } + } + }, + "custom_event": { + "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "event": "user_subscribed", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", + "metadata": { + "Type": "Event" + } + }, + { + "id": "ern_afo3Ea760hAKv07JYpycnhiE", + "created_at": "2022-11-24T16:50:12.945Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 3, + "property": "customer_life_time_value" + } + } + }, + "custom_event": { + "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" + }, + "event": "cart_abandoned", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", + "metadata": {} + }, + { + "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", + "created_at": "2022-11-24T16:51:31.595Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier joined - Any", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", + "metadata": { + "Type": "Tier joined - any - fixed" + } + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "total": 18 + } } - ], - "total": 1 + } } } } } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { - "schema": { - "type": "string", - "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique tier ID." - } - ], - "get": { - "operationId": "list-loyalty-tier-earning-rules", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tier Earning Rules", - "description": "Retrieve available earning rules for a given tier and the calculation method for earning points.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of earning rules for a given tier. The object for each earning rule also contains information about how the points are calculated; this includes mapping. If a specific multiplier was used to calculate points for a given tier, then the `loyalty.points` parameter will account for this calculation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" - }, - "examples": { - "example-1": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "created_at": "2022-11-09T06:26:54.332Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 300, - "property": "customer_life_time_value" - } + }, + "post": { + "operationId": "create-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Earning Rule", + "description": "Create earning rules for a loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Customize the request body based on the type of earning rules you would like to create. The request body is an array of objects. The required minimum properties to include in the payload for each object are `event` and `loyalty`. Additionally, if you choose to add a `validity_timeframe`, you must include a `start_date`. Furthermore, an earning rule `event` type: \n\n- `customer.segment.entered` requires a `segment` object\n- a custom event requires a `custom_event` object\n- a `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged` requires a `loyalty_tier` object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_earning_rules" + }, + "examples": { + "Example": { + "value": [ + { + "event": "order.paid", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "FIXED", + "points": "5" + }, + "source": { + "banner": "Order paid 5 points." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - fixed amount of points" } }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1, + "points": 1 + } + } + }, + "source": { + "banner": "Order paid - 1 point for 1 dollar spent excluding discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order amount" + } }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_bfi69WIbztany4iX6prkKbGN", - "metadata": { - "Type": "Joined Any" - } - }, - { - "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", - "created_at": "2022-11-10T12:25:12.927Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 300, - "type": "FIXED" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1, + "points": 1 + } + } + }, + "source": { + "banner": "Order paid - 1 point for 1 dollar spent including discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order total amount" + } }, - "segment": { - "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 2, + "points": 1, + "property": "number_of_store_visits" + } + } + }, + "source": { + "banner": "Order paid - 2 points for each store visit." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to numerical order metadata property " + } }, - "event": "customer.segment.entered", - "source": { - "banner": "New Customers", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 2, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "source": { + "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order items amount" + } }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", - "metadata": {} - }, - { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T09:48:26.284Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 20, - "type": "FIXED" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 2, + "points": 1, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "source": { + "banner": "Order paid - 2 points for every dollar spent on the product collection." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order items subtotal amount" + } }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_QUANTITY", + "order_items": { + "quantity": { + "every": 1, + "points": 1, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "source": { + "banner": "Order paid - 1 point for every brand phone in your cart." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." + } }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" - } - }, - { - "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", - "created_at": "2022-11-24T14:48:36.567Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1000, - "points": 1 + { + "event": "order.paid", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } } + }, + "source": { + "banner": "Order paid 1 point for 1 month of being a customer with us." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - points proportional to customer metadata property" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", - "metadata": { - "Type": "Order has been paid - Proportional - 1" - } - }, - { - "id": "ern_jwtacKdEEHoc85QbouRw3CR8", - "created_at": "2022-11-24T15:17:11.539Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1100, - "points": 1 + { + "event": "customer.segment.entered", + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } } + }, + "source": { + "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Entered segment - points proportional to customer metadata property" } }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", - "metadata": { - "Type": "Order has been paid - Proportional - 2" - } - }, - { - "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", - "created_at": "2022-11-24T15:20:04.392Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 10, - "points": 2, - "property": "number_of_store_visits" - } + { + "event": "customer.segment.entered", + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "FIXED", + "points": "5" + }, + "source": { + "banner": "Customer entered birthday segment - 5 points" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Entered segment - fixed points" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", - "metadata": { - "Type": "Order has been paid - Proportional - 3 - Metadata" - } - }, - { - "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", - "created_at": "2022-11-24T15:23:44.514Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 1000, - "points": 3, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" - } + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "See page - 3 points" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - fixed points for viewing a page" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", - "metadata": { - "Type": "Order has been paid - Proportional - 4" - } - }, - { - "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", - "created_at": "2022-11-24T15:44:45.301Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 1000, - "points": 4, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 1, + "points": 2, + "property": "volume_number" + } } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "See page X - get 2 points multiplied by the page number" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", - "metadata": { - "Type": "Order has been paid - Proportional - 5 - Items" - } - }, - { - "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", - "created_at": "2022-11-24T15:56:58.710Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 10000, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "Get 2 points for every month you're a customer for viewing a page" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on customer metadata" } }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", - "metadata": {} - }, - { - "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", - "created_at": "2022-11-24T16:19:20.571Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 5, - "property": "customer_life_time_value" + { + "event": "customer.loyalty.tier.prolonged", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } } + }, + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." } - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered Segment", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", - "metadata": {} - }, - { - "id": "ern_L8dFanPxJzhw0f5voTwPurGP", - "created_at": "2022-11-24T16:27:13.917Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", - "metadata": { - "Type": "Fixed" } - }, - { - "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", - "created_at": "2022-11-24T16:41:48.830Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { + ] + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an array of earning rule objects.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + }, + "examples": { + "Example": { + "value": [ + { + "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 5 points.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", "metadata": { - "every": 2, - "points": 2, - "property": "volume_number" + "Type": "Order paid - fixed amount of points" } - } - }, - "custom_event": { - "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "event": "user_subscribed", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", - "metadata": { - "Type": "Event" - } - }, - { - "id": "ern_afo3Ea760hAKv07JYpycnhiE", - "created_at": "2022-11-24T16:50:12.945Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + }, + { + "id": "ern_Ov5RWerVFubVSjIHOMco34dv", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for 1 dollar spent excluding discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_2R4x6pMFVEIPz1Lhz5ZVo33Y", "metadata": { - "every": 3, - "points": 3, - "property": "customer_life_time_value" + "Type": "Order paid- points proportional to order amount" } - } - }, - "custom_event": { - "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" - }, - "event": "cart_abandoned", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", - "metadata": {} - }, - { - "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", - "created_at": "2022-11-24T16:51:31.595Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier joined - Any", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", - "metadata": { - "Type": "Tier joined - any - fixed" - } - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + }, + { + "id": "ern_5rWPz4arGlTv4FVc1vETeFfe", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for 1 dollar spent including discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_fXasfs6Eh7P2haZkI33PEumI", "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" + "Type": "Order paid- points proportional to order total amount" } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + }, + { + "id": "ern_Xs3o43dHr1O3RM5ojoeu1l6b", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 2, + "points": 1, + "property": "number_of_store_visits" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for each store visit.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_jucMzF25jisrqiG3k6JyyviT", "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" + "Type": "Order paid- points proportional to numerical order metadata property " } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { + }, + { + "id": "ern_9CjMBP2V8zgpsHLga4YOQo0A", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 2, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_y60lx7XsW1YdOOOFuDaYjvG4", "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + "Type": "Order paid- points proportional to order items amount" } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" + }, + { + "id": "ern_uI7hRj8PNodK8xWRsn3gpDdG", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 2, + "points": 1, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for every dollar spent on the product collection.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_Lk1WROGexXA72FabUWhR1p7X", + "metadata": { + "Type": "Order paid- points proportional to order items subtotal amount" + } + }, + { + "id": "ern_dL13AmZEO0ToImOY44YUP1ru", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_QUANTITY", + "order_items": { + "quantity": { + "every": 1, + "points": 1, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for every brand phone in your cart.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_4F9iJG0hmKTiqSsmkfbB8vUF", + "metadata": { + "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." + } + }, + { + "id": "ern_ublD9yGhxPrd9ayPAMTc4aOZ", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1 point for 1 month of being a customer with us.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_raft7C1hVw427OnEobmzhXjD", + "metadata": { + "Type": "Order paid - points proportional to customer metadata property" + } + }, + { + "id": "ern_6tBwufmR7UNJInhZq8zNRrj5", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } + } + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_mQ8SCABGLnrGMBbh8QS6DUpX", + "metadata": { + "Type": "Entered segment - points proportional to customer metadata property" + } + }, + { + "id": "ern_yBR0JtdcDyJXgZf30C8KQLPw", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Customer entered birthday segment - 5 points", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_Co7zjgYPIKZ45vcK0jn7qrY8", + "metadata": { + "Type": "Entered segment - fixed points" + } + }, + { + "id": "ern_Ic2AUznt4cJInIl1wt6n0Fbv", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "See page - 3 points", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_KWvcBS3bdmJnWD4BTw29eRNT", + "metadata": { + "Type": "Custom Event - fixed points for viewing a page" + } + }, + { + "id": "ern_4SRj1TY1j8Q617R2Y4qiN1sy", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 1, + "points": 2, + "property": "volume_number" + } + } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "See page X - get 2 points multiplied by the page number", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_WWESERcKoTRSbCDal7Hr7H0A", + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + } + }, + { + "id": "ern_WXBa4b5a6N5XZt9A9Nf9dagA", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Get 2 points for every month you're a customer for viewing a page", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_zv3mCOeZOaHCsFMG0yIKu0ax", + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on customer metadata" + } + }, + { + "id": "ern_DvdegDzcaMUXzf2fayzCqMEV", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_fpfYyNcpVskgwcrs21kQ91Wx", + "metadata": { + "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." + } + } + ] + } + } + } + } + }, + "400": { + "description": "Returns an error if a parameters is defined incorrectly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_missing_param" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Loyalty order rules must contain one of the following properties - 'total_amount'", + "request_id": "v-0c127fa5d4424c8411" } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T09:48:26.506Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" + } + } + } + } + }, + "404": { + "description": "Returns an error if a parameter's value is not found in the respository.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find loyalty_tier with id ltr_pudTGWasuIqxdiDM0go31OV1", + "request_id": "v-0c12808f33ce673c42", + "resource_id": "ltr_pudTGWasuIqxdiDM0go31OV1", + "resource_type": "loyalty_tier" } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 25, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} } - ], - "total": 19 + } } } } } } - } - } - } - }, - "/v1/loyalties/{campaignId}/tiers/{tierId}/rewards": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { - "schema": { - "type": "string", - "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique tier ID." - } - ], - "get": { - "operationId": "list-loyalty-tier-rewards", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tier Rewards", - "description": "Get available rewards for a given tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty tier reward objects.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "reward": { - "id": "rew_QuWYsBNB2G3fikffjnl0G3gH", - "name": "API - Testing", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "balance": 500, - "type": "LOYALTY_PROGRAM" - } + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "ern_CFuv1O0IDl8Jgph0ojhMu8bH" + }, + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "A unique earning rule ID." + } + ], + "get": { + "operationId": "get-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Earning Rule", + "description": "Retrieves an earning rule assigned to a campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the earning rule details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetEarningRuleResponseBody" + }, + "examples": { + "Custom Event": { + "value": { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" }, - "stock": null, - "redeemed": null, - "created_at": "2022-08-25T09:32:04.579424+00:00", - "updated_at": "2022-08-25T09:33:46.680639+00:00", - "metadata": { - "Type": "Second campaign" + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" }, - "object": "reward" - }, - "assignment": { - "id": "rewa_3Z2sP0bmqcL0ggU28GvFeHU3", - "reward_id": "rew_QuWYsBNB2G3fikffjnl0G3gH", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 40 - } + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "created_at": "2022-11-23T22:11:58.759092+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } }, - { - "reward": { - "id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", - "name": "Material", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } + "Order Paid": { + "value": { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" }, - "stock": 2, - "redeemed": 1, - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", - "description": "Archie's Series" + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "created_at": "2022-08-29T06:02:36.753873+00:00", - "updated_at": "2022-11-08T08:01:26.883166+00:00", - "metadata": { - "Type": "Material" + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "object": "reward" - }, - "assignment": { - "id": "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k", - "reward_id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 30 - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + }, + "Segment Entered": { + "value": { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "created_at": "2022-11-23T22:11:58.759092+00:00", + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + }, + "Loyalty Tier Joined": { + "value": { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + } }, - { - "reward": { - "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "name": "100 Points = $20", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 + "Loyalty Tier Left": { + "value": { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } } }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-09-09T06:41:54.496035+00:00", + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + } + }, + "Loyalty Tier Upgraded": { + "value": { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", "updated_at": null, - "metadata": {}, - "object": "reward" - }, - "assignment": { - "id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", - "reward_id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "created_at": "2022-11-09T11:01:21.065681+00:00", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + } + }, + "Loyalty Tier Downgraded": { + "value": { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + } + }, + "Loyalty Tier Prolonged": { + "value": { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } } - ], - "total": 3 + } } } } } - } - } - } - } - }, - "/v1/customer-object": { - "get": { - "operationId": "customer-object", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Customer Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - } - } - } - } - } - } - }, - "/v1/customer-activity-object": { - "get": { - "operationId": "customer-activity-object", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Customer Activity Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Activity Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_activity_object" - } - } - } - } - } - } - }, - "/v1/customers": { - "get": { - "operationId": "list-customers", - "tags": [ - "CUSTOMERS API" - ], - "summary": "List Customers", - "description": "Returns a list of customers.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "email", - "description": "Limit the customers to the ones that have this specific email address." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Limit the customers to the ones that are located in the specified city.", - "name": "city" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Filter customers by the name property.", - "name": "name" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "source_id", - "-source_id" - ] }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "starting_after", - "description": "A cursor for use in pagination. This is a date-time value that defines your place in the list based on `created_at` property from the customer object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list. \n\n| **Option** | **Format** | **Sorting** |\n|:---|:---|:---|\n| Return customers **before** a specific creation date | - set `starting_after` parameter to the breakpoint date | Sorting order is **descending**; the most recent dates first and least recent dates last. |\n| Return customers **after** a specific create or update date | - include the `order` parameter set to `created_at` or `updated_at`
- set `starting_after` to the breakpoint date | Sorting order is **ascending**; the least recent dates first and the most recent dates last. |\n" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with customer objects. The customers are returned sorted by creation date, with the most recent customers appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_res_list_customers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "customers", - "customers": [ - { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "source_id": "source_123", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 1, - "total_failed": 0, - "total_succeeded": 1, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 4200 - } - }, - "orders": { - "total_amount": 1600, - "total_count": 1, - "average_amount": 1600, - "last_order_amount": 1600, - "last_order_date": "2022-08-30T10:17:39.220Z" - } - }, + "put": { + "operationId": "update-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Update Earning Rule", + "description": "Update an earning rule definition.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters that you would like to update for the given earning rule.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_earning_rule" + }, + "examples": { + "Example": { + "value": { + "validation_rule_id": "val_7SxpdhPeBngA", "loyalty": { - "points": 2200, - "referred_customers": 0, - "campaigns": { - "Christmas Campaign": { - "points": 1000, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Summer Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 1000, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 1, - "campaigns": [ - { - "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", - "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "related_object_id": "r_0b9d4c5121d64dd01d", - "related_object_type": "redemption", - "date": "2022-08-30T10:17:41.089Z" - } - ] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-08-30T06:32:07.380Z", - "updated_at": "2022-08-30T10:17:58.049Z", - "object": "customer" - }, - { - "id": "cust_X0hU04x7FeisPnD5lctZcQkI", - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-02", - "address": { - "city": "New Yorke", - "state": "NY", - "line_1": "123 Main Ste.", - "line_2": "APT 3 BLG 4e", - "country": "United Statese", - "postal_code": "10001e" - }, - "summary": { - "redemptions": { - "total_redeemed": 4, - "total_failed": 0, - "total_succeeded": 4, - "total_rolled_back": 1, - "total_rollback_failed": 0, - "total_rollback_succeeded": 1, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 15549 - } - }, - "orders": { - "total_amount": 210000, - "total_count": 3, - "average_amount": 70000, - "last_order_amount": 70000, - "last_order_date": "2022-08-30T11:51:08.029Z" - } + "type": "FIXED", + "points": "5" }, - "loyalty": { - "points": 15399, - "referred_customers": 0, - "campaigns": { - "Christmas Campaign": { - "points": 7000, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 2299, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 25, - "referred_customers": 0 - }, - "Summer Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 6000, - "referred_customers": 0 - } - } + "source": { + "banner": "Order paid 5 points." }, - "referrals": { - "total": 2, - "campaigns": [ - { - "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", - "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "related_object_id": "r_0b9d4cc4aa164dd073", - "related_object_type": "redemption", - "date": "2022-08-30T10:19:39.196Z" - }, - { - "campaign_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "related_object_id": "r_0b9d61b6484ead0324", - "related_object_type": "redemption", - "date": "2022-08-30T11:51:10.445Z" - } - ] + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], "metadata": { - "lang": "en", - "test": false - }, - "system_metadata": {}, - "created_at": "2022-08-09T09:50:53.620Z", - "updated_at": "2022-08-30T11:51:24.327Z", - "object": "customer" + "Type": "Order paid - fixed amount of points" + } } - ], - "total": 2 + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Create Customer", - "description": "Creates a customer object.\n\n\n\n> 📘 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Create a customer with specified parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_create_customer" }, - "examples": { - "Example": { - "value": { - "source_id": "source_123", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-01-01" + "responses": { + "200": { + "description": "Returns the updated earning rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": "2022-11-29T11:30:57.652Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 5 points.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", + "metadata": { + "Type": "Order paid - fixed amount of points" + } + } + } + } + } } } } - } - } - }, - "responses": { - "200": { - "description": "Returns a customer object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "examples": { - "Example": { - "value": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "source_id": "source_123", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 0, - "total_failed": 0, - "total_succeeded": 0, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 0 + }, + "delete": { + "operationId": "delete-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Earning Rule", + "description": "This method deletes an earning rule for a specific loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the loyalty campaign or earning rule with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Earning Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_10S9ijStRZsf65xd12aydn4f", + "request_id": "v-0ae2bdc5f11027e81a", + "resource_id": "ern_10S9ijStRZsf65xd12aydn4f", + "resource_type": "earning_rule" } }, - "orders": { - "total_amount": 0, - "total_count": 0, - "average_amount": 0, - "last_order_amount": 0 + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer Loyalty Campaign", + "request_id": "v-0ae2be04d146b71e50", + "resource_id": "Summer Loyalty Campaign", + "resource_type": "campaign" + } } - }, - "loyalty": { - "points": 0, - "referred_customers": 0, - "campaigns": {} - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-08-30T06:32:07.380Z", - "object": "customer" + } } } } } } - } - } - } - }, - "/v1/customers/{customerId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or `source_id`." - } - ], - "get": { - "operationId": "get-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Get Customer", - "description": "Retrieve customer details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a customer object if a valid identifier was provided.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" }, - "examples": { - "Example": { - "value": { - "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "source_id": "alice.morgan@email.com", - "name": "Alice Morgan", - "email": "alice.morgan@email.com", - "address": null, - "summary": { - "redemptions": { - "total_redeemed": 2, - "total_failed": 0, - "total_succeeded": 2, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 3303 - } - }, - "orders": { - "total_amount": 203900, - "total_count": 2, - "average_amount": 101950, - "last_order_amount": 3900, - "last_order_date": "2022-07-26T14:59:52.814Z" - } - }, - "loyalty": { - "points": 3303, - "referred_customers": 0, - "campaigns": { - "Summer Campaign": { - "points": 3303, - "referred_customers": 0 + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" + }, + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "Unique earning rule ID." + } + ], + "post": { + "operationId": "enable-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Enable Earning Rule", + "description": "Enable an earning rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the `active` parameter set to `true`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesEnableEarningRulesResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T14:07:39.460Z", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" + } } } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "system_metadata": {}, - "created_at": "2022-02-07T08:28:23.644Z", - "updated_at": "2022-07-26T14:59:59.806Z", - "assets": { - "cockpit_url": "https://www.url.com" - }, - "object": "customer" + } } } - } - } - } - }, - "404": { - "description": "Not Found. When requesting the ID of a customer that has been deleted or does not exist in the system, the resource will not be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_sehkNIi8Uq2qQuRqSr7xn4Z", - "request_id": "v-0b4c590350857970df", - "resource_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Z", - "resource_type": "customer" + "404": { + "description": "Returns an error if the resource cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_raVUcdXruvXGuzm682ESrAz", + "request_id": "v-0c0d849dde0e6737d9", + "resource_id": "ern_raVUcdXruvXGuzm682ESrAz", + "resource_type": "earning_rule" + } + } + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Delete Customer", - "description": "This method deletes a customer.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the customer with given ID was not found.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" }, - "examples": { - "Customer Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_7pm0hh0yemiydeFsdYXZlr1", - "request_id": "v-0ae398fd9ac683dc84", - "resource_id": "cust_7pm0hh0yemiydeFsdYXZlr1", - "resource_type": "customer" - } - } - } - } - } - } - } - }, - "put": { - "operationId": "update-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer", - "description": "Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customer" + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." }, - "examples": { - "Example": { - "value": { - "name": "Alice McDonald", - "email": "alice.mdconald@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-01-01", - "birthday": "2022-01-02" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a customer object if updates were successful.", - "content": { - "application/json": { + { "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" + "type": "string", + "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" }, - "examples": { - "Example": { - "value": { - "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "source_id": "alice@morgan.com", - "name": "Alice McDonald", - "description": "Updating customer data", - "email": "alice.mdconald@email.com", - "phone": "+1 (132) 222-2222", - "birthday": "2022-01-02", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 2, - "total_failed": 0, - "total_succeeded": 2, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 4428 + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "Unique earning rule ID." + } + ], + "post": { + "operationId": "disable-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Disable Earning Rule", + "description": "Disable an earning rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the `active` parameter set to `false`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesDisableEarningRulesResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T14:12:57.167Z", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": false, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } } - }, - "orders": { - "total_amount": 203900, - "total_count": 2, - "average_amount": 101950, - "last_order_amount": 3900, - "last_order_date": "2022-07-26T14:59:52.814Z" } - }, - "loyalty": { - "points": 3403, - "referred_customers": 0, - "campaigns": { - "Summer Campaign": { - "points": 0, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 3303, - "referred_customers": 0 + } + } + } + }, + "404": { + "description": "Returns an error if the resource cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_A2RArBE30Tkt56utVLrRv7r", + "request_id": "v-0c0d842ed5ce67373f", + "resource_id": "ern_A2RArBE30Tkt56utVLrRv7r", + "resource_type": "earning_rule" } } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-02-07T08:28:23.644Z", - "updated_at": "2022-08-31T09:58:30.475Z", - "object": "customer" + } } } } } } }, - "404": { - "description": "Returns an error indicating that a customer with given ID was not found.", - "content": { - "application/json": { + "/v1/loyalties/members/{memberId}/rewards": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "MmFAzfDe" }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id alice2@morgan.com", - "request_id": "v-0b9e924dd243bf26e2", - "resource_id": "alice2@morgan.com", - "resource_type": "customer" - } + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "list-member-rewards", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Member Rewards", + "description": "Retrieves the list of rewards that the given customer (identified by `member_id`, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. \n\nYou can use the `affordable_only` parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). \n\nPlease note that rewards that are disabled (i.e. set to `Not Available` in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.", + "parameters": [ + { + "in": "query", + "name": "affordable_only", + "description": "Limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Set this flag to `true` to return rewards which the customer can actually afford.", + "schema": { + "type": "boolean" } } - } - } - } - } - } - }, - "/v1/customers/{customerId}/permanent-deletion": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or `source_id`." - } - ], - "post": { - "operationId": "delete-customer-permanently", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Delete Customer Permanently", - "description": "The organization user can remove consumer data permanently from the Voucherify system by using this API method. It d​eletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a permanent deletion object and status of the deletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_permanent_deletion_response_body" - }, - "examples": { - "Example": { - "value": { - "id": "del_7k3buMvBsJuXiLRmdh1WZvZs", - "created_at": "2022-09-02T17:50:29.302Z", - "related_object_id": "cust_XI8sPLvznzVpNI1BMIWGcUJa", - "related_object": "customer", - "status": "DONE", - "data_json": { - "events": 16, - "customer_events": 28, - "daily_events": 0, - "segments": 0, - "orders": 9, - "order_events": 5, - "customer": 1 - }, - "object": "pernament_deletion" + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of rewards for the given `member_id`. Returns a filtered list if the query parameter `affordable_only` is set to `true`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_member_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "reward": { + "id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "name": "Material Reward", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619" + } + }, + "stock": 4, + "redeemed": 1, + "attributes": { + "description": "Get a Comic Book in Archie's series." + }, + "created_at": "2022-08-17T07:46:18.619169+00:00", + "updated_at": "2022-08-17T08:13:48.30747+00:00", + "metadata": {}, + "object": "reward" + }, + "assignment": { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 39 + } + }, + "created_at": "2022-08-24T11:40:22.418972+00:00", + "updated_at": "2022-08-24T13:23:50.409121+00:00", + "object": "reward_assignment" + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", + "name": "Pay with Points", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 1, + "points_ratio": 1 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-06-23T11:06:06.222736+00:00", + "updated_at": null, + "metadata": null, + "object": "reward" + }, + "assignment": { + "id": "rewa_wrVYAfXWolq52gnl15dumPCq", + "reward_id": "rew_31M6Za6zkMRfhxYJz4aDo11h", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "created_at": "2022-08-11T14:13:34.581194+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", + "name": "20% discount", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", + "type": "DISCOUNT_COUPONS" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T09:52:39.032699+00:00", + "updated_at": null, + "metadata": {}, + "object": "reward" + }, + "assignment": { + "id": "rewa_nFREw86qh1LiqGPRygahNh8Z", + "reward_id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 + } + }, + "created_at": "2022-08-11T14:13:34.581194+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "name": "Get a product", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b2ac1dab28985cb1e", + "sku_id": null + } + }, + "stock": 1, + "redeemed": 1, + "attributes": { + "description": "Product" + }, + "created_at": "2022-06-13T10:43:15.929621+00:00", + "updated_at": "2022-08-11T15:59:30.820937+00:00", + "metadata": null, + "object": "reward" + }, + "assignment": { + "id": "rewa_SV4gMgPXTXDrsoTyqhY1B2ut", + "reward_id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 4000 + } + }, + "created_at": "2022-08-11T14:13:34.581194+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", + "name": "Get a comic book", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": null + } + }, + "stock": 1, + "redeemed": 2, + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-11T14:35:44.694611+00:00", + "updated_at": "2022-08-17T07:52:56.965366+00:00", + "metadata": { + "Type": "GR-2" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_7HHH6TjN7Q9WDr5ZePeZUg5p", + "reward_id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-08-11T15:44:12.789086+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" + } + ], + "total": 5 + } + } + } } } } } } }, - "404": { - "description": "Returns an error indicating that a customer with given ID was not found.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_W8n9I8pJDXlM69j49iKJeYp", - "request_id": "v-0b4c62635a154e96f1", - "resource_id": "cust_W8n9I8pJDXlM69j49iKJeYp", - "resource_type": "customer" - } - } - } - } - } - } - } - } - }, - "/v1/customers/importCSV": { - "post": { - "operationId": "import-customers-using-csv", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Import and Update Customers using CSV", - "description": "This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas. \n\n## Request Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/customers/importCSV \\\n -F file=@/path/to/customers.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n## CSV File Format\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.\n\n\n> 📘 Standard customer fields mapping\n>\n> **No spaces allowed in field names** \n> Name, Email, Phone, Birthdate, Source_id, Address_line_1, Address_line_2, Address_Postal_Code, Address_City, Address_State, Address_Country, Description, Metadata_name_1, Metadata_name_2\n\n## Update Customers using CSV\n\nIf you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " }, - "examples": {} - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { + { "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + "name": "assignmentId", + "in": "path", + "required": true, + "description": "Unique reward assignment ID." } - } - } - } - } - }, - "/v1/customers/bulk/async": { - "post": { - "operationId": "update-customers-in-bulk", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customers in bulk", - "description": "Update several customers in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the customer fields that you would like to update in each customer object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_update_in_bulk_request_body" - }, - "examples": { - "Example": { - "value": [ - { - "source_id": "John.Smith@email.com", - "name": "John Smith", - "email": "john.smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "2022-04-04" - }, - { - "source_id": "Jane.Smith@email.com", - "name": "Jane Smith", - "email": "Jane.Smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "2022-03-03" - }, - { - "source_id": "Sally.Smith@email.com", - "name": "Sally Smith", - "email": "Sally.Smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-02-02" - } - ] + ], + "get": { + "operationId": "get-reward-details", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Details", + "description": "Get reward details in the context of a loyalty campaign and reward assignment ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + ], + "responses": { + "200": { + "description": "Returns reward details in the context of a loyalty *campaign* and reward assignment ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" + }, + "examples": { + "Material": { + "value": { + "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "name": "Get a product", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b2ac1dab28985cb1e", + "sku_id": null + } + }, + "stock": "1", + "redeemed": "1", + "attributes": { + "description": "Product" + }, + "created_at": "2022-06-13T10:43:15.929Z", + "updated_at": "2022-08-11T15:59:30.820Z", + "metadata": null, + "object": "reward" + } + }, + "Pay with Points": { + "value": { + "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", + "name": "Pay with Points", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 1, + "points_ratio": 1 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-06-23T11:06:06.222Z", + "updated_at": null, + "metadata": null, + "object": "reward" + } + }, + "Discount Coupon": { + "value": { + "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", + "name": "20% discount", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", + "type": "DISCOUNT_COUPONS" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T09:52:39.032Z", + "updated_at": null, + "metadata": {}, + "object": "reward" + } + } + } + } + } } } } }, - "400": { - "description": "Returns an error if metadata fields are incorrect data type or a customer's source ID is missing in the request body.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/reward-assignments": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" }, - "examples": { - "Metadata validation failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'true')", - "request_id": "v-0afb29d91094432cea" - } + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "list-reward-assignments-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Reward Assignments", + "description": "Returns reward assignments from a given loyalty campaign.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:list-reward-assignments-2). The URL was re-designed to be more ontextual to the type of data returned in the response.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" }, - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'source_id'", - "request_id": "v-0ba51a2f5ec3bf76de" + "in": "query", + "name": "assignmentId", + "description": "A unique reward assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with reward assignment objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rewa_2EPffrq151ArmjR7j3CumxGE", + "reward_id": "rew_6uCtsIjgcuzi4NW43mKZQWd5", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 18 + } + }, + "created_at": "2022-06-22T11:02:19.564Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_75e6oBjYfIKUDbM4Dsgg6xAU", + "reward_id": "rew_gI4GYbXMeHAJUAIiZCad5LaS", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 25 + } + }, + "created_at": "2022-06-22T11:00:49.034Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_dJ5nFBpmL8DVhmY1j4zYYOqF", + "reward_id": "rew_VSi5rNvb67bn2tqkNwVBBP7u", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 + } + }, + "created_at": "2022-06-22T10:57:24.051Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_874iVl5bHrZFr2FSsG9ilKzF", + "reward_id": "rew_QQ73sIywuMoEj6L8K6ft2Mn7", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "created_at": "2022-06-22T10:47:55.934Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_GgSlEk4bnR09lMMts6CgR6aV", + "reward_id": "rew_URQeO2fgbjxHnulgYVguuidX", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 9 + } + }, + "created_at": "2022-06-22T10:21:53.109Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_i6VcsXr3ovJ2JCpZk9k1JOj1", + "reward_id": "rew_YNr7tRr9TPAiFEJBZBAsuKCq", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "created_at": "2022-06-22T10:18:27.684Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_YjTw2InYSVx1nA88brDASS9e", + "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 30 + } + }, + "created_at": "2022-06-22T09:58:12.133Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_gb6U5byuRh12EvdiL46P4Cxy", + "reward_id": "rew_NQB7WbdQLBrFQW1DZmBNcLvH", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 + } + }, + "created_at": "2022-06-13T11:50:23.429Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_hfyF9IGez9i3z5a3Uwlkcg7S", + "reward_id": "rew_87ItIc9P5Bky10eS7vEm7Dc7", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 20 + } + }, + "created_at": "2022-06-13T11:20:43.961Z", + "updated_at": null, + "object": "reward_assignment" + } + ], + "total": 12 + } + } + } } } } } } }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/rewards": { + "parameters": [ + { "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "default": 429 - }, - "message": { - "type": "string", - "default": "Too many requests hit the API too quickly." - } - } - } + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " } - } - } - } - } - }, - "/v1/customers/metadata/async": { - "post": { - "operationId": "update-customers-metadata-in-bulk", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customers' Metadata in bulk", - "description": "Update several customers metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "List the `source_ids` of the customer's you would like to update along with the metadata key value pairs.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body" - }, - "examples": { - "Example": { - "value": { - "source_ids": [ - "source_123", - "source_456" - ], - "metadata": { - "lang": "en", - "test": false + ], + "get": { + "operationId": "list-reward-assignments-2", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Reward Assignments", + "description": "Returns active rewards from a given loyalty campaign.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + }, + "in": "query", + "name": "assignment_id", + "description": "A unique reward assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with reward assignment objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT", + "reward_id": "rew_pjJKIZgjIopIPZyibEAt7oPk", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "created_at": "2022-08-30T08:24:32.171Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_7gFZsNg8oiry63FtzML0N52R", + "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 3000000 + } + }, + "created_at": "2022-05-13T11:14:58.146Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_eAGhQSY4FS4T3q4zMkiarHoN", + "reward_id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 + } + }, + "created_at": "2022-02-28T11:56:55.241Z", + "updated_at": null, + "object": "reward_assignment" + } + ], + "total": 3 + } + } + } } } } } - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + }, + "post": { + "operationId": "create-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Reward Assignment", + "description": "Add rewards to a loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of reward assignment objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_create_reward_assignment" + }, + "examples": { + "Example": { + "value": [ + { + "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", + "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 2 + } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv", + "reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 2 + } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": null, + "object": "reward_assignment" + } + ] + } + } } } - } - } - } - }, - "400": { - "description": "An error will be returned when submitting a request with no source IDs or missing metadata.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" }, - "examples": { - "Not enough source IDs": { - "value": { - "code": 400, - "key": "not_enough_source_ids", - "message": "Not enough source_ids", - "details": "Specify at least 1 source_id", - "request_id": "v-0ba50abf2843bf6585" - } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'metadata'", - "request_id": "v-0ba50c720789984b5c" + "409": { + "description": "Returns an error if there's a reward assignment created for the given reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC", + "request_id": "v-0c11a10ed2ce676da9", + "resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC", + "resource_type": "reward_assignment" + } + } + } } } } - } - } - } - } - } - }, - "/v1/customers/{customerId}/consents": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify unique customer identifier or source ID." - } - ], - "put": { - "operationId": "update-customers-consents", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer's consents", - "description": "Update marketing permissions for the specified customer.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customers_consents" }, - "examples": { - "Example": { - "value": { - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, - "cnst_VCmucIvAsmDYw2PPAok6bcYy": false - } - }, - "Opt-out of all": { - "value": { - "unsubscribed": true + "requestBody": { + "description": "Define the cost of the rewards in loyalty points.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_reward_assignment" + }, + "examples": { + "Example": { + "value": [ + { + "reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "parameters": { + "loyalty": { + "points": 2 + } + } + }, + { + "reward": "rew_z35ffKoH0tCcck8EL56p6SIs", + "parameters": { + "loyalty": { + "points": 2 + } + } + } + ] + } + } } } } } - } - }, - "responses": { - "204": { - "description": "Returns no content if the consents were updated successfully." }, - "400": { - "description": "Returns an error if the payload is empty.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "The payload cannot be empty", - "request_id": "v-0ba675252cc3bf6b03" + "name": "assignmentId", + "in": "path", + "required": true, + "description": "Unique reward assignment ID." + } + ], + "get": { + "operationId": "get-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve specific reward assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns specific reward assignment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + } + } + } } } } } } - } - } - } - }, - "/client/v1/customers/{customerId}/consents#": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer identifier or `source_id`" - } - ], - "put": { - "operationId": "update-customers-consents-client-side", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer's consents (client-side)", - "description": "Update marketing permissions for the specified customer.", - "parameters": [], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customers_consents" + "/v1/loyalties/{campaignId}/rewards/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " }, - "examples": { - "Example": { - "value": { - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, - "cnst_VCmucIvAsmDYw2PPAok6bcYy": false - } + { + "schema": { + "type": "string", + "example": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH" }, - "Opt-out of all": { - "value": { - "unsubscribed": true - } - } + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique reward assignment ID." } - } - } - }, - "responses": { - "204": { - "description": "Returns no content if the consents were updated successfully." - }, - "400": { - "description": "Returns an error if the payload is empty.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + ], + "get": { + "operationId": "get-reward-assignment-2", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve specific reward assignment.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:get-reward-assignment-2). ", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns specific reward assignment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + } + } + } + } + } }, - "examples": { - "Example": { - "value": {} + "404": { + "description": "Returns an error if the reward assignment cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "request_id": "v-0c0be6ee648e67609b", + "resource_id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "resource_type": "reward_assignment" + } + } + } + } } } } - } - } - } - } - }, - "/v1/customers/{customerId}/activities": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or source ID of the customer who performed the activities." - } - ], - "get": { - "operationId": "list-customer-activities", - "tags": [ - "CUSTOMERS API" - ], - "summary": "List Customer Activities", - "description": "Retrieve customer activities.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/order" - }, - { - "schema": { - "type": "string" }, - "in": "query", - "name": "starting_after", - "description": "A cursor for use in pagination. `starting_after` is a date-time value that defines your place in the list based on `created_at` property from the activity object. For instance, if you make a list request and receive 100 objects, ending with an object created at 2020-05-24T13:43:09.024Z, your subsequent call can include starting_after=2020-05-24T13:43:09.024Z in order to fetch the next page of the list." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "starting_after_id", - "description": "By applying this filter value, you will get events starting after an event with the given ID." - }, - { - "schema": { - "enum": [ - "DISCOUNT_COUPONS", - "REFERRAL_PROGRAM", - "GIFT_VOUCHERS", - "PROMOTION", - "LOYALTY_PROGRAM" + "put": { + "operationId": "update-reward-assignment-1", + "tags": [ + "LOYALTIES API" ], - "type": "string" - }, - "in": "query", - "name": "campaign_type", - "description": "Through this parameter you can control a type of campaign by which Voucherify will filter related customer's activity. API will return only records related to that given type. Allowed values: DISCOUNT_COUPONS, REFERRAL_PROGRAM, GIFT_VOUCHERS, PROMOTION, LOYALTY_PROGRAM" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign_id", - "description": "By applying this parameter you request only events related to specific campaign identified by its ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with customer activities.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_res_list_customer_activities" + "summary": "Update Reward Assignment", + "description": "Updates rewards parameters, i.e. the points cost for the specific reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - } - } - }, - "/v1/customers/{customerId}/segments": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "cust_aSeH6JH52DPjYLC1G475Ii0N" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID." - } - ], - "get": { - "operationId": "list-customer-segments", - "tags": [ - "CUSTOMERS API" - ], - "summary": "List Customer's Segments", - "description": "Returns the list of segments IDs to which the customer belongs to. \n\nIf you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "The method returns segment(s) to which the given customer belongs to.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_res_customers_customerId_segments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "seg_DNAOhUtJffvX0f57ajLMFBYR", - "name": "area code not 123", - "object": "segment" - }, - { - "id": "seg_IPIYx96l92Op0Sy5MOaImhgw", - "name": "not bob.smith@email.com", - "object": "segment" - }, - { - "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2", - "name": "Birthday After Dec 31", - "object": "segment" - }, - { - "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2", - "name": "Start with S", - "object": "segment" - }, - { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt", - "name": "Loyalty Card", - "object": "segment" + ], + "responses": { + "200": { + "description": "Returns a reward assignment with an updated points value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", + "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 3 + } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": "2022-11-28T19:27:40.604Z", + "object": "reward_assignment" + } } - ], - "total": 5 + } + } + } + } + }, + "requestBody": { + "description": "Update the points cost for the reward assignment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_reward_assignment" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "loyalty": { + "points": 3 + } + } + } + } } } } } - } - } - } - } - }, - "/v1/order-object": { - "get": { - "operationId": "order-object", - "tags": [ - "ORDERS API" - ], - "summary": "Order Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Order Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object" + }, + "delete": { + "operationId": "delete-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Reward Assignment", + "description": "This method deletes a reward assignment for a particular loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the loyalty campaign or reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_0b4hqJpVFssxXXrq56Ddtyo", + "request_id": "v-0ae2b69e0cd0c1364f", + "resource_id": "rewa_0b4hqJpVFssxXXrq56Ddtyo", + "resource_type": "reward_assignment" + } + }, + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Loyalty Summer Campaign", + "request_id": "v-0ae2b71e57d027e263", + "resource_id": "Loyalty Summer Campaign", + "resource_type": "campaign" + } + } + } + } + } } } } - } - } - } - }, - "/v1/orders": { - "get": { - "operationId": "list-orders", - "tags": [ - "ORDERS API" - ], - "summary": "List Orders", - "description": "Returns a list of orders.\n\n", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with order objects. The orders are returned sorted by creation date by default, with the most recent orders appearing last, unless you specify another sequence using the order query parameter.", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/members/{memberId}/redemption": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/10_res_list_orders" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "orders", - "orders": [ - { - "id": "ord_v5vupdacgud1CwUSyKqSlHuk", - "source_id": null, - "created_at": "2022-09-09T07:44:41.594Z", - "updated_at": "2022-09-09T07:44:42.331Z", - "status": "PAID", - "amount": 2700, - "discount_amount": 1243, - "items_discount_amount": 270, - "total_discount_amount": 1513, - "total_amount": 1187, - "items": [ - { - "object": "order_item", - "source_id": "prod_5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 700, - "discount_amount": 70, - "price": 700, - "subtotal_amount": 630, - "product": { - "name": "Shipping" - } + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "post": { + "operationId": "redeem-reward-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Redeem Reward", + "description": "Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_redeem_reward" + }, + "examples": { + "Redeem Reward that adds points to a loyalty card": { + "value": { + "id": "r_0c6b3abbfe8e60a9dd", + "object": "redemption", + "date": "2023-02-06T09:07:55.514Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 1, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - { - "object": "order_item", - "source_id": "roses_1", - "related_object": "product", - "quantity": 1, - "amount": 500, - "discount_amount": 50, - "price": 500, - "subtotal_amount": 450, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 500 + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6887 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:07:55.515Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 9, + "redeemed_points": 1113, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } }, - { - "object": "order_item", - "source_id": "vase_1", - "related_object": "product", - "quantity": 1, - "amount": 1500, - "discount_amount": 150, - "price": 1500, - "subtotal_amount": 1350, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0baa093537528ef645": { - "date": "2022-09-09T07:44:41.695Z", - "related_object_type": "redemption", - "related_object_id": "r_0baa093537528ef645", - "stacked": [ - "r_0baa093537528ef646", - "r_0baa093537528ef647", - "r_0baa093537528ef648" - ] + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 1020, + "balance": 890 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-11T08:19:28.780Z", + "updated_at": "2023-01-25T15:44:33.500Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 26, + "redeemed_points": 130, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", + "object": "reward", + "name": "Present on Loyalty Card", + "created_at": "2023-01-25T15:43:40.716Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "balance": 20, + "type": "LOYALTY_PROGRAM" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 } } }, - { - "id": "ord_3JkWC6jG0JgyRf5lO3r4IyU1", - "source_id": null, - "created_at": "2022-09-09T07:04:22.597Z", - "updated_at": "2022-09-09T07:04:23.743Z", - "status": "PAID", - "amount": 73100, - "items_discount_amount": 7310, - "total_discount_amount": 7310, - "total_amount": 65790, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "discount_amount": 7000, - "price": 70000, - "subtotal_amount": 63000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } + "Redeem Reward that adds credits to a gift card": { + "value": { + "id": "r_0c6b3bedf3478a0167", + "object": "redemption", + "date": "2023-02-06T09:13:08.813Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 1, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "discount_amount": 160, - "price": 1600, - "subtotal_amount": 1440, - "product": { - "name": "Comic Books1", - "price": 1600 + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6886 }, - "sku": { - "sku": "Comics1", - "price": 1600 + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:13:08.814Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1114, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 150, - "price": 1500, - "subtotal_amount": 1350, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fffae90e1b2495": { - "date": "2022-09-09T07:04:22.692Z", - "related_object_type": "voucher", - "related_object_id": "v_24rljiUfdLNC9poBf0BPNmoh2txzFkLs" - } - } - }, - { - "id": "ord_HwdbziIPvUZJkIC7z74FKmPv", - "source_id": null, - "created_at": "2022-09-09T06:47:14.195Z", - "updated_at": "2022-09-09T06:47:15.369Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 7160, - "total_discount_amount": 7160, - "total_amount": 64440, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - "sku": { - "sku": "Comics1", - "price": 1600 - } + "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 59080, + "balance": 48780 + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" + }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2023-01-25T14:42:25.214Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", + "object": "reward", + "name": "Present Credits on Gift Card", + "created_at": "2023-01-25T14:41:31.858Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "balance": 4000, + "type": "GIFT_VOUCHERS" + } + }, + "type": "CAMPAIGN" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fc0eb00e1b2230": { - "date": "2022-09-09T06:47:14.369Z", - "related_object_type": "voucher", - "related_object_id": "v_3vEprqa6tbzfhFtpjr4mDlkNchXepW7s" + "loyalty_card": { + "points": 1 } } }, - { - "id": "ord_HRluwFS2seoILUkXxWML0D7Z", - "source_id": null, - "created_at": "2022-09-09T06:44:27.383Z", - "updated_at": "2022-09-09T06:44:28.252Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 71500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 + "Redeem Reward that gives a discount coupon": { + "value": { + "id": "r_0c6b3ca77e0e60b534", + "object": "redemption", + "date": "2023-02-06T09:16:18.808Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" }, - "sku": { - "sku": "Comics1", - "price": 1600 - } + "object": "customer" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6884 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:16:18.809Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 11, + "redeemed_points": 1116, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order", - "redemptions": { - "r_0ba9fb6bb7928ed9ec": { - "date": "2022-09-09T06:44:27.486Z", - "related_object_type": "voucher", - "related_object_id": "v_vhHuiEmZSchWHtE0xKm0HM7PFCR9cNkA", - "related_object_parent_id": "camp_rRsfatlwN7unSeUIJDCYedal" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_a3Ba1neDwPa3rBE0HkDd0C7CbiehBulo", + "code": "HAPPY-ORDERctb", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "7d646e7d-9b5a-40b6-a44e-6bae848e108e", + "url": "https://dl.voucherify.io/api/v1/assets/qr/7d646e7d-9b5a-40b6-a44e-6bae848e108e" + }, + "barcode": { + "id": "dfb3e48d-ce4f-4187-a114-483feb4ca88d", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/dfb3e48d-ce4f-4187-a114-483feb4ca88d" + } + }, + "is_referral_code": false, + "created_at": "2023-02-06T09:16:18.845Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDERctb/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDERctb/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 2 } } }, - { - "id": "ord_Qg5utCohAZ3tafYvc1O4C80r", - "source_id": null, - "created_at": "2022-09-09T06:42:34.083Z", - "updated_at": "2022-09-09T06:42:35.169Z", - "status": "PAID", - "amount": 70000, - "discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 66000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 + "Redeem a Material reward of a SKU type": { + "value": { + "id": "r_0c6b3d1357878a0813", + "object": "redemption", + "date": "2023-02-06T09:18:09.246Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 6, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6878 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:18:09.247Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 12, + "redeemed_points": 1122, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fafd11d28ed999": { - "date": "2022-09-09T06:42:34.183Z", - "related_object_type": "voucher", - "related_object_id": "v_RaMaTT7F0Q47BetdGcFxsyqwo1aZGzJs", - "related_object_parent_id": "camp_hg7ajfHh6DcE1xa18mw3SdF6" - } - } - }, - { - "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", - "source_id": null, - "created_at": "2022-09-09T06:38:17.984Z", - "updated_at": "2022-09-09T06:38:19.064Z", - "status": "PAID", - "amount": 4600, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 4300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", "product": { - "name": "Comic Books1", - "price": 1600 + "id": "prod_5h0wc453_2", + "source_id": "jonah-nystrom-bourbon", + "name": "Johan & Nyström - Bourbon", + "price": null, + "attributes": [ + "categories", + "description", + "weight" + ], + "metadata": { + "company": "Johan & Nyström", + "showcase": true + }, + "image_url": null, + "created_at": "2021-12-01T08:00:49.418Z", + "updated_at": null, + "object": "product" }, "sku": { - "sku": "Comics1", - "price": 1600 - } + "id": "sku_0a3efc9044dd121803", + "source_id": "jonah-nystrom-bourbon-250g", + "product_id": "prod_5h0wc453_2", + "sku": "250g", + "price": 1750, + "currency": null, + "attributes": { + "categories": "Coffee, Whole Bean", + "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", + "weight": 250 + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-01T08:00:49.427Z", + "updated_at": null, + "object": "sku" + }, + "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", + "object": "reward", + "name": "Present - SKU", + "created_at": "2023-01-25T12:10:16.060Z", + "updated_at": "2023-01-25T12:10:59.662Z", + "parameters": { + "product": { + "id": "prod_5h0wc453_2", + "sku_id": "sku_0a3efc9044dd121803" + } + }, + "type": "MATERIAL" }, - { - "object": "order_item", - "product_id": "prod_0a65b3ff8592d7a5b5", - "quantity": 1, - "amount": 3000, - "discount_amount": 300, - "price": 3000, - "subtotal_amount": 2700, - "product": { - "name": "Koffee Cup", - "price": 3000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fa02fcd28ed8f1": { - "date": "2022-09-09T06:38:18.099Z", - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + "loyalty_card": { + "points": 6 } } }, - { - "id": "ord_N3YBowDTZs0UH2hHoMZLbUDN", - "source_id": null, - "created_at": "2022-09-09T06:18:31.459Z", - "updated_at": "2022-09-09T06:18:31.624Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 7160, - "total_discount_amount": 7160, - "total_amount": 64440, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 + "Redeem a Material Reward of a Product Type": { + "value": { + "id": "r_0c6b3d8c35546f8673", + "object": "redemption", + "date": "2023-02-06T09:20:13.013Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 4, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@voucherify.io", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6874 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:20:13.014Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 13, + "redeemed_points": 1126, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@voucherify.io", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", "product": { - "name": "Comic Books1", - "price": 1600 + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "name": "[Sample] Tiered Wire Basket", + "price": 11995, + "attributes": [], + "metadata": { + "source": "bigcommerce", + "bigcommerce_product_categories": [ + 21, + 23 + ] + }, + "image_url": null, + "created_at": "2022-06-03T13:36:16.084Z", + "updated_at": "2022-06-07T09:10:44.644Z", + "object": "product" }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9f57c37128ed639": { - "date": "2022-09-09T06:18:31.516Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", - "related_object_parent_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0" + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", + "object": "reward", + "name": "Present", + "created_at": "2022-06-13T06:59:01.694Z", + "updated_at": "2023-02-03T15:04:14.102Z", + "parameters": { + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "sku_id": null + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 4 } } }, - { - "id": "ord_3R6vsxRZRkND8rpe0rAn9Agc", - "source_id": null, - "created_at": "2022-09-05T08:13:13.720Z", - "updated_at": "2022-09-05T08:13:14.498Z", - "status": "PAID", - "amount": 74000, - "items_discount_amount": 1500, - "total_discount_amount": 1500, - "total_amount": 72500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 + "Redeem Pay with Points Reward": { + "value": { + "id": "r_0c6b4142ecc78a21d0", + "object": "redemption", + "date": "2023-02-06T09:36:26.547Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2300, + "result": "SUCCESS", + "order": { + "id": "ord_QBnrJlVWA2EEiZoKOptFROnp", + "source_id": null, + "created_at": "2023-02-06T09:36:26.503Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 45000, + "total_discount_amount": 45000, + "total_amount": 0, + "applied_discount_amount": 45000, + "total_applied_discount_amount": 45000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } + }, + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b4142ecc78a21d0": { + "date": "2023-02-06T09:36:26.547Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } } }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 2, - "amount": 3000, - "discount_amount": 500, - "price": 1500, - "subtotal_amount": 2500, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - { - "object": "order_item", - "product_id": "prod_0b72b00ffed198e344", - "quantity": 2, - "amount": 1000, - "discount_amount": 1000, - "price": 500, - "subtotal_amount": 0, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 500 + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 4574 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:36:26.548Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 14, + "redeemed_points": 3426, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } - } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" - }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba4e961444579711a": { - "date": "2022-09-05T08:13:13.873Z", - "related_object_type": "voucher", - "related_object_id": "v_hwySVBBk6YmMD4GzZHJzke1Fxo3QO7kP", - "related_object_parent_id": "camp_Uji5a53s5wRSUHqznncTkhHh" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 2300 } } }, - { - "id": "ord_7bqlkoHyEJCQuxVZpKfZYNeA", - "source_id": null, - "created_at": "2022-09-02T17:12:13.213Z", - "updated_at": "2022-09-02T17:12:13.969Z", - "status": "PAID", - "amount": 292400, - "items_discount_amount": 900, - "total_discount_amount": 900, - "total_amount": 291500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 4, - "amount": 6400, - "price": 1600, - "subtotal_amount": 6400, - "product": { - "name": "Comic Books1", - "price": 1600 + "Redeem Pay with Points Reward with a specific amount of points": { + "value": { + "id": "r_0c6b423368146fa4bb", + "object": "redemption", + "date": "2023-02-06T09:40:32.800Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 100, + "result": "SUCCESS", + "order": { + "id": "ord_1L67XS8EYDDp5A4B3k62G2tr", + "source_id": null, + "created_at": "2023-02-06T09:40:32.784Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 43000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } + }, + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b423368146fa4bb": { + "date": "2023-02-06T09:40:32.800Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8500, + "balance": 4974 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } }, - "sku": { - "sku": "Comics1", - "price": 1600 + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:40:32.801Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 15, + "redeemed_points": 3526, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 4, - "amount": 6000, - "price": 1500, - "subtotal_amount": 6000, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 4, - "amount": 280000, - "discount_amount": 900, - "price": 70000, - "subtotal_amount": 279100, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } + "loyalty_card": { + "points": 100 } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the campaign was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id :campaignId", + "request_id": "v-0c6b39288084e3435a", + "resource_id": ":campaignId", + "resource_type": "campaign" + } + } + } + } + } + } + }, + "requestBody": { + "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_redeem_reward" + }, + "examples": { + "Pay with Points": { + "value": { + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "points": 100 }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba187f9bb45792c13": { - "date": "2022-09-02T17:12:13.293Z", - "related_object_type": "voucher", - "related_object_id": "v_pg6DhwhmeZASoSoJ15PdzMT9MhsPjYuc", - "related_object_parent_id": "camp_W8DJVd8J0btqXT6FBwn7BSkC" - } + "order": { + "items": [ + { + "product_id": "prod_0c5d6689b39320059b", + "quantity": "1" + }, + { + "product_id": "prod_0b2c36568000039138", + "quantity": "2" + } + ] } - }, - { - "id": "ord_7HwbJiHmS07O7FsVAtjJcuRS", - "source_id": null, - "created_at": "2022-09-02T17:08:37.794Z", - "updated_at": "2022-09-02T17:08:38.879Z", - "status": "PAID", - "amount": 223900, - "items_discount_amount": 900, - "total_discount_amount": 900, - "total_amount": 223000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 4, - "amount": 6400, - "discount_amount": 300, - "price": 1600, - "subtotal_amount": 6100, - "product": { - "name": "Comic Books1", - "price": 1600 + } + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/redemption": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "post": { + "operationId": "redeem-reward", + "tags": [ + "LOYALTIES API" + ], + "summary": "Redeem Reward", + "description": "\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:redeem-reward-1). The URL was re-designed to allow you to redeem a reward without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_redeem_reward" + }, + "examples": { + "Redeem Pay with Points Reward with a specific number of Points": { + "value": { + "id": "r_0c6b4bf721439bf02b", + "object": "redemption", + "date": "2023-02-06T10:23:12.517Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 100, + "result": "SUCCESS", + "order": { + "id": "ord_71Ayjxq2gFV80v3OP3qrxh37", + "source_id": null, + "created_at": "2023-02-06T10:23:12.485Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 43000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } + }, + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "sku": { - "sku": "Comics1", - "price": 1600 + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b4bf721439bf02b": { + "date": "2023-02-06T10:23:12.517Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } } }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 3, - "amount": 210000, - "discount_amount": 300, - "price": 70000, - "subtotal_amount": 209700, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 5, - "amount": 7500, - "discount_amount": 300, - "price": 1500, - "subtotal_amount": 7200, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 9000, + "balance": 5374 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T10:23:12.517Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 16, + "redeemed_points": 3626, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 100 } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" + } + } + } + } + } + }, + "400": { + "description": "Returns an error indicating that a reward is missing.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/e_400_missing_reward" }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba1872762c5792b73": { - "date": "2022-09-02T17:08:37.899Z", - "related_object_type": "voucher", - "related_object_id": "v_yQydppWWJpSUuGNEWJ4I2upFGY2Ma4IY", - "related_object_parent_id": "camp_A5L21BD4cJii28882owYBqTV" - } + { + "$ref": "#/components/schemas/e_400_missing_order" + }, + { + "$ref": "#/components/schemas/e_400_loyalty_card_points_exceeded" + } + ] + } + } + } + }, + "404": { + "description": "Returns an error indicating a resource was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Member Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id :memberId", + "request_id": "v-0c6b4b525d8e40cf3e", + "resource_id": ":memberId", + "resource_type": "voucher" } } - ], - "total": 441 + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-order", - "tags": [ - "ORDERS API" - ], - "summary": "Create Order", - "description": "Creates an order object and triggers an order creation event. ", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the order parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_create_order" }, - "examples": { - "Example": { - "value": { - "amount": 20000, - "customer": { - "source_id": "sample_customer" + "requestBody": { + "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_redeem_reward" }, - "status": "PAID", - "items": [ - { - "quantity": 1, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" + "examples": { + "Pay with Points": { + "value": { + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "points": 100 + }, + "order": { + "items": [ + { + "product_id": "prod_0c5d6689b39320059b", + "quantity": "1" + }, + { + "product_id": "prod_0b2c36568000039138", + "quantity": "2" + } + ] } } } - ] + } } + } + } + } + }, + "/v1/loyalties/{campaignId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string" }, - "Example 2": { - "value": { - "source_id": "new", - "status": "FULFILLED", - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "source_id": "bob.smith.1@email.com", - "name": "Bob Smith", - "description": "A nice customer", - "email": "bob.smith.1@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United Statese", - "line_1": "123 Main St", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": false - }, - "birthdate": "2022-01-02" - }, - "referrer": { - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A really nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3334", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": false - }, - "birthday": "2022-03-03" - }, - "items": [ - { - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "product": { - "name": "Apple iPhone 12", - "price": 60000, - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "override": true - } - }, - { - "source_id": "ComicBook_1", - "related_object": "sku", - "quantity": 1, - "product": { - "source_id": "Books", - "name": "Comic Books1", - "price": 2100, - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "override": true - }, - "sku": { - "sku": "Comics1", - "source_id": "ComicBook_1", - "price": 1700, - "metadata": { - "color": [ - "golden" + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique loyalty campaign ID or name." + } + ], + "get": { + "operationId": "list-loyalty-tiers", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tiers", + "description": "Retrieve a list of loyalty tiers which were added to the loyalty program.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty tier objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "name": "Bottom", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": {}, + "created_at": "2022-11-10T12:20:52.755Z", + "updated_at": "2022-11-25T11:27:58.616Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 1 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 5 + } + }, + "rewards": { + "rewa_t88DnSdNnE0IzQX6gqH3jHGQ": { + "type": "MULTIPLY", + "multiplier": 4 + } + }, + "config": { + "points": { + "from": 1, + "to": 249 + } + }, + "points": { + "from": 1, + "to": 249 + }, + "object": "loyalty_tier" + }, + { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1", + "name": "Middle", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": {}, + "created_at": "2022-11-10T12:20:52.755Z", + "updated_at": "2022-11-25T11:27:58.579Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 2 + } + }, + "rewards": {}, + "config": { + "points": { + "from": 250, + "to": 499 + } + }, + "points": { + "from": 250, + "to": 499 + }, + "object": "loyalty_tier" + }, + { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": { + "has_funds": true + }, + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 + } + }, + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 + }, + "object": "loyalty_tier" + } ], - "vendor": "islands" - }, - "override": true + "total": 3 + } } } - ] + } + } + } + } + }, + "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" + } } } } } - } - }, - "responses": { - "200": { - "description": "Returns an order object if the operation succeeded.", - "content": { - "application/json": { + }, + "/v1/loyalties/{campaignId}/tiers/{tierId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/10_obj_order_object_no_discount_calculations" - }, - "examples": { - "Example": { - "value": { - "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", - "source_id": "new", - "created_at": "2022-09-09T09:20:01.660Z", - "updated_at": "2022-09-09T09:24:43.604Z", - "status": "FULFILLED", - "amount": 121700, - "total_amount": 121700, - "items": [ - { - "object": "order_item", - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "amount": 120000, - "price": 60000, - "subtotal_amount": 120000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique loyalty campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique loyalty tier ID." + } + ], + "get": { + "operationId": "get-loyalty-tier", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Loyalty Tier", + "description": "Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a loyalty tier object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltyTier" + }, + "examples": { + "Example": { + "value": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" + "has_funds": true }, - "price": 60000 - } - }, - { - "object": "order_item", - "source_id": "ComicBook_1", - "related_object": "sku", - "product_id": "prod_0b7d7dfb05cbe5c616", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 + } }, - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 }, - "price": 1700 + "object": "loyalty_tier" + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member-loyalty-tier", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Member's Loyalty Tiers", + "description": "Retrieve member tiers using the loyalty card ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a data array containing the member's loyalty tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": { + "has_funds": true + }, + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 + } + }, + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 + }, + "expiration": { + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "tier_id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "start_date": "2022-11-10", + "expiration_date": "2023-02-28", + "created_at": "2022-11-09T11:26:26.719Z", + "updated_at": "2022-11-10T08:54:47.200Z" + }, + "object": "loyalty_tier" + } + ], + "total": 1 + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique tier ID." + } + ], + "get": { + "operationId": "list-loyalty-tier-earning-rules", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tier Earning Rules", + "description": "Retrieve available earning rules for a given tier and the calculation method for earning points.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of earning rules for a given tier. The object for each earning rule also contains information about how the points are calculated; this includes mapping. If a specific multiplier was used to calculate points for a given tier, then the `loyalty.points` parameter will account for this calculation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" + }, + "examples": { + "example-1": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "created_at": "2022-11-09T06:26:54.332Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 300, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_bfi69WIbztany4iX6prkKbGN", + "metadata": { + "Type": "Joined Any" + } + }, + { + "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", + "created_at": "2022-11-10T12:25:12.927Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 300, + "type": "FIXED" + }, + "segment": { + "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" + }, + "event": "customer.segment.entered", + "source": { + "banner": "New Customers", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", + "metadata": {} + }, + { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T09:48:26.284Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" + } + }, + { + "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", + "created_at": "2022-11-24T14:48:36.567Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1000, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", + "metadata": { + "Type": "Order has been paid - Proportional - 1" + } + }, + { + "id": "ern_jwtacKdEEHoc85QbouRw3CR8", + "created_at": "2022-11-24T15:17:11.539Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1100, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", + "metadata": { + "Type": "Order has been paid - Proportional - 2" + } + }, + { + "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", + "created_at": "2022-11-24T15:20:04.392Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 10, + "points": 2, + "property": "number_of_store_visits" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", + "metadata": { + "Type": "Order has been paid - Proportional - 3 - Metadata" + } + }, + { + "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", + "created_at": "2022-11-24T15:23:44.514Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 1000, + "points": 3, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", + "metadata": { + "Type": "Order has been paid - Proportional - 4" + } + }, + { + "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", + "created_at": "2022-11-24T15:44:45.301Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 1000, + "points": 4, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", + "metadata": { + "Type": "Order has been paid - Proportional - 5 - Items" + } + }, + { + "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", + "created_at": "2022-11-24T15:56:58.710Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 10000, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", + "metadata": {} + }, + { + "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", + "created_at": "2022-11-24T16:19:20.571Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 5, + "property": "customer_life_time_value" + } + } + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered Segment", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", + "metadata": {} + }, + { + "id": "ern_L8dFanPxJzhw0f5voTwPurGP", + "created_at": "2022-11-24T16:27:13.917Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", + "metadata": { + "Type": "Fixed" + } + }, + { + "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", + "created_at": "2022-11-24T16:41:48.830Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 2, + "points": 2, + "property": "volume_number" + } + } + }, + "custom_event": { + "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "event": "user_subscribed", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", + "metadata": { + "Type": "Event" + } + }, + { + "id": "ern_afo3Ea760hAKv07JYpycnhiE", + "created_at": "2022-11-24T16:50:12.945Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 3, + "property": "customer_life_time_value" + } + } + }, + "custom_event": { + "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" + }, + "event": "cart_abandoned", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", + "metadata": {} + }, + { + "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", + "created_at": "2022-11-24T16:51:31.595Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier joined - Any", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", + "metadata": { + "Type": "Tier joined - any - fixed" + } + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T09:48:26.506Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 25, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "total": 19 } } - ], - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order" + } } } } } } - } - } - } - }, - "/v1/orders/{orderId}": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "orderId", - "in": "path", - "required": true, - "description": "Unique Voucherify order ID or order source ID." - } - ], - "get": { - "operationId": "get-order", - "tags": [ - "ORDERS API" - ], - "summary": "Get Order", - "description": "Retrieve an order.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an order object if a valid identifier was provided. ", - "content": { - "application/json": { + "/v1/loyalties/{campaignId}/tiers/{tierId}/rewards": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { "schema": { - "$ref": "#/components/schemas/10_obj_order_object" + "type": "string", + "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique tier ID." + } + ], + "get": { + "operationId": "list-loyalty-tier-rewards", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tier Rewards", + "description": "Get available rewards for a given tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty tier reward objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "reward": { + "id": "rew_QuWYsBNB2G3fikffjnl0G3gH", + "name": "API - Testing", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "balance": 500, + "type": "LOYALTY_PROGRAM" + } + }, + "stock": null, + "redeemed": null, + "created_at": "2022-08-25T09:32:04.579424+00:00", + "updated_at": "2022-08-25T09:33:46.680639+00:00", + "metadata": { + "Type": "Second campaign" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_3Z2sP0bmqcL0ggU28GvFeHU3", + "reward_id": "rew_QuWYsBNB2G3fikffjnl0G3gH", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 40 + } + }, + "created_at": "2022-11-23T22:11:58.759092+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" + }, + { + "reward": { + "id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", + "name": "Material", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } + }, + "stock": 2, + "redeemed": 1, + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-29T06:02:36.753873+00:00", + "updated_at": "2022-11-08T08:01:26.883166+00:00", + "metadata": { + "Type": "Material" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k", + "reward_id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 30 + } + }, + "created_at": "2022-11-23T22:11:58.759092+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" + }, + { + "reward": { + "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "name": "100 Points = $20", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-09-09T06:41:54.496035+00:00", + "updated_at": null, + "metadata": {}, + "object": "reward" + }, + "assignment": { + "id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", + "reward_id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "created_at": "2022-11-09T11:01:21.065681+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" + } + ], + "total": 3 + } + } + } + } + } } } } }, - "404": { - "description": "Returns an error when requesting an order that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find order with id ord_nIcO2s8iD4Xh5E9IGDQ57Ax", - "request_id": "v-0baa1ad023d0656a84", - "resource_id": "ord_nIcO2s8iD4Xh5E9IGDQ57Ax", - "resource_type": "order" + "/v1/customer-object": { + "get": { + "operationId": "customer-object", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Customer Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" + } } } } } } - } - } - }, - "put": { - "operationId": "update-order", - "tags": [ - "ORDERS API" - ], - "summary": "Update Order", - "description": "Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters of the order that are to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_update_order" - }, - "examples": { - "Example": { - "value": { - "status": "CANCELED" + }, + "/v1/customer-activity-object": { + "get": { + "operationId": "customer-activity-object", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Customer Activity Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Activity Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_activity_object" + } + } } } } } - } - }, - "responses": { - "200": { - "description": "Returns the order object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object" - }, - "examples": { - "Example": { - "value": { - "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", - "source_id": "new", - "created_at": "2022-09-09T09:20:01.660Z", - "updated_at": "2022-09-09T09:41:00.881Z", - "status": "CANCELED", - "amount": 121700, - "total_amount": 121700, - "items": [ - { - "object": "order_item", - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "amount": 120000, - "price": 60000, - "subtotal_amount": 120000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "price": 60000 - } - }, - { - "object": "order_item", - "source_id": "ComicBook_1", - "related_object": "sku", - "product_id": "prod_0b7d7dfb05cbe5c616", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "price": 1700 + }, + "/v1/customers": { + "get": { + "operationId": "list-customers", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customers", + "description": "Returns a list of customers.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "email", + "description": "Limit the customers to the ones that have this specific email address." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Limit the customers to the ones that are located in the specified city.", + "name": "city" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Filter customers by the name property.", + "name": "name" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "source_id", + "-source_id" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after", + "description": "A cursor for use in pagination. This is a date-time value that defines your place in the list based on `created_at` property from the customer object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list. \n\n| **Option** | **Format** | **Sorting** |\n|:---|:---|:---|\n| Return customers **before** a specific creation date | - set `starting_after` parameter to the breakpoint date | Sorting order is **descending**; the most recent dates first and least recent dates last. |\n| Return customers **after** a specific create or update date | - include the `order` parameter set to `created_at` or `updated_at`
- set `starting_after` to the breakpoint date | Sorting order is **ascending**; the least recent dates first and the most recent dates last. |\n" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with customer objects. The customers are returned sorted by creation date, with the most recent customers appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_res_list_customers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "customers", + "customers": [ + { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "source_id": "source_123", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "birthdate": "2022-01-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "country": "United States", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 1, + "total_failed": 0, + "total_succeeded": 1, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 4200 + } + }, + "orders": { + "total_amount": 1600, + "total_count": 1, + "average_amount": 1600, + "last_order_amount": 1600, + "last_order_date": "2022-08-30T10:17:39.220Z" + } + }, + "loyalty": { + "points": 2200, + "referred_customers": 0, + "campaigns": { + "Christmas Campaign": { + "points": 1000, + "referred_customers": 0 + }, + "Fall Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Summer Campaign": { + "points": 50, + "referred_customers": 0 + }, + "Spring Campaign": { + "points": 1000, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 1, + "campaigns": [ + { + "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", + "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "related_object_id": "r_0b9d4c5121d64dd01d", + "related_object_type": "redemption", + "date": "2022-08-30T10:17:41.089Z" + } + ] + }, + "metadata": { + "lang": "en", + "test": true + }, + "system_metadata": {}, + "created_at": "2022-08-30T06:32:07.380Z", + "updated_at": "2022-08-30T10:17:58.049Z", + "object": "customer" + }, + { + "id": "cust_X0hU04x7FeisPnD5lctZcQkI", + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3333", + "birthdate": "2022-01-02", + "address": { + "city": "New Yorke", + "state": "NY", + "line_1": "123 Main Ste.", + "line_2": "APT 3 BLG 4e", + "country": "United Statese", + "postal_code": "10001e" + }, + "summary": { + "redemptions": { + "total_redeemed": 4, + "total_failed": 0, + "total_succeeded": 4, + "total_rolled_back": 1, + "total_rollback_failed": 0, + "total_rollback_succeeded": 1, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 15549 + } + }, + "orders": { + "total_amount": 210000, + "total_count": 3, + "average_amount": 70000, + "last_order_amount": 70000, + "last_order_date": "2022-08-30T11:51:08.029Z" + } + }, + "loyalty": { + "points": 15399, + "referred_customers": 0, + "campaigns": { + "Christmas Campaign": { + "points": 7000, + "referred_customers": 0 + }, + "Fall Campaign": { + "points": 2299, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 25, + "referred_customers": 0 + }, + "Summer Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Spring Campaign": { + "points": 6000, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 2, + "campaigns": [ + { + "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", + "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "related_object_id": "r_0b9d4cc4aa164dd073", + "related_object_type": "redemption", + "date": "2022-08-30T10:19:39.196Z" + }, + { + "campaign_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "related_object_id": "r_0b9d61b6484ead0324", + "related_object_type": "redemption", + "date": "2022-08-30T11:51:10.445Z" + } + ] + }, + "metadata": { + "lang": "en", + "test": false + }, + "system_metadata": {}, + "created_at": "2022-08-09T09:50:53.620Z", + "updated_at": "2022-08-30T11:51:24.327Z", + "object": "customer" + } + ], + "total": 2 } } - ], - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order" + } } } } } - } - } - } - } - }, - "/v1/orders/import": { - "post": { - "operationId": "import-orders", - "tags": [ - "ORDERS API" - ], - "summary": "Import Orders", - "description": "\n\n> 🚧 Historical orders\n>\n> This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the [create order](ref:create-order) and [update order](ref:update-order) endpoints should be used. This is critical because this endpoint does not store events or launch distributions.\n\n## Limitations\n\n### Import volume\n\nThere can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. \n\n### Maximum count of orders in single import\n\nThere is a `2000` limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time.\n\n## Notifications\n\nThere are no notifications on the Dashboard because this import is launched via the API.\n\n## Triggered actions\n \nIf you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segment's summary. Consequently, this update will trigger \n- **customers entering into segments** \n- **distributions** based on any rules tied to customer entering segment(s)\n- **earning rules** based on the customer entering segment(s)\n\n## What is not triggered\n\n1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. \n\n2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. \n\n3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you won't see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you won't see the Product created events listed, etc. \n\n4. Earning rules based on Order Paid won't be triggered.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The request body is sent in the form of an array of order objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_orders_import" + }, + "post": { + "operationId": "create-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Create Customer", + "description": "Creates a customer object.\n\n\n\n> 📘 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Create a customer with specified parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_create_customer" + }, + "examples": { + "Example": { + "value": { + "source_id": "source_123", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-01-01" + } + } + } + } + } }, - "examples": { - "Example": { - "value": [ - { - "source_id": "orderImport14", - "status": "PAID", - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "source_id": "bob2.smith@email.com", - "name": "Bob Smith", - "description": "A nice customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-01-01" - }, - "referrer": { - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A really nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3334", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": false - }, - "birthday": "2022-03-03" + "responses": { + "200": { + "description": "Returns a customer object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" }, - "items": [ - { - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "product": { - "name": "Apple iPhone 12", - "price": 70000, - "metadata": { - "color": [ - "silver" - ], - "vendor": "mall" + "examples": { + "Example": { + "value": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "source_id": "source_123", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "birthdate": "2022-01-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "country": "United States", + "postal_code": "10001" }, - "override": true - } - }, - { - "source_id": "ComicBook_1", - "related_object": "sku", - "quantity": 1, - "product": { - "source_id": "Books", - "name": "Comic Books1", - "price": 1600, - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" + "summary": { + "redemptions": { + "total_redeemed": 0, + "total_failed": 0, + "total_succeeded": 0, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 0 + } + }, + "orders": { + "total_amount": 0, + "total_count": 0, + "average_amount": 0, + "last_order_amount": 0 + } + }, + "loyalty": { + "points": 0, + "referred_customers": 0, + "campaigns": {} + }, + "referrals": { + "total": 0, + "campaigns": [] }, - "override": true - }, - "sku": { - "sku": "Comics1", - "source_id": "ComicBook_1", - "price": 1600, "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" + "lang": "en", + "test": true }, - "override": true - } - } - ] - }, - { - "source_id": "orderImport15", - "status": "PAID", - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - }, - "customer": { - "source_id": "bob2.smith@email.com" - }, - "referrer": { - "source_id": "jane.smith@email.com" - }, - "items": [ - { - "source_id": "ComicBook_1", - "quantity": 4, - "related_object": "sku", - "sku": { - "source_id": "ComicBook_1" - } - }, - { - "source_id": "vase_1", - "quantity": 1, - "related_object": "product", - "product": { - "source_id": "vase_1" + "system_metadata": {}, + "created_at": "2022-08-30T06:32:07.380Z", + "object": "customer" } } - ] - }, - { - "source_id": "orderImport16", - "status": "FULFILLED", - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - }, - "customer": { - "id": "cust_LMY4ZylSdUYB1J4tzqNcl5VV" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "items": [ - { - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 2 - }, - { - "sku_id": "sku_0b1621b319d248b79f", - "quantity": 2 - } - ] - }, - { - "source_id": "orderImport17", - "status": "CANCELED", - "amount": 7000, - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] } - }, - { - "source_id": "orderImport18", - "status": "CREATED", - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - }, - "items": [ - { - "source_id": "ComicBook_1", - "amount": 900, - "related_object": "sku" - }, - { - "source_id": "vase_1", - "amount": 2000, - "related_object": "product" - } - ] - }, - { - "source_id": "orderImport19", - "status": "CREATED", - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - }, - "items": [ - { - "amount": 900 - }, - { - "amount": 2000 - } - ] - }, - { - "source_id": "orderImport20", - "status": "CREATED", - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - }, - "items": [ - { - "price": 900, - "quantity": 2 - }, - { - "price": 2000, - "quantity": 3 - } - ] - } - ] - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the order(s) will be added to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "400": { - "description": "Returns an error if the payload is invalid.", - "content": { - "application/json": { + "/v1/customers/{customerId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" }, - "examples": { - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .items[0].initial_quantity cannot be lower than 1", - "request_id": "v-0c5561d945cb0f0fb5" - } - } - } + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or `source_id`." } - } - } - } - } - }, - "/v1/orders/export": { - "post": { - "operationId": "create-order-export", - "tags": [ - "ORDERS API" - ], - "summary": "Create Orders Export", - "description": "Creates a downloadable CSV file containing a list of orders.\n\nThe parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the `parameters.fields` object in the request body.\n\nThe available filters are all [order object](ref:get-order) attributes. Additionally, any metadata defined in the metadata schema can be exported.\n\nPassing an empty JSON will generate a file containing three default fields: `id`, `source_id`, and `status`.\n\nThe fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify which order parameters you would like to export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_create_order_export" - }, - "examples": { - "Using fields": { - "value": { - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ] + ], + "get": { + "operationId": "get-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Get Customer", + "description": "Retrieve customer details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a customer object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" + }, + "examples": { + "Example": { + "value": { + "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "source_id": "alice.morgan@email.com", + "name": "Alice Morgan", + "email": "alice.morgan@email.com", + "address": null, + "summary": { + "redemptions": { + "total_redeemed": 2, + "total_failed": 0, + "total_succeeded": 2, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 3303 + } + }, + "orders": { + "total_amount": 203900, + "total_count": 2, + "average_amount": 101950, + "last_order_amount": 3900, + "last_order_date": "2022-07-26T14:59:52.814Z" + } + }, + "loyalty": { + "points": 3303, + "referred_customers": 0, + "campaigns": { + "Summer Campaign": { + "points": 3303, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "system_metadata": {}, + "created_at": "2022-02-07T08:28:23.644Z", + "updated_at": "2022-07-26T14:59:59.806Z", + "assets": { + "cockpit_url": "https://www.url.com" + }, + "object": "customer" + } + } + } } } }, - "Using fields and filters": { - "value": { - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ], - "order": "-updated_at", - "filters": { - "discount_amount": { - "conditions": { - "$more_than": 100000 + "404": { + "description": "Not Found. When requesting the ID of a customer that has been deleted or does not exist in the system, the resource will not be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_sehkNIi8Uq2qQuRqSr7xn4Z", + "request_id": "v-0b4c590350857970df", + "resource_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Z", + "resource_type": "customer" } } } @@ -78911,1911 +76379,2781 @@ } } } - } - } - }, - "responses": { - "200": { - "description": "Returns the `id` of the export object and `status` of the file generation process. The `id` is used in the [Get Export](ref:get-export) method to generate the url for the downloadable CSV file or in the [Download Export](ref:download-export) method to return the contents of the CSV file. The status indicates whether the file has been scheduled for creation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_pT2Y1mgYsAgRAqsWTGf7PQX7", - "object": "export", - "created_at": "2022-09-09T10:45:52.362Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "order", - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ] - }, - "result": null, - "user_id": null - } - } + }, + "delete": { + "operationId": "delete-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Delete Customer", + "description": "This method deletes a customer.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - }, - "400": { - "description": "Returns an error if the request payload is specified incorrectly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .parameters.filters should match either `filters[${field}][conditions][${condition}][${index}]` or `filters[${field}][conditions][${condition}]` format and condition must be one of: $in, $not_in, $in_location, $not_in_location, $is, $is_days_ago, $is_days_in_future, $is_not, $has_value, $is_unknown, $contains, $not_contain, $starts_with, $ends_with, $more_than, $less_than, $more_than_ago, $less_than_ago, $more_than_future, $less_than_future, $more_than_equal, $less_than_equal, $after, $before, $count, $count_less, $count_more, $today, $tomorrow, $yesterday, $this_week, $last_week, $next_week, $this_month, $last_month, $next_month, $this_year, $next_year, $last_year, $is_day_of_month, $is_day, $is_month, $is_year, $today_md, $tomorrow_md, $yesterday_md, $this_week_md, $last_week_md, $next_week_md, $this_month_md, $last_month_md, $next_month_md, $is_days_ago_md, $is_more_days_ago_md, $is_less_days_ago_md, $is_days_in_future_md, $is_more_days_in_future_md, $is_less_days_in_future_md, $is_years_ago, $active, $failed, $in_progress, $expired, $before_start, $enabled, $disabled, $redeemed, $redeemable", - "request_id": "v-0c52e783650ae585b2" + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Customer Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_7pm0hh0yemiydeFsdYXZlr1", + "request_id": "v-0ae398fd9ac683dc84", + "resource_id": "cust_7pm0hh0yemiydeFsdYXZlr1", + "resource_type": "customer" + } + } + } } } } } - } - } - } - } - }, - "/v1/product-object": { - "get": { - "operationId": "product-object", - "tags": [ - "PRODUCTS API" - ], - "summary": "Product Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Product Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" - } - } - } - } - } - } - }, - "/v1/sku-object": { - "get": { - "operationId": "sku-object", - "tags": [ - "PRODUCTS API" - ], - "summary": "SKU Object", - "description": "Data model description", - "responses": { - "200": { - "description": "SKU Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - } - } - } - } - } - }, - "/v1/products": { - "get": { - "operationId": "list-products", - "tags": [ - "PRODUCTS API" - ], - "summary": "List Products", - "description": "Retrieve a list of products.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_res_list_products" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "products", - "products": [ - { - "id": "prod_f1r5Tpr0DuC7", - "source_id": "test_prod_id_1", - "name": "Apple iPhone 8", - "price": null, - "attributes": [ - "color", - "memory" - ], + "put": { + "operationId": "update-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer", + "description": "Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customer" + }, + "examples": { + "Example": { + "value": { + "name": "Alice McDonald", + "email": "alice.mdconald@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, "metadata": { - "test": true, - "vendor": "Cortland" + "lang": "en", + "test": true }, - "image_url": null, - "created_at": "2021-12-03T06:33:46.101Z", - "updated_at": null, - "object": "product", - "skus": { - "data": [ - { - "id": "sku_0a417bd1d9952f9d6f", - "source_id": "test_iphone_8_silver_256gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 256GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "256" + "birthdate": "2022-01-01", + "birthday": "2022-01-02" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a customer object if updates were successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" + }, + "examples": { + "Example": { + "value": { + "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "source_id": "alice@morgan.com", + "name": "Alice McDonald", + "description": "Updating customer data", + "email": "alice.mdconald@email.com", + "phone": "+1 (132) 222-2222", + "birthday": "2022-01-02", + "birthdate": "2022-01-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "country": "United States", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 2, + "total_failed": 0, + "total_succeeded": 2, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.599097+00:00", - "updated_at": null, - "object": "sku" + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 4428 + } }, - { - "id": "sku_0a417bd1d9952f9d6e", - "source_id": "test_iphone_8_silver_64gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 64GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "64" - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.598595+00:00", - "updated_at": null, - "object": "sku" + "orders": { + "total_amount": 203900, + "total_count": 2, + "average_amount": 101950, + "last_order_amount": 3900, + "last_order_date": "2022-07-26T14:59:52.814Z" } - ], - "total": 2 - } - }, - { - "id": "prod_0ac67e1bb8072eec48", - "source_id": "test_volleyball", - "name": "VolleyBall", - "price": 1100, - "attributes": [], - "metadata": { - "color": [ - "white" - ], - "label": true, - "origin": "PL" - }, - "image_url": null, - "created_at": "2022-03-16T14:01:45.459Z", - "updated_at": "2022-04-26T12:51:35.500Z", - "object": "product", - "skus": { - "data": [ - { - "id": "sku_0ac768973f5c4ea0d0", - "source_id": "test_volleyball_pl", - "product_id": "prod_0ac67e1bb8072eec48", - "sku": "PL", - "price": 500, - "currency": "USD", - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "red" - ] + }, + "loyalty": { + "points": 3403, + "referred_customers": 0, + "campaigns": { + "Summer Campaign": { + "points": 0, + "referred_customers": 0 }, - "created_at": "2022-03-17T07:06:13.629918+00:00", - "updated_at": null, - "object": "sku" - }, - { - "id": "sku_0ac7689713072e1df6", - "source_id": "test_volleyball_us", - "product_id": "prod_0ac67e1bb8072eec48", - "sku": "US", - "price": 1500, - "currency": "USD", - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "yellow" - ] + "Spring Campaign": { + "points": 50, + "referred_customers": 0 }, - "created_at": "2022-03-17T07:06:13.452532+00:00", - "updated_at": null, - "object": "sku" + "Fall Campaign": { + "points": 50, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 3303, + "referred_customers": 0 + } } - ], - "total": 2 + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "lang": "en", + "test": true + }, + "system_metadata": {}, + "created_at": "2022-02-07T08:28:23.644Z", + "updated_at": "2022-08-31T09:58:30.475Z", + "object": "customer" } } - ], - "total": 2 + } + } + } + }, + "404": { + "description": "Returns an error indicating that a customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id alice2@morgan.com", + "request_id": "v-0b9e924dd243bf26e2", + "resource_id": "alice2@morgan.com", + "resource_type": "customer" + } + } + } } } } } } - } - } - }, - "post": { - "operationId": "create-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Create Product", - "description": "Creates a product object.\n\n\n\n> 🚧 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the product parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_create_product" - }, - "examples": { - "Example": { - "value": { - "source_id": "first_product", - "name": "Samsung Phone", - "price": 200000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store" - }, - "image_url": "https://www.website.com/image.png" + }, + "/v1/customers/{customerId}/permanent-deletion": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or `source_id`." + } + ], + "post": { + "operationId": "delete-customer-permanently", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Delete Customer Permanently", + "description": "The organization user can remove consumer data permanently from the Voucherify system by using this API method. It d​eletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a permanent deletion object and status of the deletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_permanent_deletion_response_body" + }, + "examples": { + "Example": { + "value": { + "id": "del_7k3buMvBsJuXiLRmdh1WZvZs", + "created_at": "2022-09-02T17:50:29.302Z", + "related_object_id": "cust_XI8sPLvznzVpNI1BMIWGcUJa", + "related_object": "customer", + "status": "DONE", + "data_json": { + "events": 16, + "customer_events": 28, + "daily_events": 0, + "segments": 0, + "orders": 9, + "order_events": 5, + "customer": 1 + }, + "object": "pernament_deletion" + } + } + } + } + } + }, + "404": { + "description": "Returns an error indicating that a customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_W8n9I8pJDXlM69j49iKJeYp", + "request_id": "v-0b4c62635a154e96f1", + "resource_id": "cust_W8n9I8pJDXlM69j49iKJeYp", + "resource_type": "customer" + } + } + } + } } } } } - } - }, - "responses": { - "200": { - "description": "Returns a product object if the operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" - }, - "examples": { - "Example": { - "value": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone", - "price": 200000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store" + }, + "/v1/customers/importCSV": { + "post": { + "operationId": "import-customers-using-csv", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Import and Update Customers using CSV", + "description": "This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas. \n\n## Request Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/customers/importCSV \\\n -F file=@/path/to/customers.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n## CSV File Format\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.\n\n\n> 📘 Standard customer fields mapping\n>\n> **No spaces allowed in field names** \n> Name, Email, Phone, Birthdate, Source_id, Address_line_1, Address_line_2, Address_Postal_Code, Address_City, Address_State, Address_Country, Description, Metadata_name_1, Metadata_name_2\n\n## Update Customers using CSV\n\nIf you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + }, + "examples": {} + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "image_url": "https://www.website.com/image.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T12:59:55.890Z", - "object": "product" + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } + } + } } } } } } - } - } - } - }, - "/v1/products/{productId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "prod_f1r5Tpr0DuC7" }, - "name": "productId", - "in": "path", - "required": true, - "description": "A Voucherify product ID or source ID." - } - ], - "get": { - "operationId": "get-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Get Product", - "description": "Retrieve product details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a product object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" - }, - "examples": { - "Example": { - "value": { - "id": "prod_f1r5Tpr0DuC7", - "source_id": "test_prod_id_1", - "name": "Apple iPhone 8", - "price": null, - "attributes": [ - "color", - "memory" - ], - "metadata": { - "test": true, - "vendor": "Cortland" - }, - "image_url": null, - "created_at": "2021-12-03T06:33:46.101Z", - "updated_at": null, - "object": "product", - "skus": { - "object": "list", - "data_ref": "data", - "data": [ + "/v1/customers/bulk/async": { + "post": { + "operationId": "update-customers-in-bulk", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customers in bulk", + "description": "Update several customers in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the customer fields that you would like to update in each customer object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_update_in_bulk_request_body" + }, + "examples": { + "Example": { + "value": [ { - "id": "sku_0a417bd1d9952f9d6f", - "source_id": "test_iphone_8_silver_256gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 256GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "256" + "source_id": "John.Smith@email.com", + "name": "John Smith", + "email": "john.smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.599097+00:00", - "updated_at": null, - "object": "sku" + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "2022-04-04" }, { - "id": "sku_0a417bd1d9952f9d6e", - "source_id": "test_iphone_8_silver_64gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 64GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "64" + "source_id": "Jane.Smith@email.com", + "name": "Jane Smith", + "email": "Jane.Smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.598595+00:00", - "updated_at": null, - "object": "sku" + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "2022-03-03" + }, + { + "source_id": "Sally.Smith@email.com", + "name": "Sally Smith", + "email": "Sally.Smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-02-02" } - ], - "total": 2 + ] } } } } - } - } - }, - "404": { - "description": "Returns an error when requesting a product that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + } + } + } + }, + "400": { + "description": "Returns an error if metadata fields are incorrect data type or a customer's source ID is missing in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Metadata validation failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'true')", + "request_id": "v-0afb29d91094432cea" + } + }, + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'source_id'", + "request_id": "v-0ba51a2f5ec3bf76de" + } + } + } + } + } }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id test_prod_id_", - "request_id": "v-0bae1d3caf478da111", - "resource_id": "test_prod_id_", - "resource_type": "product" + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "default": 429 + }, + "message": { + "type": "string", + "default": "Too many requests hit the API too quickly." + } + } + } } } } } } - } - } - }, - "put": { - "operationId": "update-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Product", - "description": "Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters of the product that are to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_product" - }, - "examples": { - "Example": { - "value": { - "price": 210000 + }, + "/v1/customers/metadata/async": { + "post": { + "operationId": "update-customers-metadata-in-bulk", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customers' Metadata in bulk", + "description": "Update several customers metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "List the `source_ids` of the customer's you would like to update along with the metadata key value pairs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body" + }, + "examples": { + "Example": { + "value": { + "source_ids": [ + "source_123", + "source_456" + ], + "metadata": { + "lang": "en", + "test": false + } + } + } + } } } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an updated product object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } + } + } + } + } }, - "examples": { - "Example": { - "value": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone", - "price": 210000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": false, - "vendor": "Online Stores" + "400": { + "description": "An error will be returned when submitting a request with no source IDs or missing metadata.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "image_url": "https://www.website.com/image.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T13:33:48.904Z", - "object": "product" + "examples": { + "Not enough source IDs": { + "value": { + "code": 400, + "key": "not_enough_source_ids", + "message": "Not enough source_ids", + "details": "Specify at least 1 source_id", + "request_id": "v-0ba50abf2843bf6585" + } + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'metadata'", + "request_id": "v-0ba50c720789984b5c" + } + } + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Delete Product", - "description": "This method deletes a product.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the product will be removed permanently. Going forward, the user will be able to create another product with exactly the same `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the product with given ID was not found.", - "content": { - "application/json": { + "/v1/customers/{customerId}/consents": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string" }, - "examples": { - "Product Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id prod_0a4934c50ddc5dbae", - "request_id": "v-0ae39cd7de8683dfd8", - "resource_id": "prod_0a4934c50ddc5dbae", - "resource_type": "product" - } - } - } + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify unique customer identifier or source ID." } - } - } - } - } - }, - "/v1/products/bulk/async": { - "post": { - "operationId": "update-products-in-bulk", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Products in bulk", - "description": "Update several products in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Create an array of product objects, each with the parameters which you want to update.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/11_req_update_product_bulk" + ], + "put": { + "operationId": "update-customers-consents", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer's consents", + "description": "Update marketing permissions for the specified customer.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - }, - "examples": { - "Example": { - "value": [ - { - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 3" - }, - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" + ], + "requestBody": { + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customers_consents" }, - { - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 4" + "examples": { + "Example": { + "value": { + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, + "cnst_VCmucIvAsmDYw2PPAok6bcYy": false + } }, - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" + "Opt-out of all": { + "value": { + "unsubscribed": true + } + } } - ] + } } - } - } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + }, + "responses": { + "204": { + "description": "Returns no content if the consents were updated successfully." }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + "400": { + "description": "Returns an error if the payload is empty.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "The payload cannot be empty", + "request_id": "v-0ba675252cc3bf6b03" + } + } + } } } } } } }, - "400": { - "description": "Returns an error if the required parameters are not included in the request body.", - "content": { - "application/json": { + "/client/v1/customers/{customerId}/consents#": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string" }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'source_id'", - "request_id": "v-0bae44e063cca61aff" + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer identifier or `source_id`" + } + ], + "put": { + "operationId": "update-customers-consents-client-side", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer's consents (client-side)", + "description": "Update marketing permissions for the specified customer.", + "parameters": [], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customers_consents" + }, + "examples": { + "Example": { + "value": { + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, + "cnst_VCmucIvAsmDYw2PPAok6bcYy": false + } + }, + "Opt-out of all": { + "value": { + "unsubscribed": true + } + } } } } - } - } - } - } - } - }, - "/v1/products/metadata/async": { - "post": { - "operationId": "update-products-metadata-in-bulk", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Products' Metadata in bulk", - "description": "Update several product metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the list of product source IDs and the metadata key value pairs to be udpated for these products.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_products_metadata_in_bulk" }, - "examples": { - "Example": { - "value": { - "source_ids": [ - "123-567-3433", - "test_volleyball" - ], - "metadata": { - "label": true, - "origin": "PL" + "responses": { + "204": { + "description": "Returns no content if the consents were updated successfully." + }, + "400": { + "description": "Returns an error if the payload is empty.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example": { + "value": {} + } + } } } } } } - } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { + }, + "/v1/customers/{customerId}/activities": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "type": "string" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or source ID of the customer who performed the activities." + } + ], + "get": { + "operationId": "list-customer-activities", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customer Activities", + "description": "Retrieve customer activities.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/order" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after", + "description": "A cursor for use in pagination. `starting_after` is a date-time value that defines your place in the list based on `created_at` property from the activity object. For instance, if you make a list request and receive 100 objects, ending with an object created at 2020-05-24T13:43:09.024Z, your subsequent call can include starting_after=2020-05-24T13:43:09.024Z in order to fetch the next page of the list." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after_id", + "description": "By applying this filter value, you will get events starting after an event with the given ID." + }, + { + "schema": { + "enum": [ + "DISCOUNT_COUPONS", + "REFERRAL_PROGRAM", + "GIFT_VOUCHERS", + "PROMOTION", + "LOYALTY_PROGRAM" + ], + "type": "string" + }, + "in": "query", + "name": "campaign_type", + "description": "Through this parameter you can control a type of campaign by which Voucherify will filter related customer's activity. API will return only records related to that given type. Allowed values: DISCOUNT_COUPONS, REFERRAL_PROGRAM, GIFT_VOUCHERS, PROMOTION, LOYALTY_PROGRAM" }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign_id", + "description": "By applying this parameter you request only events related to specific campaign identified by its ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with customer activities.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_res_list_customer_activities" + } } } } } } }, - "400": { - "description": "Returns an error if the request parameters are not provided.", - "content": { - "application/json": { + "/v1/customers/{customerId}/segments": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "cust_aSeH6JH52DPjYLC1G475Ii0N" }, - "examples": { - "Not enough source IDs": { - "value": { - "code": 400, - "key": "not_enough_source_ids", - "message": "Not enough source_ids", - "details": "Specify at least 1 ID in source_ids.", - "request_id": "v-0bae421d05078dcdb4" - } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'metadata'", - "request_id": "v-0bae428dab8ca61825" + "name": "customerId", + "in": "path", + "required": true, + "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID." + } + ], + "get": { + "operationId": "list-customer-segments", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customer's Segments", + "description": "Returns the list of segments IDs to which the customer belongs to. \n\nIf you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "The method returns segment(s) to which the given customer belongs to.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_res_customers_customerId_segments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "seg_DNAOhUtJffvX0f57ajLMFBYR", + "name": "area code not 123", + "object": "segment" + }, + { + "id": "seg_IPIYx96l92Op0Sy5MOaImhgw", + "name": "not bob.smith@email.com", + "object": "segment" + }, + { + "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2", + "name": "Birthday After Dec 31", + "object": "segment" + }, + { + "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2", + "name": "Start with S", + "object": "segment" + }, + { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt", + "name": "Loyalty Card", + "object": "segment" + } + ], + "total": 5 + } + } + } } } } } } - } - } - } - }, - "/v1/skus/{skuId}": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "skuId", - "in": "path", - "required": true, - "description": "A Voucherify SKU identifier or SKU source ID." - } - ], - "get": { - "operationId": "get-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Get SKU", - "description": "Retrieve details of a SKU.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns requested SKU object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "examples": { - "Example": { - "value": { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" + "/v1/order-object": { + "get": { + "operationId": "order-object", + "tags": [ + "ORDERS API" + ], + "summary": "Order Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Order Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object" + } } } } } } }, - "404": { - "description": "Returns an error indicating that the sku with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "/v1/orders": { + "get": { + "operationId": "list-orders", + "tags": [ + "ORDERS API" + ], + "summary": "List Orders", + "description": "Returns a list of orders.\n\n", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find sku with id sku_0b1621b319d248b79", - "request_id": "v-0b4fe3ddc55646d01d", - "resource_id": "sku_0b1621b319d248b79", - "resource_type": "sku" + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with order objects. The orders are returned sorted by creation date by default, with the most recent orders appearing last, unless you specify another sequence using the order query parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_res_list_orders" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "orders", + "orders": [ + { + "id": "ord_v5vupdacgud1CwUSyKqSlHuk", + "source_id": null, + "created_at": "2022-09-09T07:44:41.594Z", + "updated_at": "2022-09-09T07:44:42.331Z", + "status": "PAID", + "amount": 2700, + "discount_amount": 1243, + "items_discount_amount": 270, + "total_discount_amount": 1513, + "total_amount": 1187, + "items": [ + { + "object": "order_item", + "source_id": "prod_5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 700, + "discount_amount": 70, + "price": 700, + "subtotal_amount": 630, + "product": { + "name": "Shipping" + } + }, + { + "object": "order_item", + "source_id": "roses_1", + "related_object": "product", + "quantity": 1, + "amount": 500, + "discount_amount": 50, + "price": 500, + "subtotal_amount": 450, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 500 + } + }, + { + "object": "order_item", + "source_id": "vase_1", + "related_object": "product", + "quantity": 1, + "amount": 1500, + "discount_amount": 150, + "price": 1500, + "subtotal_amount": 1350, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0baa093537528ef645": { + "date": "2022-09-09T07:44:41.695Z", + "related_object_type": "redemption", + "related_object_id": "r_0baa093537528ef645", + "stacked": [ + "r_0baa093537528ef646", + "r_0baa093537528ef647", + "r_0baa093537528ef648" + ] + } + } + }, + { + "id": "ord_3JkWC6jG0JgyRf5lO3r4IyU1", + "source_id": null, + "created_at": "2022-09-09T07:04:22.597Z", + "updated_at": "2022-09-09T07:04:23.743Z", + "status": "PAID", + "amount": 73100, + "items_discount_amount": 7310, + "total_discount_amount": 7310, + "total_amount": 65790, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "discount_amount": 7000, + "price": 70000, + "subtotal_amount": 63000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "discount_amount": 160, + "price": 1600, + "subtotal_amount": 1440, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "discount_amount": 150, + "price": 1500, + "subtotal_amount": 1350, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fffae90e1b2495": { + "date": "2022-09-09T07:04:22.692Z", + "related_object_type": "voucher", + "related_object_id": "v_24rljiUfdLNC9poBf0BPNmoh2txzFkLs" + } + } + }, + { + "id": "ord_HwdbziIPvUZJkIC7z74FKmPv", + "source_id": null, + "created_at": "2022-09-09T06:47:14.195Z", + "updated_at": "2022-09-09T06:47:15.369Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 7160, + "total_discount_amount": 7160, + "total_amount": 64440, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fc0eb00e1b2230": { + "date": "2022-09-09T06:47:14.369Z", + "related_object_type": "voucher", + "related_object_id": "v_3vEprqa6tbzfhFtpjr4mDlkNchXepW7s" + } + } + }, + { + "id": "ord_HRluwFS2seoILUkXxWML0D7Z", + "source_id": null, + "created_at": "2022-09-09T06:44:27.383Z", + "updated_at": "2022-09-09T06:44:28.252Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 71500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order", + "redemptions": { + "r_0ba9fb6bb7928ed9ec": { + "date": "2022-09-09T06:44:27.486Z", + "related_object_type": "voucher", + "related_object_id": "v_vhHuiEmZSchWHtE0xKm0HM7PFCR9cNkA", + "related_object_parent_id": "camp_rRsfatlwN7unSeUIJDCYedal" + } + } + }, + { + "id": "ord_Qg5utCohAZ3tafYvc1O4C80r", + "source_id": null, + "created_at": "2022-09-09T06:42:34.083Z", + "updated_at": "2022-09-09T06:42:35.169Z", + "status": "PAID", + "amount": 70000, + "discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 66000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fafd11d28ed999": { + "date": "2022-09-09T06:42:34.183Z", + "related_object_type": "voucher", + "related_object_id": "v_RaMaTT7F0Q47BetdGcFxsyqwo1aZGzJs", + "related_object_parent_id": "camp_hg7ajfHh6DcE1xa18mw3SdF6" + } + } + }, + { + "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", + "source_id": null, + "created_at": "2022-09-09T06:38:17.984Z", + "updated_at": "2022-09-09T06:38:19.064Z", + "status": "PAID", + "amount": 4600, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 4300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0a65b3ff8592d7a5b5", + "quantity": 1, + "amount": 3000, + "discount_amount": 300, + "price": 3000, + "subtotal_amount": 2700, + "product": { + "name": "Koffee Cup", + "price": 3000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fa02fcd28ed8f1": { + "date": "2022-09-09T06:38:18.099Z", + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + }, + { + "id": "ord_N3YBowDTZs0UH2hHoMZLbUDN", + "source_id": null, + "created_at": "2022-09-09T06:18:31.459Z", + "updated_at": "2022-09-09T06:18:31.624Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 7160, + "total_discount_amount": 7160, + "total_amount": 64440, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9f57c37128ed639": { + "date": "2022-09-09T06:18:31.516Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", + "related_object_parent_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0" + } + } + }, + { + "id": "ord_3R6vsxRZRkND8rpe0rAn9Agc", + "source_id": null, + "created_at": "2022-09-05T08:13:13.720Z", + "updated_at": "2022-09-05T08:13:14.498Z", + "status": "PAID", + "amount": 74000, + "items_discount_amount": 1500, + "total_discount_amount": 1500, + "total_amount": 72500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 2, + "amount": 3000, + "discount_amount": 500, + "price": 1500, + "subtotal_amount": 2500, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b00ffed198e344", + "quantity": 2, + "amount": 1000, + "discount_amount": 1000, + "price": 500, + "subtotal_amount": 0, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" + }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba4e961444579711a": { + "date": "2022-09-05T08:13:13.873Z", + "related_object_type": "voucher", + "related_object_id": "v_hwySVBBk6YmMD4GzZHJzke1Fxo3QO7kP", + "related_object_parent_id": "camp_Uji5a53s5wRSUHqznncTkhHh" + } + } + }, + { + "id": "ord_7bqlkoHyEJCQuxVZpKfZYNeA", + "source_id": null, + "created_at": "2022-09-02T17:12:13.213Z", + "updated_at": "2022-09-02T17:12:13.969Z", + "status": "PAID", + "amount": 292400, + "items_discount_amount": 900, + "total_discount_amount": 900, + "total_amount": 291500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 4, + "amount": 6400, + "price": 1600, + "subtotal_amount": 6400, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 4, + "amount": 6000, + "price": 1500, + "subtotal_amount": 6000, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 4, + "amount": 280000, + "discount_amount": 900, + "price": 70000, + "subtotal_amount": 279100, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" + }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba187f9bb45792c13": { + "date": "2022-09-02T17:12:13.293Z", + "related_object_type": "voucher", + "related_object_id": "v_pg6DhwhmeZASoSoJ15PdzMT9MhsPjYuc", + "related_object_parent_id": "camp_W8DJVd8J0btqXT6FBwn7BSkC" + } + } + }, + { + "id": "ord_7HwbJiHmS07O7FsVAtjJcuRS", + "source_id": null, + "created_at": "2022-09-02T17:08:37.794Z", + "updated_at": "2022-09-02T17:08:38.879Z", + "status": "PAID", + "amount": 223900, + "items_discount_amount": 900, + "total_discount_amount": 900, + "total_amount": 223000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 4, + "amount": 6400, + "discount_amount": 300, + "price": 1600, + "subtotal_amount": 6100, + "product": { + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 3, + "amount": 210000, + "discount_amount": 300, + "price": 70000, + "subtotal_amount": 209700, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 5, + "amount": 7500, + "discount_amount": 300, + "price": 1500, + "subtotal_amount": 7200, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" + }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba1872762c5792b73": { + "date": "2022-09-02T17:08:37.899Z", + "related_object_type": "voucher", + "related_object_id": "v_yQydppWWJpSUuGNEWJ4I2upFGY2Ma4IY", + "related_object_parent_id": "camp_A5L21BD4cJii28882owYBqTV" + } + } + } + ], + "total": 441 + } + } + } } } } } - } - } - } - } - }, - "/v1/products/{productId}/skus": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "productId", - "in": "path", - "description": "A Voucherify [product](ref:get-product) ID or product source ID.", - "required": true - } - ], - "get": { - "operationId": "list-skus-in-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "List SKUs in Product", - "description": "Retrieve all SKUs for a given product.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of SKUs.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_res_products_productId_skus" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "skus", - "skus": [ - { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 + "post": { + "operationId": "create-order", + "tags": [ + "ORDERS API" + ], + "summary": "Create Order", + "description": "Creates an order object and triggers an order creation event. ", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the order parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_create_order" + }, + "examples": { + "Example": { + "value": { + "amount": 20000, + "customer": { + "source_id": "sample_customer" }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" - }, - { - "id": "sku_0b1621b3181248b79d", - "source_id": "sku_source_id_3", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Medium Yellow Shirt", - "price": 1450, - "currency": "USD", - "attributes": { - "size": "M", - "color": "yellow", - "ranking": 3 + "status": "PAID", + "items": [ + { + "quantity": 1, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ] + } + }, + "Example 2": { + "value": { + "source_id": "new", + "status": "FULFILLED", + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.180Z", - "updated_at": "2022-07-01T05:34:16.842Z", - "object": "sku" - }, - { - "id": "sku_0b1621b3199248b79e", - "source_id": "sku_source_id_2", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Small Red Shirt", - "price": 1400, - "currency": "USD", - "attributes": { - "size": "S", - "color": "red", - "ranking": 2 + "customer": { + "source_id": "bob.smith.1@email.com", + "name": "Bob Smith", + "description": "A nice customer", + "email": "bob.smith.1@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United Statese", + "line_1": "123 Main St", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": false + }, + "birthdate": "2022-01-02" }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.183Z", - "updated_at": "2022-07-01T05:34:16.927Z", - "object": "sku" - }, - { - "id": "sku_0b1621b319d248b79f", - "source_id": "sku_source_id_4", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Large Pink Shirt -", - "price": 1700, - "currency": "USD", - "attributes": { - "size": "L", - "color": "pink", - "ranking": 4 + "referrer": { + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A really nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3334", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": false + }, + "birthday": "2022-03-03" }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.187Z", - "updated_at": "2022-07-05T08:47:50.680Z", - "object": "sku" + "items": [ + { + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "product": { + "name": "Apple iPhone 12", + "price": 60000, + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "override": true + } + }, + { + "source_id": "ComicBook_1", + "related_object": "sku", + "quantity": 1, + "product": { + "source_id": "Books", + "name": "Comic Books1", + "price": 2100, + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "override": true + }, + "sku": { + "sku": "Comics1", + "source_id": "ComicBook_1", + "price": 1700, + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "override": true + } + } + ] } - ], - "total": 4 - } - } - } - } - } - }, - "404": { - "description": "Returns an error when requesting a product that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id prod_0b15f6b9f650c6990", - "request_id": "v-0bae223075878da708", - "resource_id": "prod_0b15f6b9f650c6990", - "resource_type": "product" + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Create SKU", - "description": "This method adds product varients to a [created product](ref:create-product).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the SKU parameters to be created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_create_sku" }, - "examples": { - "Example": { - "value": { - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 1300, - "currency": "USD", - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the created SKU object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "examples": { - "Example": { - "value": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 1300, - "currency": "USD", - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true + "responses": { + "200": { + "description": "Returns an order object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object_no_discount_calculations" }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": null, - "object": "sku" + "examples": { + "Example": { + "value": { + "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", + "source_id": "new", + "created_at": "2022-09-09T09:20:01.660Z", + "updated_at": "2022-09-09T09:24:43.604Z", + "status": "FULFILLED", + "amount": 121700, + "total_amount": 121700, + "items": [ + { + "object": "order_item", + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "amount": 120000, + "price": 60000, + "subtotal_amount": 120000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "price": 60000 + } + }, + { + "object": "order_item", + "source_id": "ComicBook_1", + "related_object": "sku", + "product_id": "prod_0b7d7dfb05cbe5c616", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "price": 1700 + } + } + ], + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order" + } + } + } } } } } } - } - } - } - }, - "/v1/products/{productId}/skus/{skuId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "productId", - "in": "path", - "required": true, - "description": "A unique Voucherify [product](ref:get-product) ID or product source ID." - }, - { - "schema": { - "type": "string" }, - "name": "skuId", - "in": "path", - "required": true, - "description": "A Voucherify [SKU ID](ref:get-sku) or SKU source ID." - } - ], - "put": { - "operationId": "update-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update SKU", - "description": "Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_sku" - }, - "examples": { - "Example": { - "value": { - "price": 210000, - "currency": "PLN" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the SKU object with the updated parameters.", - "content": { - "application/json": { + "/v1/orders/{orderId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" + "type": "string" }, - "examples": { - "Example": { - "value": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 210000, - "currency": "PLN", - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true - }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": "2022-09-12T14:09:40.859Z", - "object": "sku" - } - } - } + "name": "orderId", + "in": "path", + "required": true, + "description": "Unique Voucherify order ID or order source ID." } - } - } - } - }, - "delete": { - "operationId": "delete-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Delete SKU", - "description": "This method deletes a product SKU.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the SKU will be removed permanently. Going forward, the user will be able to create another SKU with exactly the same `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the product or sku with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Product Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id 123-567-343", - "request_id": "v-0ae3a0d26fd40ecd11", - "resource_id": "123-567-343", - "resource_type": "product" - } - }, - "SKU Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find sku with id sku_0ae3a06b20019ba8f", - "request_id": "v-0ae3a1534d940ecd81", - "resource_id": "sku_0ae3a06b20019ba8f", - "resource_type": "sku" + ], + "get": { + "operationId": "get-order", + "tags": [ + "ORDERS API" + ], + "summary": "Get Order", + "description": "Retrieve an order.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an order object if a valid identifier was provided. ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object" + } } } - } - } - } - } - } - } - }, - "/v1/products/importCSV": { - "post": { - "operationId": "import-products-using-csv", - "tags": [ - "PRODUCTS API" - ], - "summary": "Import Products using CSV", - "description": "Import products into the repository using a CSV file. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/products/importCSV \\\n -F file=@/path/to/products.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nThe CSV file has to include headers in the first line.\n\n\n\n> 📘 Standard product fields mapping\n>\n> - Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).\n> - Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`\n> - **Name** is a **required** field. The remaining fields in the CSV template are optional.\n> - Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.\n> - Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 norms**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11\n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Columns that can't be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata. \n> - To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).\n> - **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e \"attribute1,attribute2\".\n> - Headers with metadata names **can't contain white-space characters**.\n> - If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example: \n> - array of strings: \"subscribed,premium\" \n> - array of numbers: \"123,234\". \n> - array of dates: \"2000-01-01,2000-01-02\"\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - } - } - } - }, - "responses": { - "200": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" }, - "examples": { - "Async Action": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + "404": { + "description": "Returns an error when requesting an order that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find order with id ord_nIcO2s8iD4Xh5E9IGDQ57Ax", + "request_id": "v-0baa1ad023d0656a84", + "resource_id": "ord_nIcO2s8iD4Xh5E9IGDQ57Ax", + "resource_type": "order" + } + } + } } } } } - } - }, - "400": { - "description": "Returns an invalid payload error. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'file'", - "request_id": "v-0c4c46bbad0136789f" + }, + "put": { + "operationId": "update-order", + "tags": [ + "ORDERS API" + ], + "summary": "Update Order", + "description": "Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters of the order that are to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_update_order" + }, + "examples": { + "Example": { + "value": { + "status": "CANCELED" + } + } } } } - } - } - } - } - } - }, - "/v1/skus/importCSV": { - "post": { - "operationId": "import-skus-using-csv", - "tags": [ - "PRODUCTS API" - ], - "summary": "Import SKUs using CSV", - "description": "Import SKUs into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/skus/importCSV \\\n -F file=@/path/to/skus.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n> 🚧 Import sequence\n>\n> First import products using the [dedicated endpoint](ref:import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.\n\n\n\n> 📘 Standard SKU fields mapping\n>\n> - **Required** fields are source_id and product_id.\n> - Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`\n> - SKU **source_id**'s must be unique in the entire product catalog, no duplicates allowed.\n> - SKU attributes need to be in the form of a stringy-fied json, i.e.`\"{'color':'blue'}\"`. These attributes must be defined in the **product** beforehand in order for you to be able to import them to the SKU.\n> - You can use this method to update the following parameters in bulk: **sku** and the sku **price**.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - } - } - } - }, - "responses": { - "200": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Async Action": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + }, + "responses": { + "200": { + "description": "Returns the order object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object" + }, + "examples": { + "Example": { + "value": { + "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", + "source_id": "new", + "created_at": "2022-09-09T09:20:01.660Z", + "updated_at": "2022-09-09T09:41:00.881Z", + "status": "CANCELED", + "amount": 121700, + "total_amount": 121700, + "items": [ + { + "object": "order_item", + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "amount": 120000, + "price": 60000, + "subtotal_amount": 120000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "price": 60000 + } + }, + { + "object": "order_item", + "source_id": "ComicBook_1", + "related_object": "sku", + "product_id": "prod_0b7d7dfb05cbe5c616", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "price": 1700 + } + } + ], + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order" + } + } + } } } } } } - } - } - } - }, - "/v1/product-collection-object": { - "get": { - "operationId": "product-collection-object", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Product Collection Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Product Collection Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_collection_item" - } - } - } - } - } - } - }, - "/v1/product-collections": { - "get": { - "operationId": "list-product-collections", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "List Product Collections", - "description": "This method returns a list of product collections.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary containing a list of product collections and details about each product collection.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_list_response_body" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", - "name": "Products in Poland", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.product_location": { - "conditions": { - "$in_location": [ - "loc_RcYz537sV07e1t5aG5tIH9FD" - ] - } - } - }, - "created_at": "2022-07-14T16:12:26.377Z", - "object": "products_collection" - }, - { - "id": "pc_FJdBpaQyvK6Gcdul4D2HRChI", - "name": "Price less than 10", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "price": { - "conditions": { - "$less_than": [ - 1000 - ] - } - } - }, - "created_at": "2022-03-17T07:11:25.406Z", - "object": "products_collection" - }, - { - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "name": "Color is brown", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.color": { - "conditions": { - "$is": [ - "brown" - ] + "/v1/orders/import": { + "post": { + "operationId": "import-orders", + "tags": [ + "ORDERS API" + ], + "summary": "Import Orders", + "description": "\n\n> 🚧 Historical orders\n>\n> This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the [create order](ref:create-order) and [update order](ref:update-order) endpoints should be used. This is critical because this endpoint does not store events or launch distributions.\n\n## Limitations\n\n### Import volume\n\nThere can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. \n\n### Maximum count of orders in single import\n\nThere is a `2000` limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time.\n\n## Notifications\n\nThere are no notifications on the Dashboard because this import is launched via the API.\n\n## Triggered actions\n \nIf you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segment's summary. Consequently, this update will trigger \n- **customers entering into segments** \n- **distributions** based on any rules tied to customer entering segment(s)\n- **earning rules** based on the customer entering segment(s)\n\n## What is not triggered\n\n1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. \n\n2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. \n\n3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you won't see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you won't see the Product created events listed, etc. \n\n4. Earning rules based on Order Paid won't be triggered.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The request body is sent in the form of an array of order objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_orders_import" + }, + "examples": { + "Example": { + "value": [ + { + "source_id": "orderImport14", + "status": "PAID", + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "source_id": "bob2.smith@email.com", + "name": "Bob Smith", + "description": "A nice customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-01-01" + }, + "referrer": { + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A really nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3334", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": false + }, + "birthday": "2022-03-03" + }, + "items": [ + { + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "product": { + "name": "Apple iPhone 12", + "price": 70000, + "metadata": { + "color": [ + "silver" + ], + "vendor": "mall" + }, + "override": true + } + }, + { + "source_id": "ComicBook_1", + "related_object": "sku", + "quantity": 1, + "product": { + "source_id": "Books", + "name": "Comic Books1", + "price": 1600, + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "override": true + }, + "sku": { + "sku": "Comics1", + "source_id": "ComicBook_1", + "price": 1600, + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "override": true + } } - } + ] }, - "created_at": "2022-03-16T14:27:49.612Z", - "object": "products_collection" - }, - { - "id": "pc_BxofAP7pyM9FO7M6iaIzIouy", - "name": "Color not brown", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.color": { - "conditions": { - "$is_not": [ - "brown" - ] + { + "source_id": "orderImport15", + "status": "PAID", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "customer": { + "source_id": "bob2.smith@email.com" + }, + "referrer": { + "source_id": "jane.smith@email.com" + }, + "items": [ + { + "source_id": "ComicBook_1", + "quantity": 4, + "related_object": "sku", + "sku": { + "source_id": "ComicBook_1" + } + }, + { + "source_id": "vase_1", + "quantity": 1, + "related_object": "product", + "product": { + "source_id": "vase_1" + } } - } + ] }, - "created_at": "2022-03-16T13:49:05.697Z", - "object": "products_collection" - }, - { - "id": "pc_uHpM9ipEQH2yEpm3D8aohkBM", - "name": "Price less than 20", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "price": { - "conditions": { - "$less_than": [ - 2000 - ] + { + "source_id": "orderImport16", + "status": "FULFILLED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "customer": { + "id": "cust_LMY4ZylSdUYB1J4tzqNcl5VV" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "items": [ + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 2 + }, + { + "sku_id": "sku_0b1621b319d248b79f", + "quantity": 2 } - } + ] }, - "created_at": "2022-03-16T13:46:01.102Z", - "object": "products_collection" - }, - { - "id": "pc_ZgM25PcZAMp6qItKJRtR2mEi", - "name": "Name starts with S", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "name": { - "conditions": { - "$starts_with": [ - "S" - ] - } + { + "source_id": "orderImport17", + "status": "CANCELED", + "amount": 7000, + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] } }, - "created_at": "2022-03-16T13:42:35.917Z", - "object": "products_collection" - }, - { - "id": "pc_41V4DiQQO8YGqj0J2oZD57j4", - "name": "Ends with baby", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "source_id": { - "conditions": { - "$ends_with": [ - "baby" - ] + { + "source_id": "orderImport18", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "items": [ + { + "source_id": "ComicBook_1", + "amount": 900, + "related_object": "sku" + }, + { + "source_id": "vase_1", + "amount": 2000, + "related_object": "product" } - } + ] }, - "created_at": "2022-03-14T12:50:19.885Z", - "object": "products_collection" - }, - { - "id": "pc_0cRX5wAFt1R1R5Ir6WdTowui", - "name": "C start", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "name": { - "conditions": { - "$starts_with": [ - "C" - ] + { + "source_id": "orderImport19", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "items": [ + { + "amount": 900 + }, + { + "amount": 2000 } - } + ] }, - "created_at": "2022-03-14T12:18:15.588Z", - "object": "products_collection" - }, - { - "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", - "name": "Shirts", - "type": "STATIC", - "products": [ - { - "id": "prod_0a9f9aeddb019a42db", - "object": "product" + { + "source_id": "orderImport20", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] }, - { - "id": "prod_0a9f9ab4ab019a42d5", - "object": "product" - } - ], - "created_at": "2022-02-28T11:42:12.484Z", - "object": "products_collection" + "items": [ + { + "price": 900, + "quantity": 2 + }, + { + "price": 2000, + "quantity": 3 + } + ] + } + ] + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the order(s) will be added to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } + } + } + } + } + }, + "400": { + "description": "Returns an error if the payload is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .items[0].initial_quantity cannot be lower than 1", + "request_id": "v-0c5561d945cb0f0fb5" + } } - ], - "total": 9 + } } } } } } - } - } - }, - "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}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "pc_41V4DiQQO8YGqj0J2oZD57j4" }, - "name": "productCollectionId", - "in": "path", - "required": true, - "description": "A unique product collection ID." - } - ], - "get": { - "operationId": "get-product-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Get Product Collection", - "description": "Retrieves the product collection.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a products collection object if a valid identifier was provided in the path.", - "content": { - "application/json": { - "schema": { - "$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": { - "value": { - "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", - "name": "Products in Poland", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.product_location": { - "conditions": { - "$in_location": [ - "loc_RcYz537sV07e1t5aG5tIH9FD" + "/v1/orders/export": { + "post": { + "operationId": "create-order-export", + "tags": [ + "ORDERS API" + ], + "summary": "Create Orders Export", + "description": "Creates a downloadable CSV file containing a list of orders.\n\nThe parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the `parameters.fields` object in the request body.\n\nThe available filters are all [order object](ref:get-order) attributes. Additionally, any metadata defined in the metadata schema can be exported.\n\nPassing an empty JSON will generate a file containing three default fields: `id`, `source_id`, and `status`.\n\nThe fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify which order parameters you would like to export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_create_order_export" + }, + "examples": { + "Using fields": { + "value": { + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" ] } } }, - "created_at": "2022-07-14T16:12:26.377Z", - "object": "products_collection" + "Using fields and filters": { + "value": { + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" + ], + "order": "-updated_at", + "filters": { + "discount_amount": { + "conditions": { + "$more_than": 100000 + } + } + } + } + } + } } - }, - "Static": { - "value": { - "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", - "name": "Shirts", - "type": "STATIC", - "products": [ - { - "id": "prod_0a9f9aeddb019a42db", - "object": "product" - }, - { - "id": "prod_0a9f9ab4ab019a42d5", - "object": "product" + } + } + }, + "responses": { + "200": { + "description": "Returns the `id` of the export object and `status` of the file generation process. The `id` is used in the [Get Export](ref:get-export) method to generate the url for the downloadable CSV file or in the [Download Export](ref:download-export) method to return the contents of the CSV file. The status indicates whether the file has been scheduled for creation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_pT2Y1mgYsAgRAqsWTGf7PQX7", + "object": "export", + "created_at": "2022-09-09T10:45:52.362Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "order", + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" + ] + }, + "result": null, + "user_id": null + } } - ], - "created_at": "2022-02-28T11:42:12.484Z", - "object": "products_collection" + } + } + } + }, + "400": { + "description": "Returns an error if the request payload is specified incorrectly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .parameters.filters should match either `filters[${field}][conditions][${condition}][${index}]` or `filters[${field}][conditions][${condition}]` format and condition must be one of: $in, $not_in, $in_location, $not_in_location, $is, $is_days_ago, $is_days_in_future, $is_not, $has_value, $is_unknown, $contains, $not_contain, $starts_with, $ends_with, $more_than, $less_than, $more_than_ago, $less_than_ago, $more_than_future, $less_than_future, $more_than_equal, $less_than_equal, $after, $before, $count, $count_less, $count_more, $today, $tomorrow, $yesterday, $this_week, $last_week, $next_week, $this_month, $last_month, $next_month, $this_year, $next_year, $last_year, $is_day_of_month, $is_day, $is_month, $is_year, $today_md, $tomorrow_md, $yesterday_md, $this_week_md, $last_week_md, $next_week_md, $this_month_md, $last_month_md, $next_month_md, $is_days_ago_md, $is_more_days_ago_md, $is_less_days_ago_md, $is_days_in_future_md, $is_more_days_in_future_md, $is_less_days_in_future_md, $is_years_ago, $active, $failed, $in_progress, $expired, $before_start, $enabled, $disabled, $redeemed, $redeemable", + "request_id": "v-0c52e783650ae585b2" + } + } + } } } } } } }, - "404": { - "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", - "request_id": "v-0b4ec2530e9646cb15", - "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", - "resource_type": "products_collection" + "/v1/product-object": { + "get": { + "operationId": "product-object", + "tags": [ + "PRODUCTS API" + ], + "summary": "Product Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Product Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object" + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-product-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Delete Product Collection", - "description": "This method deletes a product collection.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "400": { - "description": "Returns an error indicating that the product collection with given ID is in use by other resources.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_resource_in_use" - }, - "examples": { - "Product Colllection In Use": { - "value": { - "code": 400, - "key": "resource_in_use", - "message": "Resource in use", - "details": "Resource products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j4 is in use by validation_ruless with ids [val_9TB89AjZeVEJ]", - "request_id": "v-0ae3a63aff940ed1b2", - "related_object_ids": [ - "val_9TB89AjZeVEJ" - ], - "related_object_type": "validation_rules" + "/v1/sku-object": { + "get": { + "operationId": "sku-object", + "tags": [ + "PRODUCTS API" + ], + "summary": "SKU Object", + "description": "Data model description", + "responses": { + "200": { + "description": "SKU Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" + } } } } } } }, - "404": { - "description": "Returns an error indicating that the product collection with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "/v1/products": { + "get": { + "operationId": "list-products", + "tags": [ + "PRODUCTS API" + ], + "summary": "List Products", + "description": "Retrieve a list of products.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "examples": { - "Product Collection Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", - "request_id": "v-0ae3a49261d027b870", - "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", - "resource_type": "products_collection" + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_res_list_products" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "products", + "products": [ + { + "id": "prod_f1r5Tpr0DuC7", + "source_id": "test_prod_id_1", + "name": "Apple iPhone 8", + "price": null, + "attributes": [ + "color", + "memory" + ], + "metadata": { + "test": true, + "vendor": "Cortland" + }, + "image_url": null, + "created_at": "2021-12-03T06:33:46.101Z", + "updated_at": null, + "object": "product", + "skus": { + "data": [ + { + "id": "sku_0a417bd1d9952f9d6f", + "source_id": "test_iphone_8_silver_256gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 256GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "256" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.599097+00:00", + "updated_at": null, + "object": "sku" + }, + { + "id": "sku_0a417bd1d9952f9d6e", + "source_id": "test_iphone_8_silver_64gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 64GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "64" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.598595+00:00", + "updated_at": null, + "object": "sku" + } + ], + "total": 2 + } + }, + { + "id": "prod_0ac67e1bb8072eec48", + "source_id": "test_volleyball", + "name": "VolleyBall", + "price": 1100, + "attributes": [], + "metadata": { + "color": [ + "white" + ], + "label": true, + "origin": "PL" + }, + "image_url": null, + "created_at": "2022-03-16T14:01:45.459Z", + "updated_at": "2022-04-26T12:51:35.500Z", + "object": "product", + "skus": { + "data": [ + { + "id": "sku_0ac768973f5c4ea0d0", + "source_id": "test_volleyball_pl", + "product_id": "prod_0ac67e1bb8072eec48", + "sku": "PL", + "price": 500, + "currency": "USD", + "attributes": {}, + "image_url": null, + "metadata": { + "color": [ + "red" + ] + }, + "created_at": "2022-03-17T07:06:13.629918+00:00", + "updated_at": null, + "object": "sku" + }, + { + "id": "sku_0ac7689713072e1df6", + "source_id": "test_volleyball_us", + "product_id": "prod_0ac67e1bb8072eec48", + "sku": "US", + "price": 1500, + "currency": "USD", + "attributes": {}, + "image_url": null, + "metadata": { + "color": [ + "yellow" + ] + }, + "created_at": "2022-03-17T07:06:13.452532+00:00", + "updated_at": null, + "object": "sku" + } + ], + "total": 2 + } + } + ], + "total": 2 + } + } + } } } } } - } - } - } - } - }, - "/v1/product-collections/{productCollectionId}/products": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "productCollectionId", - "in": "path", - "required": true, - "description": "Unique product collection ID." - } - ], - "get": { - "operationId": "list-products-in-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "List Products in Collection", - "description": "Retrieves list of products from a products collection; works for both dynamic and static product collections.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of products and/or SKUs grouped in the collection with each product's/SKU's details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_list_products_response_body" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000, + }, + "post": { + "operationId": "create-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Create Product", + "description": "Creates a product object.\n\n\n\n> 🚧 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the product parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_create_product" + }, + "examples": { + "Example": { + "value": { + "source_id": "first_product", + "name": "Samsung Phone", + "price": 200000, "attributes": [ "color", "memory", @@ -80823,1557 +79161,1085 @@ ], "metadata": { "test": true, - "vendor": "Online Store - 4" - }, - "image_url": "https://www.images.com/image4.png", - "created_at": "2022-09-12T14:44:13.212Z", - "updated_at": null, - "object": "product" - }, - { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 210000, - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "test": false, - "vendor": "Online Stores", - "imported": true + "vendor": "Online Store" }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": "2022-09-12T14:09:40.859Z", - "object": "sku", - "product": { + "image_url": "https://www.website.com/image.png" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a product object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object" + }, + "examples": { + "Example": { + "value": { "id": "prod_0bae2dc5a090fd0184", "source_id": "first_product", "name": "Samsung Phone", - "price": null, - "attributes": [], - "metadata": {}, - "object": "product" - } - }, - { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 3" - }, - "image_url": "https://www.images.com/image2.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T14:44:13.208Z", - "object": "product" - }, - { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku": "Comics1", - "price": 1700, - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "golden" + "price": 200000, + "attributes": [ + "color", + "memory", + "processor" ], - "vendor": "islands" - }, - "created_at": "2022-08-05T17:23:14.084Z", - "updated_at": "2022-09-09T09:24:43.806Z", - "object": "sku", - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": null, - "attributes": [], - "metadata": {}, + "metadata": { + "test": true, + "vendor": "Online Store" + }, + "image_url": "https://www.website.com/image.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T12:59:55.890Z", "object": "product" } - }, - { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100, - "attributes": [], - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "image_url": "https://www.images.com/image1.png", - "created_at": "2022-08-05T17:23:14.071Z", - "updated_at": "2022-09-09T09:24:43.728Z", - "object": "product" - }, - { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000, - "attributes": [], - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "image_url": null, - "created_at": "2022-08-05T17:15:55.270Z", - "updated_at": "2022-09-09T09:24:43.704Z", - "object": "product" } - ], - "total": 6 + } } } } } } }, - "404": { - "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", - "content": { - "application/json": { + "/v1/products/{productId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "prod_f1r5Tpr0DuC7" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_M5XgaWPx3Sl4v26atA15zFj", - "request_id": "v-0b4ec6429e5646d089", - "resource_id": "pc_M5XgaWPx3Sl4v26atA15zFj", - "resource_type": "products_collection" - } - } - } + "name": "productId", + "in": "path", + "required": true, + "description": "A Voucherify product ID or source ID." } - } - } - } - } - }, - "/v1/validation-rule-object": { - "get": { - "operationId": "validation-rule-object", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Validation Rule Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Rule Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - } - } - } - } - } - } - }, - "/v1/validation-rule-assignment-object": { - "get": { - "operationId": "validation-rule-assignment-object", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Validation Rule Assignment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Rule Assignment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + ], + "get": { + "operationId": "get-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Get Product", + "description": "Retrieve product details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - } - } - }, - "/v1/validation-rules": { - "get": { - "operationId": "list-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rules", - "description": "Retrieve validation rules.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "name", - "-name" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of validation rules.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_res_list_validation_rules" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "val_auLlxlfTR9Ps", - "name": "Customer in Segment", - "rules": { - "1": { - "name": "customer.segment", - "rules": {}, - "property": null, - "conditions": { - "$is": [ - "seg_18tD3HR0h8ymPC07rBMLryk3" - ] - } - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-10T11:08:16.499Z", - "updated_at": "2021-12-10T12:01:41.665Z", - "type": "advanced", - "context_type": "earning_rule.order.paid", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_AvIe1WWuBXre", - "name": "Order Volume - Price of Any Item - = 1500 USD", - "rules": { - "1": { - "name": "order.items.price_any", - "rules": {}, - "property": null, - "conditions": { - "$is": [ - 150000 - ] - } - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-13T06:54:06.864Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" - }, - { - "id": "val_aZhPe4tQYMgr", - "name": "Business Validation Rule - excluded", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [ - { - "object": "products_collection", - "id": "pc_7fVU2RxybhR66YxC7r7BKKRh", - "source_id": null - }, - { - "object": "sku", - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1" - } - ], - "included": [], - "included_all": true - }, - "created_at": "2022-09-13T14:38:33.710Z", - "type": "basic", - "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_bbJCAXAWtYX0", - "name": "Business Validation Rule - Test - Discount Effect - Amount - Items - each unit of matched product", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [], - "included": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "source_id": null, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 1 - } + ], + "responses": { + "200": { + "description": "Returns a product object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object" + }, + "examples": { + "Example": { + "value": { + "id": "prod_f1r5Tpr0DuC7", + "source_id": "test_prod_id_1", + "name": "Apple iPhone 8", + "price": null, + "attributes": [ + "color", + "memory" ], - "included_all": false - }, - "created_at": "2022-09-02T17:04:23.814Z", - "type": "basic", - "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_BkV21MUJGaiT", - "name": "Order Volume - Total Amount More than 100", - "rules": { - "1": { - "name": "order.amount", - "rules": {}, - "property": null, - "conditions": { - "$more_than": [ - 10000 - ] - } + "metadata": { + "test": true, + "vendor": "Cortland" }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-10T14:01:10.750Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" - }, - { - "id": "val_BTQg027UGl0v", - "name": "Business Validation Rule - Get some $ off", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [], - "included": [ - { - "object": "product", - "id": "prod_0a41dd45dc85fcab40", - "source_id": "10474", - "strict": false - } - ], - "included_all": false - }, - "created_at": "2021-12-07T06:58:23.759Z", - "updated_at": "2021-12-22T08:11:18.773Z", - "type": "advanced", - "context_type": "campaign.discount_coupons.discount.apply_to_items", - "assignments_count": 1, - "object": "validation_rules" + "image_url": null, + "created_at": "2021-12-03T06:33:46.101Z", + "updated_at": null, + "object": "product", + "skus": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "sku_0a417bd1d9952f9d6f", + "source_id": "test_iphone_8_silver_256gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 256GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "256" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.599097+00:00", + "updated_at": null, + "object": "sku" + }, + { + "id": "sku_0a417bd1d9952f9d6e", + "source_id": "test_iphone_8_silver_64gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 64GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "64" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.598595+00:00", + "updated_at": null, + "object": "sku" + } + ], + "total": 2 + } + } } - ], - "total": 6 + } + } + } + }, + "404": { + "description": "Returns an error when requesting a product that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id test_prod_id_", + "request_id": "v-0bae1d3caf478da111", + "resource_id": "test_prod_id_", + "resource_type": "product" + } + } + } } } } } - } - } - } - }, - "post": { - "operationId": "create-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Create Validation Rules", - "description": "Create validation rules.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule" - }, - "examples": { - "Example": { - "value": { - "name": "Set of Validation Rules", - "error": { - "message": "Your order does not meet at least one of the required criteria." - }, - "applicable_to": { - "included_all": false, - "excluded": [ - { - "object": "product", - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e344", - "source_id": null, - "effect": "APPLY_TO_MOST_EXPENSIVE", - "quantity_limit": 1 - }, - { - "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "source_id": null, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 - } - ] + }, + "put": { + "operationId": "update-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Product", + "description": "Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters of the product that are to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_product" }, - "rules": { - "1": { - "name": "order.metadata", - "property": "location", - "rules": {}, - "conditions": { - "$is": [ - "Santorini" - ] - }, - "error": { - "message": "Your order must be placed at one of our Santorini shops." - } - }, - "2": { - "name": "custom_event.metadata", - "property": "test", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - } - }, - "3": { - "name": "order.items.every", - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - } - } - }, - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] + "examples": { + "Example": { + "value": { + "price": 210000 } - }, - "logic": "1 or 2" + } } } } - } - } - }, - "description": "Specify the validation rules parameters." - }, - "responses": { - "200": { - "description": "Returns a validation rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - }, - "examples": { - "Example": { - "value": { - "id": "val_eR1c41hu0vUU", - "name": "Business Validation Rule", - "rules": { - "1": { - "name": "string", - "property": "string", - "conditions": { - "$one_of_voucherify_conditions": [ - "string" - ] - }, - "rules": { - "1": { - "name": "string", - "property": "string", - "conditions": {}, - "rules": {} - }, - "logic": "string" - }, - "error": { - "message": "string" - } - }, - "logic": "(1 and 2) and (3)" - }, - "error": { - "message": "string" + }, + "responses": { + "200": { + "description": "Returns an updated product object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object_truncated" }, - "applicable_to": { - "excluded": [ - { - "object": "product", - "id": "string", - "source_id": "string", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "string", - "source_id": "string", - "strict": true, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 0 + "examples": { + "Example": { + "value": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone", + "price": 210000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": false, + "vendor": "Online Stores" + }, + "image_url": "https://www.website.com/image.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T13:33:48.904Z", + "object": "product" } - ], - "included_all": true - }, - "created_at": "2022-03-23T07:44:00.444Z", - "updated_at": "2022-04-26T08:35:54.960Z", - "type": "basic", - "context_type": "earning_rule.order.paid", - "object": "validation_rules" + } + } } } } } - } - }, - "400": { - "description": "Returns an error if the request parameters were not specified correctly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_validation_rules" - }, - "examples": { - "Invalid Validation Rules": { - "value": { - "code": 400, - "key": "invalid_validation_rules", - "message": "Invalid Validation Rule Definition", - "details": "Rule 'custom_event.metadata' must have a 'property'" + }, + "delete": { + "operationId": "delete-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Delete Product", + "description": "This method deletes a product.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the product will be removed permanently. Going forward, the user will be able to create another product with exactly the same `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the product with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id prod_0a4934c50ddc5dbae", + "request_id": "v-0ae39cd7de8683dfd8", + "resource_id": "prod_0a4934c50ddc5dbae", + "resource_type": "product" + } + } + } } } } } } - } - } - } - }, - "/v1/validation-rules/{validationRuleId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "val_TU4de3EP4dlL" }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "A unique validation rule ID." - } - ], - "get": { - "operationId": "get-validation-rule", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Get Validation Rule", - "description": "Retrieve the details of a validation rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the validation rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - }, - "examples": { - "Example": { - "value": { - "id": "val_TU4de3EP4dlL", - "name": "Order is less than $40", - "rules": { - "1": { - "name": "order.amount", - "property": null, - "conditions": { - "$less_than": [ - 4000 - ] + "/v1/products/bulk/async": { + "post": { + "operationId": "update-products-in-bulk", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Products in bulk", + "description": "Update several products in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Create an array of product objects, each with the parameters which you want to update.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/11_req_update_product_bulk" + } + }, + "examples": { + "Example": { + "value": [ + { + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 3" + }, + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" }, - "rules": {} - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2022-08-11T16:42:13.630Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" + { + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 4" + }, + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" + } + ] + } } } } - } - } - } - } - }, - "put": { - "operationId": "update-validation-rule", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Update Validation Rule", - "description": "Update validation rule parameters.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule" }, - "examples": { - "Example": { - "value": { - "name": "Set of Validation Rules Updated", - "error": { - "message": "Your orders do not meet at least one of the required criteria." - }, - "applicable_to": { - "included_all": false, - "excluded": [ - { - "object": "product", - "id": "prod_0bae45ffc7003ffccc", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e333", - "source_id": null, - "effect": "APPLY_TO_CHEAPEST", - "quantity_limit": 1 - }, - { - "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "source_id": null, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 - } - ] - }, - "rules": { - "1": { - "name": "order.metadata", - "property": "place", - "rules": {}, - "conditions": { - "$is": [ - "Santorini" - ] - }, - "error": { - "message": "Your order must be placed at one of our Santorini shops on the beach." - } + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "2": { - "name": "custom_event.metadata", - "property": "lining", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } } + } + } + } + }, + "400": { + "description": "Returns an error if the required parameters are not included in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "3": { - "name": "order.items.every", - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - } + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'source_id'", + "request_id": "v-0bae44e063cca61aff" } - }, - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] } - }, - "logic": "1 and 2" + } } } } } } - } - }, - "responses": { - "200": { - "description": "Returns the validation rule object with the updated parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - }, - "examples": { - "Example": { - "value": { - "id": "val_VZ91fqqtoVmw", - "name": "Set of Validation Rules Updated", - "rules": { - "1": { - "name": "order.metadata", - "property": "place", - "conditions": { - "$is": [ - "Santorini" - ] - }, - "rules": {}, - "error": { - "message": "Your order must be placed at one of our Santorini shops on the beach." - } - }, - "2": { - "name": "custom_event.metadata", - "property": "lining", - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - }, - "rules": {} - }, - "3": { - "name": "order.items.every", - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] - }, - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - }, - "rules": {} - } + }, + "/v1/products/metadata/async": { + "post": { + "operationId": "update-products-metadata-in-bulk", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Products' Metadata in bulk", + "description": "Update several product metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the list of product source IDs and the metadata key value pairs to be udpated for these products.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_products_metadata_in_bulk" + }, + "examples": { + "Example": { + "value": { + "source_ids": [ + "123-567-3433", + "test_volleyball" + ], + "metadata": { + "label": true, + "origin": "PL" } - }, - "logic": "1 and 2" + } + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "error": { - "message": "Your orders do not meet at least one of the required criteria." + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } + } + } + } + } + }, + "400": { + "description": "Returns an error if the request parameters are not provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "applicable_to": { - "excluded": [ - { - "object": "product", - "id": "prod_0bae45ffc7003ffccc", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" + "examples": { + "Not enough source IDs": { + "value": { + "code": 400, + "key": "not_enough_source_ids", + "message": "Not enough source_ids", + "details": "Specify at least 1 ID in source_ids.", + "request_id": "v-0bae421d05078dcdb4" } - ], - "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e333", - "source_id": null, - "strict": false, - "effect": "APPLY_TO_CHEAPEST", - "quantity_limit": 1 - }, - { - "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "source_id": null, - "strict": false, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'metadata'", + "request_id": "v-0bae428dab8ca61825" } - ], - "included_all": false - }, - "created_at": "2022-09-14T05:54:51.099Z", - "updated_at": "2022-09-14T06:06:32.855Z", - "type": "complex", - "context_type": "global", - "object": "validation_rules" + } + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Delete Validation Rule", - "description": "This method deletes a validation rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the validation rule with the given ID was not found.", - "content": { - "application/json": { + "/v1/skus/{skuId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string" + }, + "name": "skuId", + "in": "path", + "required": true, + "description": "A Voucherify SKU identifier or SKU source ID." + } + ], + "get": { + "operationId": "get-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Get SKU", + "description": "Retrieve details of a SKU.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns requested SKU object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "examples": { + "Example": { + "value": { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", + "price": 1300, + "currency": "USD", + "attributes": { + "size": "XS", + "color": "blue", + "ranking": 1 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" + } + } + } + } + } }, - "examples": { - "Validation Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules with id val_TGN3rqZ8vEm", - "request_id": "v-0ae3b3436346b778be", - "resource_id": "val_TGN3rqZ8vEm", - "resource_type": "validation_rules" + "404": { + "description": "Returns an error indicating that the sku with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find sku with id sku_0b1621b319d248b79", + "request_id": "v-0b4fe3ddc55646d01d", + "resource_id": "sku_0b1621b319d248b79", + "resource_type": "sku" + } + } + } } } } } } - } - } - } - }, - "/v1/validation-rules-assignments": { - "get": { - "operationId": "list-validation-rules-assignments", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rules' Assignment(s)", - "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "related_object_id", - "description": "The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution." - }, - { - "schema": { - "type": "string", - "example": "val_30Qo2rclFi4T" - }, - "in": "query", - "name": "rule", - "description": "Validation rule ID." - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/limit" }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Sorts the results using one of the filtering options: `-created_at`, `created_at`, where the dash `-` preceding a sorting option means sorting in a descending order.", - "name": "order" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a data property that contains an array of validation rule assignments. Each entry in the array is a separate object. If no more validation rule assignments are available, the resulting array will be empty. The result can be narrowed down according to default filters.", - "content": { - "application/json": { + "/v1/products/{productId}/skus": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + "type": "string" }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_2S7Xm4dab4UvYAgm", - "rule_id": "val_5ix74ru7e", - "related_object_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", - "related_object_type": "campaign", - "created_at": "2022-02-08T10:49:30.534Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_sFV4wEFvldwIvgfb", - "rule_id": "val_ZEZmA9oit8aU", - "related_object_id": "distr_9QKI02wqgjWyvZXeQkFEPmkkYe", - "related_object_type": "distribution", - "created_at": "2022-06-29T11:41:07.680Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_8xelF5R4zB8ue168", - "rule_id": "val_ggDODO6fakMs", - "related_object_id": "ern_xrRuGEV7EW0X8wtMaze3HOfw", - "related_object_type": "earning_rule", - "created_at": "2022-02-28T12:25:56.783Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_tZaqxeO8gP4q91jG", - "rule_id": "val_WB6ETAiFztw5", - "related_object_id": "promo_kJliy076IuJYtuYWSHE9fSuT", - "related_object_type": "promotion_tier", - "created_at": "2022-08-10T10:30:39.986Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_xTMHiyPGSz3rp5m2", - "rule_id": "val_2AxnWmW2ra6X", - "related_object_id": "rewa_m9hEAu10KsPcLhGXiHG85aY0", - "related_object_type": "reward_assignment", - "created_at": "2021-12-10T11:38:35.922Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_DhlDn54JwqVFJzR6", - "rule_id": "val_eR1c41hu0vUU", - "related_object_id": "v_XuF7icVlUcVpHsSY9nG7n7yJa5wx27Va", - "related_object_type": "voucher", - "created_at": "2022-03-23T07:50:31.068Z", - "object": "validation_rules_assignment" + "name": "productId", + "in": "path", + "description": "A Voucherify [product](ref:get-product) ID or product source ID.", + "required": true + } + ], + "get": { + "operationId": "list-skus-in-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "List SKUs in Product", + "description": "Retrieve all SKUs for a given product.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of SKUs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_res_products_productId_skus" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "skus", + "skus": [ + { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", + "price": 1300, + "currency": "USD", + "attributes": { + "size": "XS", + "color": "blue", + "ranking": 1 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" + }, + { + "id": "sku_0b1621b3181248b79d", + "source_id": "sku_source_id_3", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Medium Yellow Shirt", + "price": 1450, + "currency": "USD", + "attributes": { + "size": "M", + "color": "yellow", + "ranking": 3 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.180Z", + "updated_at": "2022-07-01T05:34:16.842Z", + "object": "sku" + }, + { + "id": "sku_0b1621b3199248b79e", + "source_id": "sku_source_id_2", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Small Red Shirt", + "price": 1400, + "currency": "USD", + "attributes": { + "size": "S", + "color": "red", + "ranking": 2 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.183Z", + "updated_at": "2022-07-01T05:34:16.927Z", + "object": "sku" + }, + { + "id": "sku_0b1621b319d248b79f", + "source_id": "sku_source_id_4", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Large Pink Shirt -", + "price": 1700, + "currency": "USD", + "attributes": { + "size": "L", + "color": "pink", + "ranking": 4 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.187Z", + "updated_at": "2022-07-05T08:47:50.680Z", + "object": "sku" + } + ], + "total": 4 + } } - ], - "total": 6 + } } - }, - "No Assignments": { - "value": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + } + }, + "404": { + "description": "Returns an error when requesting a product that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id prod_0b15f6b9f650c6990", + "request_id": "v-0bae223075878da708", + "resource_id": "prod_0b15f6b9f650c6990", + "resource_type": "product" + } + } + } } } } } - } - } - } - } - }, - "/v1/validation-rules/{validationRuleId}/assignments": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "Unique validation rule ID." - } - ], - "get": { - "operationId": "list-validation-rule-assignments", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rule Assignments", - "description": "Retrieve validation rule assignments for a specific validation rule.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at" - ] }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of validation rule assignments. If the validation rule ID provided in the path parameter cannot be found, the endpoint will return an empty `data` array and a total of `0`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_74F7QZoYbUoljwQO", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "related_object_type": "voucher", - "created_at": "2022-02-17T09:05:34.642Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_zzLBm8mIzGQStXl9", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", - "related_object_type": "voucher", - "created_at": "2022-02-17T08:18:15.085Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_JztMAws0e0Qx2Xy6", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "camp_kjja4moiVB7hQKPGOT61026Z", - "related_object_type": "campaign", - "created_at": "2022-02-15T13:26:34.807Z", - "object": "validation_rules_assignment" + "post": { + "operationId": "create-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Create SKU", + "description": "This method adds product varients to a [created product](ref:create-product).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the SKU parameters to be created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_create_sku" + }, + "examples": { + "Example": { + "value": { + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 1300, + "currency": "USD", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true + } } - ], - "total": 3 - } - }, - "No Assignments": { - "value": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-validation-rule-assignment", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Create Validation Rules Assignments", - "description": "Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the resource that you would like to assign the validation rule to.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments" }, - "examples": { - "Voucher": { - "value": { - "voucher": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" - } - }, - "Campaign": { - "value": { - "campaign": "camp_Rv9EuIrkT08YEORb2pUMGSUo" - } - }, - "Distribution": { - "value": { - "distribution": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + "responses": { + "200": { + "description": "Returns the created SKU object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "examples": { + "Example": { + "value": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 1300, + "currency": "USD", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true + }, + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": null, + "object": "sku" + } + } + } + } } } } } - } - }, - "responses": { - "200": { - "description": "Returns a validation rules assignment object.", - "content": { - "application/json": { + }, + "/v1/products/{productId}/skus/{skuId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "productId", + "in": "path", + "required": true, + "description": "A unique Voucherify [product](ref:get-product) ID or product source ID." + }, + { "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + "type": "string" }, - "examples": { - "Example": { - "value": { - "id": "asgm_kPPiNW3smQLRMWiF", - "rule_id": "val_ZEZmA9oit8aU", - "related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo", - "related_object_type": "campaign", - "created_at": "2022-09-14T07:06:49.557Z", - "object": "validation_rules_assignment" + "name": "skuId", + "in": "path", + "required": true, + "description": "A Voucherify [SKU ID](ref:get-sku) or SKU source ID." + } + ], + "put": { + "operationId": "update-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update SKU", + "description": "Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_sku" + }, + "examples": { + "Example": { + "value": { + "price": 210000, + "currency": "PLN" + } + } } } } - } - } - }, - "409": { - "description": "Returns an error if an duplicate assignment is found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated validation_rules_assignment exists with id asgm_ixJEwQbUv8hfPlhO", - "request_id": "v-0bb06fd1c3478dcb47", - "resource_id": "asgm_ixJEwQbUv8hfPlhO", - "resource_type": "validation_rules_assignment" + }, + "responses": { + "200": { + "description": "Returns the SKU object with the updated parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "examples": { + "Example": { + "value": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 210000, + "currency": "PLN", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true + }, + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": "2022-09-12T14:09:40.859Z", + "object": "sku" + } + } + } } } } } - } - } - } - } - }, - "/v1/validation-rules/{validationRuleId}/assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "A unique validation rule ID." - }, - { - "schema": { - "type": "string" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique validation rule assignment ID." - } - ], - "delete": { - "operationId": "delete-validation-rule-assignment", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Delete Validation Rule Assignment", - "description": "This method deletes a validation rule assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the validation rule or validation rule assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Validation Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules with id val_4j7DCRm2IS5", - "request_id": "v-0ae3b84bac0683f697", - "resource_id": "val_4j7DCRm2IS5", - "resource_type": "validation_rules" - } + }, + "delete": { + "operationId": "delete-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Delete SKU", + "description": "This method deletes a product SKU.", + "parameters": [ + { + "schema": { + "type": "string" }, - "Validation Rule Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules_assignment with id asgm_tDN7MJNayjrf1wy", - "request_id": "v-0ae3b87eeb9027c916", - "resource_id": "asgm_tDN7MJNayjrf1wy", - "resource_type": "validation_rules_assignment" + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the SKU will be removed permanently. Going forward, the user will be able to create another SKU with exactly the same `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the product or sku with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id 123-567-343", + "request_id": "v-0ae3a0d26fd40ecd11", + "resource_id": "123-567-343", + "resource_type": "product" + } + }, + "SKU Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find sku with id sku_0ae3a06b20019ba8f", + "request_id": "v-0ae3a1534d940ecd81", + "resource_id": "sku_0ae3a06b20019ba8f", + "resource_type": "sku" + } + } + } } } } } } - } - } - } - }, - "/v1/segments/{segmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" }, - "name": "segmentId", - "in": "path", - "required": true, - "description": "A unique customer segment ID." - } - ], - "get": { - "operationId": "get-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Get Segment", - "description": "Retrieves the segment with given segment ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns segment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" - }, - "examples": { - "Tier Segment": { - "value": { - "id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI2", - "name": "Tiers 2 - Senior", - "created_at": "2022-06-09T13:21:26.656Z", - "type": "auto-update", - "filter": { - "junction": "and", - "loyalty_points.campaigns.Tiers 2.points": { - "conditions": { - "$more_than_equal": [ - 41 - ] + "/v1/products/importCSV": { + "post": { + "operationId": "import-products-using-csv", + "tags": [ + "PRODUCTS API" + ], + "summary": "Import Products using CSV", + "description": "Import products into the repository using a CSV file. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/products/importCSV \\\n -F file=@/path/to/products.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nThe CSV file has to include headers in the first line.\n\n\n\n> 📘 Standard product fields mapping\n>\n> - Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).\n> - Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`\n> - **Name** is a **required** field. The remaining fields in the CSV template are optional.\n> - Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.\n> - Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 norms**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11\n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Columns that can't be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata. \n> - To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).\n> - **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e \"attribute1,attribute2\".\n> - Headers with metadata names **can't contain white-space characters**.\n> - If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example: \n> - array of strings: \"subscribed,premium\" \n> - array of numbers: \"123,234\". \n> - array of dates: \"2000-01-01,2000-01-02\"\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + }, + "responses": { + "200": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Async Action": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } - }, - "initial_sync_status": "DONE", - "object": "segment" + } } } - } - } - } - }, - "404": { - "description": "Returns an error when requesting a segment that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find segment with id seg_Mv5w1b2FIEbiCCO5ioT8TfI", - "request_id": "v-0b4d7a37a105797650", - "resource_id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI", - "resource_type": "segment" + "400": { + "description": "Returns an invalid payload error. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'file'", + "request_id": "v-0c4c46bbad0136789f" + } + } + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Delete Segment", - "description": "This method deletes a customer segment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the customer segment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Customer Segment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find segment with id seg_DNAOhUtJffvX0f57ajLMFBY", - "request_id": "v-0ae3bb40409027cb63", - "resource_id": "seg_DNAOhUtJffvX0f57ajLMFBY", - "resource_type": "segment" + "/v1/skus/importCSV": { + "post": { + "operationId": "import-skus-using-csv", + "tags": [ + "PRODUCTS API" + ], + "summary": "Import SKUs using CSV", + "description": "Import SKUs into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/skus/importCSV \\\n -F file=@/path/to/skus.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n> 🚧 Import sequence\n>\n> First import products using the [dedicated endpoint](ref:import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.\n\n\n\n> 📘 Standard SKU fields mapping\n>\n> - **Required** fields are source_id and product_id.\n> - Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`\n> - SKU **source_id**'s must be unique in the entire product catalog, no duplicates allowed.\n> - SKU attributes need to be in the form of a stringy-fied json, i.e.`\"{'color':'blue'}\"`. These attributes must be defined in the **product** beforehand in order for you to be able to import them to the SKU.\n> - You can use this method to update the following parameters in bulk: **sku** and the sku **price**.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" } } } - } - } - } - } - } - }, - "/v1/customer-segment-object": { - "get": { - "operationId": "customer-segment-object", - "tags": [ - "SEGMENTS API" - ], - "summary": "Customer Segment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Segment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" - } - } - } - } - } - } - }, - "/v1/segments": { - "post": { - "operationId": "create-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Create Segment", - "description": "Create a customer segment.\n\n> 🚧 Limit on Static Segments\n>\n> There is a cap on the number of customers that you can assign to a static segment: **20,000**. If you would like to create a bigger segment, then you can use the unlimited auto-update segment instead and use some customer metadata to build this segment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the boundary conditions for the customer segment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_req_create_segment" }, - "examples": { - "Static Segment": { - "value": { - "name": "Customers in a new Segment", - "type": "static", - "customers": [ - "cust_iajsExT2QB4sGWzABY85WRqV", - "cust_sehkNIi8Uq2qQuRqSr7xn4Zi" - ] - } - }, - "Dynamic": { - "value": { - "name": "Customers in a new Dynamic Segment", - "type": "auto-update", - "filter": { - "junction": "and", - "created_at": { - "conditions": { - "$after": [ - "2021-12-01T00:00:00.000Z" - ] + "responses": { + "200": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Async Action": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } } } } @@ -82381,3508 +80247,5572 @@ } } } - } - }, - "responses": { - "200": { - "description": "Returns a customer segment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" - }, - "examples": { - "Static": { - "value": { - "id": "seg_vC8iOSCqUG02EsPzsHynLv8i", - "name": "Customers in a new Segment", - "created_at": "2022-09-13T08:57:15.801Z", - "type": "static", - "filter": null, - "initial_sync_status": "DONE", - "object": "segment" + }, + "/v1/product-collection-object": { + "get": { + "operationId": "product-collection-object", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Product Collection Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Product Collection Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_collection_item" + } } + } + } + } + } + }, + "/v1/product-collections": { + "get": { + "operationId": "list-product-collections", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "List Product Collections", + "description": "This method returns a list of product collections.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ] }, - "Dynamic": { - "value": { - "id": "seg_nZULMFHhVWIFm9vQ0dytg83Q", - "name": "Customers in a new Dynamic Segment", - "created_at": "2022-09-13T09:03:32.764Z", - "type": "auto-update", - "filter": { - "junction": "and", - "created_at": { - "conditions": { - "$after": [ - "2021-12-01T00:00:00.000Z" - ] + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary containing a list of product collections and details about each product collection.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_list_response_body" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", + "name": "Products in Poland", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.product_location": { + "conditions": { + "$in_location": [ + "loc_RcYz537sV07e1t5aG5tIH9FD" + ] + } + } + }, + "created_at": "2022-07-14T16:12:26.377Z", + "object": "products_collection" + }, + { + "id": "pc_FJdBpaQyvK6Gcdul4D2HRChI", + "name": "Price less than 10", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "price": { + "conditions": { + "$less_than": [ + 1000 + ] + } + } + }, + "created_at": "2022-03-17T07:11:25.406Z", + "object": "products_collection" + }, + { + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "name": "Color is brown", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.color": { + "conditions": { + "$is": [ + "brown" + ] + } + } + }, + "created_at": "2022-03-16T14:27:49.612Z", + "object": "products_collection" + }, + { + "id": "pc_BxofAP7pyM9FO7M6iaIzIouy", + "name": "Color not brown", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.color": { + "conditions": { + "$is_not": [ + "brown" + ] + } + } + }, + "created_at": "2022-03-16T13:49:05.697Z", + "object": "products_collection" + }, + { + "id": "pc_uHpM9ipEQH2yEpm3D8aohkBM", + "name": "Price less than 20", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "price": { + "conditions": { + "$less_than": [ + 2000 + ] + } + } + }, + "created_at": "2022-03-16T13:46:01.102Z", + "object": "products_collection" + }, + { + "id": "pc_ZgM25PcZAMp6qItKJRtR2mEi", + "name": "Name starts with S", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "name": { + "conditions": { + "$starts_with": [ + "S" + ] + } + } + }, + "created_at": "2022-03-16T13:42:35.917Z", + "object": "products_collection" + }, + { + "id": "pc_41V4DiQQO8YGqj0J2oZD57j4", + "name": "Ends with baby", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "source_id": { + "conditions": { + "$ends_with": [ + "baby" + ] + } + } + }, + "created_at": "2022-03-14T12:50:19.885Z", + "object": "products_collection" + }, + { + "id": "pc_0cRX5wAFt1R1R5Ir6WdTowui", + "name": "C start", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "name": { + "conditions": { + "$starts_with": [ + "C" + ] + } + } + }, + "created_at": "2022-03-14T12:18:15.588Z", + "object": "products_collection" + }, + { + "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", + "name": "Shirts", + "type": "STATIC", + "products": [ + { + "id": "prod_0a9f9aeddb019a42db", + "object": "product" + }, + { + "id": "prod_0a9f9ab4ab019a42d5", + "object": "product" + } + ], + "created_at": "2022-02-28T11:42:12.484Z", + "object": "products_collection" + } + ], + "total": 9 } } - }, - "initial_sync_status": "IN_PROGRESS", - "object": "segment" + } } } } } - } - } - } - } - }, - "/v1/custom-event-object": { - "get": { - "operationId": "custom-event-object", - "tags": [ - "EVENTS API" - ], - "summary": "Custom Event Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Custom Event Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - } - } - } - } - } - } - }, - "/v1/events": { - "post": { - "operationId": "track-custom-event", - "tags": [ - "EVENTS API" - ], - "summary": "Track Custom Event", - "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the custom event.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - }, - "examples": { - "Example": { - "value": { - "event": "event-name", - "customer": { - "source_id": "referee-source_id" - }, - "referral": { - "code": "voucher-code", - "referrer_id": "referrer-source_id" - } - } - }, - "Referral triggered by custom event": { - "value": { - "event": "user_subscribed", - "customer": { - "source_id": "source_customer_event" - }, - "referral": { - "code": "46jL0kYI", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "metadata": { - "login": "bob", - "pricing_plan": "PP1", - "volume_number": 4 - } - } - }, - "Earning rule triggered by custom event": { - "value": { - "event": "cart_abandoned", - "customer": { - "source_id": "source_customer_event" - }, - "loyalty": { - "code": "6CB4KDAu" - }, - "metadata": { - "date": "2022-12-01", - "flag": true, - "text": "Cart abandoned event", - "date_time": "2022-12-01T09:24:33.061Z", - "number": 1 + }, + "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" + } } } } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the event type if the event was received by the application.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_res_track_custom_event" - }, - "examples": { - "Example": { - "value": { - "object": "event", - "type": "cart_abandoned", - "customer": {}, - "referral": null, - "loyalty": null + }, + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_create_request_body" } } } } } }, - "400": { - "description": "Returns an error if the request payload is incomplete.", - "content": { - "application/json": { + "/v1/product-collections/{productCollectionId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string", + "example": "pc_41V4DiQQO8YGqj0J2oZD57j4" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .referral should have required property 'code'", - "request_id": "v-0c15694e0e022146dd" - } - } - } + "name": "productCollectionId", + "in": "path", + "required": true, + "description": "A unique product collection ID." } - } - } - } - } - }, - "/client/v1/events": { - "post": { - "operationId": "track-custom-event-client-side", - "tags": [ - "EVENTS API" - ], - "summary": "Track Custom Event (client-side)", - "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the custom event.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - }, - "examples": { - "Referral triggered by custom event": { - "value": { - "event": "user_subscribed", - "customer": { - "source_id": "source_customer_event" - }, - "referral": { - "code": "46jL0kYI", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "metadata": { - "login": "bob", - "pricing_plan": "PP1", - "volume_number": 4 + ], + "get": { + "operationId": "get-product-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Get Product Collection", + "description": "Retrieves the product collection.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a products collection object if a valid identifier was provided in the path.", + "content": { + "application/json": { + "schema": { + "$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": { + "value": { + "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", + "name": "Products in Poland", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.product_location": { + "conditions": { + "$in_location": [ + "loc_RcYz537sV07e1t5aG5tIH9FD" + ] + } + } + }, + "created_at": "2022-07-14T16:12:26.377Z", + "object": "products_collection" + } + }, + "Static": { + "value": { + "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", + "name": "Shirts", + "type": "STATIC", + "products": [ + { + "id": "prod_0a9f9aeddb019a42db", + "object": "product" + }, + { + "id": "prod_0a9f9ab4ab019a42d5", + "object": "product" + } + ], + "created_at": "2022-02-28T11:42:12.484Z", + "object": "products_collection" + } + } + } } } }, - "Earning rule triggered by custom event": { - "value": { - "event": "cart_abandoned", - "customer": { - "source_id": "source_customer_event" - }, - "loyalty": { - "code": "6CB4KDAu" - }, - "metadata": { - "date": "2022-12-01", - "flag": true, - "text": "Cart abandoned event", - "date_time": "2022-12-01T09:24:33.061Z", - "number": 1 + "404": { + "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", + "request_id": "v-0b4ec2530e9646cb15", + "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", + "resource_type": "products_collection" + } + } + } } } } } - } - } - }, - "responses": { - "200": { - "description": "Returns the event type if the event was received by the application.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_res_track_custom_event" + }, + "delete": { + "operationId": "delete-product-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Delete Product Collection", + "description": "This method deletes a product collection.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "400": { + "description": "Returns an error indicating that the product collection with given ID is in use by other resources.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_resource_in_use" + }, + "examples": { + "Product Colllection In Use": { + "value": { + "code": 400, + "key": "resource_in_use", + "message": "Resource in use", + "details": "Resource products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j4 is in use by validation_ruless with ids [val_9TB89AjZeVEJ]", + "request_id": "v-0ae3a63aff940ed1b2", + "related_object_ids": [ + "val_9TB89AjZeVEJ" + ], + "related_object_type": "validation_rules" + } + } + } + } + } }, - "examples": { - "Example": { - "value": { - "object": "event", - "type": "cart_abandoned", - "customer": {}, - "referral": null, - "loyalty": null + "404": { + "description": "Returns an error indicating that the product collection with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Collection Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", + "request_id": "v-0ae3a49261d027b870", + "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", + "resource_type": "products_collection" + } + } + } } } } } } }, - "400": { - "description": "Returns an error if the request payload is incomplete.", - "content": { - "application/json": { + "/v1/product-collections/{productCollectionId}/products": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "type": "string" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .referral should have required property 'code'", - "request_id": "v-0c15694e0e022146dd" - } - } - } + "name": "productCollectionId", + "in": "path", + "required": true, + "description": "Unique product collection ID." } - } - } - } - } - }, - "/v1/consents-object": { - "get": { - "operationId": "consents-object", - "tags": [ - "CONSENTS API" - ], - "summary": "Consents Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Consents Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" + ], + "get": { + "operationId": "list-products-in-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "List Products in Collection", + "description": "Retrieves list of products from a products collection; works for both dynamic and static product collections.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" } - } - } - } - } - } - }, - "/v1/consents": { - "get": { - "operationId": "list-consents", - "tags": [ - "CONSENTS API" - ], - "summary": "List Consents", - "description": "List the Marketing Permission definitions within the project along with opt-in consents.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns marketing permission groups and opt-in consents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" - }, - "examples": { - "Marketing Permissions Groups and Consents": { - "value": { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" - }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of products and/or SKUs grouped in the collection with each product's/SKU's details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_list_products_response_body" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 4" + }, + "image_url": "https://www.images.com/image4.png", + "created_at": "2022-09-12T14:44:13.212Z", + "updated_at": null, + "object": "product" + }, + { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 210000, + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "test": false, + "vendor": "Online Stores", + "imported": true + }, + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": "2022-09-12T14:09:40.859Z", + "object": "sku", + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone", + "price": null, + "attributes": [], + "metadata": {}, + "object": "product" + } + }, + { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 3" + }, + "image_url": "https://www.images.com/image2.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T14:44:13.208Z", + "object": "product" + }, + { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku": "Comics1", + "price": 1700, + "attributes": {}, + "image_url": null, + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "created_at": "2022-08-05T17:23:14.084Z", + "updated_at": "2022-09-09T09:24:43.806Z", + "object": "sku", + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": null, + "attributes": [], + "metadata": {}, + "object": "product" + } + }, + { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100, + "attributes": [], + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "image_url": "https://www.images.com/image1.png", + "created_at": "2022-08-05T17:23:14.071Z", + "updated_at": "2022-09-09T09:24:43.728Z", + "object": "product" + }, + { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000, + "attributes": [], + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "image_url": null, + "created_at": "2022-08-05T17:15:55.270Z", + "updated_at": "2022-09-09T09:24:43.704Z", + "object": "product" + } ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" + "total": 6 } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" - }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" - } - ], - "total": 2 + } } } } - } - } - } - } - } - } - }, - "/client/v1/consents#": { - "get": { - "operationId": "list-consents-client-side", - "tags": [ - "CONSENTS API" - ], - "summary": "List Consents (client-side)", - "description": "List the Marketing Permission definitions within the project along with opt-in consents.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns marketing permission groups and opt-in consents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" - }, - "examples": { - "Marketing Permissions Groups and Consents": { - "value": { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" - }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" - } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" - }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" + }, + "404": { + "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_M5XgaWPx3Sl4v26atA15zFj", + "request_id": "v-0b4ec6429e5646d089", + "resource_id": "pc_M5XgaWPx3Sl4v26atA15zFj", + "resource_type": "products_collection" } - ], - "total": 2 + } } } } } } } - } - } - } - }, - "/v1/async-action-object": { - "get": { - "operationId": "async-action-object", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "Async Action Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Async Action Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_obj_async_action_object" - } - } - } - } - } - } - }, - "/v1/async-actions": { - "get": { - "operationId": "list-async-actions", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "List Async Actions", - "description": "Track asynchronous operations scheduled in your project. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
  • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
  • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
    • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
      |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
      |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
      CUSTOMERS.METADATA_KEY_PURGE
      PRODUCTS.METADATA_KEY_PURGE
      VOUCHERS.METADATA_KEY_PURGE
      ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", - "parameters": [ - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "Limit the number of asynchronous actions that the API returns in the response." }, - { - "schema": { - "type": "string", - "example": "2021-09-08T13:52:18.227Z", - "format": "date-time" - }, - "in": "query", - "name": "end_date", - "description": "Limits results to actions scheduled before the `end_date`. The date format needs to be consistent with ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). " - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of all scheduled asynchronous actions and detailed information for each scheduled action. Note that a status `DONE`doesn't include the result of the completed action. If you need more information about the result, use the ID of the respective async action to call the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_res_list_async_actions_GET" - }, - "examples": { - "List Async Actions": { - "value": { - "object": "list", - "data_ref": "async_actions", - "async_actions": [ - { - "id": "aa_0ba518c55290c6fd62", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "created_at": "2022-09-05T11:40:17.098Z", - "updated_at": "2022-09-05T11:40:17.887Z", - "request_id": "v-0ba518c52bc99858f0", - "progress": 100, - "object": "async_action" - }, - { - "id": "aa_0ba50a7ff4d3574568", - "type": "CUSTOMERS.METADATA_UPDATE", - "status": "DONE", - "created_at": "2022-09-05T10:37:56.051Z", - "updated_at": "2022-09-05T10:37:56.862Z", - "request_id": "v-0ba50a7feb49984902", - "progress": 100, - "object": "async_action" - } - ] + "/v1/validation-rule-object": { + "get": { + "operationId": "validation-rule-object", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Validation Rule Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Rule Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + } } } } } } }, - "400": { - "description": "Returns an error if incorrect query parameters were provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid Query Parameters": { - "value": { - "code": 400, - "key": "invalid_query_params", - "message": "Invalid query params", - "details": "Property .end_date cannot be recognized as a ISO-8601 compliant date", - "request_id": "v-0c54493e444b0f61a6" + "/v1/validation-rule-assignment-object": { + "get": { + "operationId": "validation-rule-assignment-object", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Validation Rule Assignment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Rule Assignment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + } } } } } } - } - } - } - }, - "/v1/async-actions/{asyncActionId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "aa_0afb3d009a55814a48" }, - "name": "asyncActionId", - "in": "path", - "required": true, - "description": "Unique ID of the asynchronous operation." - } - ], - "get": { - "operationId": "get-async-action", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "Get Async Action", - "description": "Check the result of a scheduled asynchronous operation. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
      • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
      • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
        • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
          |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
          |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
          CUSTOMERS.METADATA_KEY_PURGE
          PRODUCTS.METADATA_KEY_PURGE
          VOUCHERS.METADATA_KEY_PURGE
          ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns detailed information about the async action result.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_obj_async_action_object" + "/v1/validation-rules": { + "get": { + "operationId": "list-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rules", + "description": "Retrieve validation rules.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "examples": { - "CAMPAIGN.VOUCHERS_IMPORT": { - "value": { - "id": "aa_0af9b22296cf473a10", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 3 failed.", - "failed": [ - { - "code": "CODE9", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - }, - { - "code": "CODE8", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - }, - { - "code": "CODE7", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - } - ], - "done_count": 0, - "failed_count": 3 - }, - "created_at": "2023-01-20T07:23:43.289Z", - "updated_at": "2023-01-20T07:23:44.044Z", - "request_id": "v-0c553fdb325688d510", - "progress": 100, - "processing_time": 755, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_IMPORT_CSV": { - "value": { - "id": "aa_0c5543f00797b6113f", - "type": "CUSTOMERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 customer(s) imported successfully, 2 failed.", - "failed": [ - { - "source_id": "test-user@voucherify.io", - "row": 1, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" - }, - { - "source_id": "", - "row": 2, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" - } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T07:41:33.086Z", - "updated_at": "2023-01-20T07:41:33.216Z", - "request_id": "v-0c5543eff2cb0f547f", - "progress": 100, - "processing_time": 130, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_DELETE": { - "value": { - "id": "aa_0c553853d957b67bd4", - "type": "CAMPAIGN.VOUCHERS_DELETE", - "status": "DONE", - "result": { - "message": "Deleted 2 vouchers.", - "done_count": 2 - }, - "created_at": "2023-01-20T06:50:49.573Z", - "updated_at": "2023-01-20T06:50:50.053Z", - "request_id": "v-0c553853b5c418c826", - "progress": 100, - "processing_time": 480, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_UPDATE": { - "value": { - "id": "aa_0c5440c25c0e5728d0", - "type": "CAMPAIGN.VOUCHERS_UPDATE", - "status": "DONE", - "result": { - "message": "Updated 1 vouchers.", - "done_count": 1 - }, - "created_at": "2023-01-19T12:49:11.024Z", - "updated_at": "2023-01-19T12:49:11.852Z", - "request_id": "v-0c5440c24304189e44", - "progress": 100, - "processing_time": 828, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_GENERATE": { - "value": { - "id": "aa_0c54441d14d7b60014", - "type": "CAMPAIGN.VOUCHERS_GENERATE", - "status": "DONE", - "result": { - "message": "Generated 2 vouchers.", - "done_count": 2 - }, - "created_at": "2023-01-19T13:03:50.355Z", - "updated_at": "2023-01-19T13:03:51.030Z", - "request_id": "v-0c54441d0e4418b647", - "progress": 100, - "processing_time": 675, - "object": "async_action" - } - }, - "CAMPAIGNS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c554b22664a0eb5fc", - "type": "CAMPAIGNS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 0 campaigns.", - "done_count": 0 - }, - "created_at": "2023-01-20T08:12:59.673Z", - "updated_at": "2023-01-20T08:13:00.638Z", - "request_id": "w-0c554b225f8a0eb5fb", - "progress": 100, - "processing_time": 965, - "object": "async_action" - } - }, - "CUSTOMERS.IMPORT_CSV": { - "value": { - "id": "aa_0c5543f00797b6113f", - "type": "CUSTOMERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 customer(s) imported successfully, 2 failed.", - "failed": [ - { - "source_id": "test-user@voucherify.io", - "row": 1, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" - }, - { - "source_id": "", - "row": 2, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" - } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T07:41:33.086Z", - "updated_at": "2023-01-20T07:41:33.216Z", - "request_id": "v-0c5543eff2cb0f547f", - "progress": 100, - "processing_time": 130, - "object": "async_action" - } - }, - "CUSTOMERS.BULK_UPDATE": { - "value": { - "id": "aa_0c5547cc5e17b617b6", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "source_id_1", - "updated": true, - "found": true - }, - { - "source_id": "source_id_2", - "updated": true, - "found": true - }, - { - "source_id": "source_id_3", - "updated": true, - "found": true - } - ], - "done_count": 3 - }, - "created_at": "2023-01-20T07:58:25.144Z", - "updated_at": "2023-01-20T07:58:25.869Z", - "request_id": "v-0c5547cc4d8b0f5be4", - "progress": 100, - "processing_time": 725, - "object": "async_action" - } - }, - "CUSTOMERS.METADATA_UPDATE": { - "value": { - "id": "aa_0c554a92030e576181", - "type": "CUSTOMERS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "source_1", - "updated": true, - "found": true - }, - { - "source_id": "source_2", - "updated": true, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:10:31.821Z", - "updated_at": "2023-01-20T08:10:32.564Z", - "request_id": "v-0c554a91fb4b0f61a2", - "progress": 100, - "processing_time": 743, - "object": "async_action" - } - }, - "CUSTOMERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c5551f2ab0a0ebf0e", - "type": "CUSTOMERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 0 customers.", - "done_count": 0 - }, - "created_at": "2023-01-20T08:42:45.804Z", - "updated_at": "2023-01-20T08:42:46.079Z", - "request_id": "w-0c5551f2a38a0ebf0d", - "progress": 100, - "processing_time": 275, - "object": "async_action" - } - }, - "PRODUCTS.BULK_UPDATE": { - "value": { - "id": "aa_0c5553f0f457b6328e", - "type": "PRODUCTS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "first_product", - "updated": false, - "found": true - }, - { - "source_id": "second_product", - "updated": false, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:51:28.337Z", - "updated_at": "2023-01-20T08:51:28.439Z", - "request_id": "v-0c5553f0e94b0f7502", - "progress": 100, - "processing_time": 102, - "object": "async_action" - } - }, - "PRODUCTS.METADATA_UPDATE": { - "value": { - "id": "aa_0c5554869b97b633b4", - "type": "PRODUCTS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "123-567-3433", - "updated": false, - "found": true - }, - { - "source_id": "test_volleyball", - "updated": false, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:54:01.582Z", - "updated_at": "2023-01-20T08:54:02.436Z", - "request_id": "v-0c55548694c418f9dd", - "progress": 100, - "processing_time": 854, - "object": "async_action" - } - }, - "PRODUCTS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c5552d997ca0ec03a", - "type": "PRODUCTS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 2 products.", - "done_count": 2 - }, - "created_at": "2023-01-20T08:46:42.271Z", - "updated_at": "2023-01-20T08:46:43.240Z", - "request_id": "w-0c5552d98e8a0ec039", - "progress": 100, - "processing_time": 969, - "object": "async_action" - } - }, - "VOUCHERS.IMPORT": { - "value": { - "id": "aa_0c5559be44d7b63c06", - "type": "VOUCHERS.IMPORT", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 3 failed.", - "failed": [ - { - "code": "PROMO-CODE31", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - }, - { - "code": "PROMO-CODE21", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - }, - { - "code": "GIFT-CARD-100-1", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - } - ], - "done_count": 0, - "failed_count": 3 - }, - "created_at": "2023-01-20T09:16:49.299Z", - "updated_at": "2023-01-20T09:16:50.238Z", - "request_id": "v-0c5559be25c418824a", - "progress": 100, - "processing_time": 939, - "object": "async_action" - } + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "name", + "-name" + ] }, - "VOUCHERS.IMPORT_CSV": { - "value": { - "id": "aa_0c555db3d697b643e1", - "type": "VOUCHERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 2 failed.", - "failed": [ - { - "code": "FALL2023", - "row": 1, - "reason": "Voucher Type is required" - }, - { - "code": "FALL2024", - "row": 2, - "reason": "Voucher Type is required" + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of validation rules.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_res_list_validation_rules" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "val_auLlxlfTR9Ps", + "name": "Customer in Segment", + "rules": { + "1": { + "name": "customer.segment", + "rules": {}, + "property": null, + "conditions": { + "$is": [ + "seg_18tD3HR0h8ymPC07rBMLryk3" + ] + } + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-10T11:08:16.499Z", + "updated_at": "2021-12-10T12:01:41.665Z", + "type": "advanced", + "context_type": "earning_rule.order.paid", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_AvIe1WWuBXre", + "name": "Order Volume - Price of Any Item - = 1500 USD", + "rules": { + "1": { + "name": "order.items.price_any", + "rules": {}, + "property": null, + "conditions": { + "$is": [ + 150000 + ] + } + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-13T06:54:06.864Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + }, + { + "id": "val_aZhPe4tQYMgr", + "name": "Business Validation Rule - excluded", + "rules": { + "logic": "" + }, + "applicable_to": { + "excluded": [ + { + "object": "products_collection", + "id": "pc_7fVU2RxybhR66YxC7r7BKKRh", + "source_id": null + }, + { + "object": "sku", + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1" + } + ], + "included": [], + "included_all": true + }, + "created_at": "2022-09-13T14:38:33.710Z", + "type": "basic", + "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_bbJCAXAWtYX0", + "name": "Business Validation Rule - Test - Discount Effect - Amount - Items - each unit of matched product", + "rules": { + "logic": "" + }, + "applicable_to": { + "excluded": [], + "included": [ + { + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "source_id": null, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 1 + } + ], + "included_all": false + }, + "created_at": "2022-09-02T17:04:23.814Z", + "type": "basic", + "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_BkV21MUJGaiT", + "name": "Order Volume - Total Amount More than 100", + "rules": { + "1": { + "name": "order.amount", + "rules": {}, + "property": null, + "conditions": { + "$more_than": [ + 10000 + ] + } + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-10T14:01:10.750Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + }, + { + "id": "val_BTQg027UGl0v", + "name": "Business Validation Rule - Get some $ off", + "rules": { + "logic": "" + }, + "applicable_to": { + "excluded": [], + "included": [ + { + "object": "product", + "id": "prod_0a41dd45dc85fcab40", + "source_id": "10474", + "strict": false + } + ], + "included_all": false + }, + "created_at": "2021-12-07T06:58:23.759Z", + "updated_at": "2021-12-22T08:11:18.773Z", + "type": "advanced", + "context_type": "campaign.discount_coupons.discount.apply_to_items", + "assignments_count": 1, + "object": "validation_rules" + } + ], + "total": 6 } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T09:34:07.194Z", - "updated_at": "2023-01-20T09:34:07.367Z", - "request_id": "v-0c555db3ba8b0f0767", - "progress": 100, - "processing_time": 173, - "object": "async_action" + } + } } - }, - "VOUCHERS.BULK_UPDATE": { - "value": { - "id": "aa_0c555e8115d7b64504", - "type": "VOUCHERS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "code": "PROMO-CODE81019", - "updated": false, - "found": false + } + } + } + }, + "post": { + "operationId": "create-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Create Validation Rules", + "description": "Create validation rules.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule" + }, + "examples": { + "Example": { + "value": { + "name": "Set of Validation Rules", + "error": { + "message": "Your order does not meet at least one of the required criteria." }, - { - "code": "PROMO-CODE7264786", - "updated": false, - "found": false - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T09:37:37.367Z", - "updated_at": "2023-01-20T09:37:37.520Z", - "request_id": "v-0c555e810904188aa4", - "progress": 100, - "processing_time": 153, - "object": "async_action" - } - }, - "VOUCHERS.METADATA_UPDATE": { - "value": { - "id": "aa_0c555ed40857b6463a", - "type": "VOUCHERS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "code": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "updated": false, - "found": false + "applicable_to": { + "included_all": false, + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e344", + "source_id": null, + "effect": "APPLY_TO_MOST_EXPENSIVE", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 + } + ] }, - { - "code": "LOYALTY-CARD-xLPbpbXR", - "updated": false, - "found": false + "rules": { + "1": { + "name": "order.metadata", + "property": "location", + "rules": {}, + "conditions": { + "$is": [ + "Santorini" + ] + }, + "error": { + "message": "Your order must be placed at one of our Santorini shops." + } + }, + "2": { + "name": "custom_event.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + }, + "3": { + "name": "order.items.every", + "rules": { + "1": { + "name": "order.items.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + } + }, + "conditions": { + "$is": [ + { + "id": "", + "effect": "APPLY_TO_EVERY", + "object": "product", + "source_id": "" + } + ] + } + }, + "logic": "1 or 2" } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T09:39:02.305Z", - "updated_at": "2023-01-20T09:39:02.640Z", - "request_id": "v-0c555ed40084188b55", - "progress": 100, - "processing_time": 335, - "object": "async_action" - } - }, - "VOUCHERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c55534bd64a0ec0e0", - "type": "VOUCHERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 9 vouchers.", - "done_count": 9 - }, - "created_at": "2023-01-20T08:48:39.257Z", - "updated_at": "2023-01-20T08:48:40.503Z", - "request_id": "w-0c55534bcfca0ec0df", - "progress": 100, - "processing_time": 1246, - "object": "async_action" - } - }, - "SKUS.IMPORT_CSV": { - "value": { - "id": "aa_0c5558728d0e577e67", - "type": "SKUS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "4 sku(s) imported successfully, 0 failed.", - "failed": [], - "done_count": 4, - "failed_count": 0 - }, - "created_at": "2023-01-20T09:11:09.620Z", - "updated_at": "2023-01-20T09:11:10.270Z", - "request_id": "v-0c5558726f0b0f7d82", - "progress": 100, - "processing_time": 650, - "object": "async_action" + } + } } - }, - "PRODUCTS.IMPORT_CSV": { - "value": { - "id": "aa_0c55578e914e577cf1", - "type": "PRODUCTS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "1 product(s) imported successfully, 1 failed.", - "failed": [ - { - "row": 1, - "reason": "vendor: must be a string, property is required, must be equal to one of Vendor 1,Vendor 2 (actual value is 'Vendor 3')" + } + }, + "description": "Specify the validation rules parameters." + }, + "responses": { + "200": { + "description": "Returns a validation rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "val_eR1c41hu0vUU", + "name": "Business Validation Rule", + "rules": { + "1": { + "name": "string", + "property": "string", + "conditions": { + "$one_of_voucherify_conditions": [ + "string" + ] + }, + "rules": { + "1": { + "name": "string", + "property": "string", + "conditions": {}, + "rules": {} + }, + "logic": "string" + }, + "error": { + "message": "string" + } + }, + "logic": "(1 and 2) and (3)" + }, + "error": { + "message": "string" + }, + "applicable_to": { + "excluded": [ + { + "object": "product", + "id": "string", + "source_id": "string", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "string", + "source_id": "string", + "strict": true, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 0 + } + ], + "included_all": true + }, + "created_at": "2022-03-23T07:44:00.444Z", + "updated_at": "2022-04-26T08:35:54.960Z", + "type": "basic", + "context_type": "earning_rule.order.paid", + "object": "validation_rules" } - ], - "done_count": 1, - "failed_count": 1 - }, - "created_at": "2023-01-20T09:07:16.165Z", - "updated_at": "2023-01-20T09:07:17.025Z", - "request_id": "v-0c55578e7a0418fef5", - "progress": 100, - "processing_time": 860, - "object": "async_action" - } - }, - "ORDERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c555fda50472c83a8", - "type": "ORDERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 1 orders.", - "done_count": 1 - }, - "created_at": "2023-01-20T09:43:30.881Z", - "updated_at": "2023-01-20T09:43:31.217Z", - "request_id": "w-0c555fda45c72c83a7", - "progress": 100, - "processing_time": 336, - "object": "async_action" + } + } } - }, - "ORDERS.IMPORT": { - "value": { - "id": "aa_0c5564b67d0e571534", - "type": "ORDERS.IMPORT", - "status": "DONE", - "result": { - "message": "1 order(s) imported successfully, 1 failed.", - "failed": [ - { - "source_id": null, - "reason": "Internal error" + } + }, + "400": { + "description": "Returns an error if the request parameters were not specified correctly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_validation_rules" + }, + "examples": { + "Invalid Validation Rules": { + "value": { + "code": 400, + "key": "invalid_validation_rules", + "message": "Invalid Validation Rule Definition", + "details": "Rule 'custom_event.metadata' must have a 'property'" } - ], - "done_count": 1, - "failed_count": 1 - }, - "created_at": "2023-01-20T10:04:44.916Z", - "updated_at": "2023-01-20T10:04:46.102Z", - "request_id": "v-0c5564b6688b0f155d", - "progress": 100, - "processing_time": 1186, - "object": "async_action" + } + } } } } } } }, - "404": { - "description": "Returns an error indicating that the async action with given ID was not found.", - "content": { - "application/json": { + "/v1/validation-rules/{validationRuleId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "val_TU4de3EP4dlL" }, - "examples": { - "Async-Action-Not-Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find async_action with id aa_0aeb82bd55d5beffb", - "request_id": "v-0aeb88df54c82af560", - "resource_id": "aa_0aeb82bd55d5beffb", - "resource_type": "async_action" + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "A unique validation rule ID." + } + ], + "get": { + "operationId": "get-validation-rule", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Get Validation Rule", + "description": "Retrieve the details of a validation rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the validation rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "val_TU4de3EP4dlL", + "name": "Order is less than $40", + "rules": { + "1": { + "name": "order.amount", + "property": null, + "conditions": { + "$less_than": [ + 4000 + ] + }, + "rules": {} + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2022-08-11T16:42:13.630Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + } + } + } } } } } - } - } - } - } - }, - "/v1/export-object": { - "get": { - "operationId": "export-object", - "tags": [ - "EXPORTS API" - ], - "summary": "Export Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Export Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + }, + "put": { + "operationId": "update-validation-rule", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Update Validation Rule", + "description": "Update validation rule parameters.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule" + }, + "examples": { + "Example": { + "value": { + "name": "Set of Validation Rules Updated", + "error": { + "message": "Your orders do not meet at least one of the required criteria." + }, + "applicable_to": { + "included_all": false, + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffccc", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e333", + "source_id": null, + "effect": "APPLY_TO_CHEAPEST", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 + } + ] + }, + "rules": { + "1": { + "name": "order.metadata", + "property": "place", + "rules": {}, + "conditions": { + "$is": [ + "Santorini" + ] + }, + "error": { + "message": "Your order must be placed at one of our Santorini shops on the beach." + } + }, + "2": { + "name": "custom_event.metadata", + "property": "lining", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + }, + "3": { + "name": "order.items.every", + "rules": { + "1": { + "name": "order.items.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + } + }, + "conditions": { + "$is": [ + { + "id": "", + "effect": "APPLY_TO_EVERY", + "object": "product", + "source_id": "" + } + ] + } + }, + "logic": "1 and 2" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the validation rule object with the updated parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "val_VZ91fqqtoVmw", + "name": "Set of Validation Rules Updated", + "rules": { + "1": { + "name": "order.metadata", + "property": "place", + "conditions": { + "$is": [ + "Santorini" + ] + }, + "rules": {}, + "error": { + "message": "Your order must be placed at one of our Santorini shops on the beach." + } + }, + "2": { + "name": "custom_event.metadata", + "property": "lining", + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + }, + "rules": {} + }, + "3": { + "name": "order.items.every", + "conditions": { + "$is": [ + { + "id": "", + "effect": "APPLY_TO_EVERY", + "object": "product", + "source_id": "" + } + ] + }, + "rules": { + "1": { + "name": "order.items.metadata", + "property": "test", + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + }, + "rules": {} + } + } + }, + "logic": "1 and 2" + }, + "error": { + "message": "Your orders do not meet at least one of the required criteria." + }, + "applicable_to": { + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffccc", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e333", + "source_id": null, + "strict": false, + "effect": "APPLY_TO_CHEAPEST", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "strict": false, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 + } + ], + "included_all": false + }, + "created_at": "2022-09-14T05:54:51.099Z", + "updated_at": "2022-09-14T06:06:32.855Z", + "type": "complex", + "context_type": "global", + "object": "validation_rules" + } + } + } + } + } } } - } - } - } - } - }, - "/v1/exports": { - "post": { - "operationId": "create-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Create Export", - "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
          `GIFT_VOUCHER`: amount left to spend
          `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
          - `CREDITS_ADDITION`
          - `CREDITS_REFUND`
          - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
          - `POINTS_ADDITION`
          - `POINTS_REMOVAL`
          - `POINTS_TRANSFER_OUT`
          - `POINTS_ACCRUAL`
          - `POINTS_REFUND`
          - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
          - `voucherify-web-ui`
          - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the export that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_req_create_export_POST" - } - } - } - }, - "responses": { - "200": { - "description": "Returns export object and URL of CSV file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + }, + "delete": { + "operationId": "delete-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Delete Validation Rule", + "description": "This method deletes a validation rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the validation rule with the given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Validation Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules with id val_TGN3rqZ8vEm", + "request_id": "v-0ae3b3436346b778be", + "resource_id": "val_TGN3rqZ8vEm", + "resource_type": "validation_rules" + } + } + } + } + } } } } }, - "400": { - "description": "Returns an error if an invalid payload is provided.", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - { - "$ref": "#/components/schemas/e_400_invalid_export_fields" - } - ] + "/v1/validation-rules-assignments": { + "get": { + "operationId": "list-validation-rules-assignments", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rules' Assignment(s)", + "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "related_object_id", + "description": "The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution." }, - "examples": { - "Invalid Export Fields": { - "value": { - "code": 400, - "key": "invalid_export_fields", - "message": "Invalid Export", - "details": "Unsupported field used. Allowed fields: 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", - "request_id": "v-0afdb603910a1a14e0" - } + { + "schema": { + "type": "string", + "example": "val_30Qo2rclFi4T" + }, + "in": "query", + "name": "rule", + "description": "Validation rule ID." + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/limit" + }, + { + "schema": { + "type": "string" }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]", - "request_id": "v-0afdb5bd68d20bdb81" + "in": "query", + "description": "Sorts the results using one of the filtering options: `-created_at`, `created_at`, where the dash `-` preceding a sorting option means sorting in a descending order.", + "name": "order" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a data property that contains an array of validation rule assignments. Each entry in the array is a separate object. If no more validation rule assignments are available, the resulting array will be empty. The result can be narrowed down according to default filters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_2S7Xm4dab4UvYAgm", + "rule_id": "val_5ix74ru7e", + "related_object_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", + "related_object_type": "campaign", + "created_at": "2022-02-08T10:49:30.534Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_sFV4wEFvldwIvgfb", + "rule_id": "val_ZEZmA9oit8aU", + "related_object_id": "distr_9QKI02wqgjWyvZXeQkFEPmkkYe", + "related_object_type": "distribution", + "created_at": "2022-06-29T11:41:07.680Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_8xelF5R4zB8ue168", + "rule_id": "val_ggDODO6fakMs", + "related_object_id": "ern_xrRuGEV7EW0X8wtMaze3HOfw", + "related_object_type": "earning_rule", + "created_at": "2022-02-28T12:25:56.783Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_tZaqxeO8gP4q91jG", + "rule_id": "val_WB6ETAiFztw5", + "related_object_id": "promo_kJliy076IuJYtuYWSHE9fSuT", + "related_object_type": "promotion_tier", + "created_at": "2022-08-10T10:30:39.986Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_xTMHiyPGSz3rp5m2", + "rule_id": "val_2AxnWmW2ra6X", + "related_object_id": "rewa_m9hEAu10KsPcLhGXiHG85aY0", + "related_object_type": "reward_assignment", + "created_at": "2021-12-10T11:38:35.922Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_DhlDn54JwqVFJzR6", + "rule_id": "val_eR1c41hu0vUU", + "related_object_id": "v_XuF7icVlUcVpHsSY9nG7n7yJa5wx27Va", + "related_object_type": "voucher", + "created_at": "2022-03-23T07:50:31.068Z", + "object": "validation_rules_assignment" + } + ], + "total": 6 + } + }, + "No Assignments": { + "value": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + } + } + } } } } } } - } - } - }, - "get": { - "operationId": "list-exports", - "tags": [ - "EXPORTS API" - ], - "summary": "List Exports", - "description": "List all exports. ", - "parameters": [ - { - "$ref": "#/components/parameters/limit" }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "status", - "-status" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.", - "content": { - "application/json": { + "/v1/validation-rules/{validationRuleId}/assignments": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/16_res_list_exports" - }, - "examples": { - "List Exports": { - "value": { - "object": "list", - "data_ref": "exports", - "exports": [ - { - "id": "exp_323UOPsH42twhJVaDZXf4UNo", - "object": "export", - "created_at": "2022-08-04T09:11:25.208Z", - "status": "DONE", - "channel": "API", - "exported_object": "order", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "source_id", - "status" - ], - "filters": { - "junction": "and" - } - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o" - }, - "user_id": null - }, - { - "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9", - "object": "export", - "created_at": "2022-05-02T06:44:03.186Z", - "status": "DONE", - "channel": "API", - "exported_object": "voucher", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "code", - "voucher_type", - "value" + "type": "string" + }, + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "Unique validation rule ID." + } + ], + "get": { + "operationId": "list-validation-rule-assignments", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rule Assignments", + "description": "Retrieve validation rule assignments for a specific validation rule.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of validation rule assignments. If the validation rule ID provided in the path parameter cannot be found, the endpoint will return an empty `data` array and a total of `0`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_74F7QZoYbUoljwQO", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "related_object_type": "voucher", + "created_at": "2022-02-17T09:05:34.642Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_zzLBm8mIzGQStXl9", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", + "related_object_type": "voucher", + "created_at": "2022-02-17T08:18:15.085Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_JztMAws0e0Qx2Xy6", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "camp_kjja4moiVB7hQKPGOT61026Z", + "related_object_type": "campaign", + "created_at": "2022-02-15T13:26:34.807Z", + "object": "validation_rules_assignment" + } ], - "filters": { - "junction": "and" - } - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ" - }, - "user_id": null + "total": 3 + } }, - { - "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", - "object": "export", - "created_at": "2022-01-13T09:03:18.293Z", - "status": "DONE", - "channel": "API", - "exported_object": "customer", - "parameters": { - "order": "", - "fields": [ - "name", - "id", - "email", - "source_id", - "created_at" - ], - "filters": { - "junction": "and" - }, - "response_format": "CSV" - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" - }, - "user_id": null + "No Assignments": { + "value": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + } } - ], - "total": 3 + } } } } } - } - } - } - } - }, - "/v1/exports/{exportId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ" - }, - "name": "exportId", - "in": "path", - "required": true, - "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`." - } - ], - "get": { - "operationId": "get-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Get Export", - "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the export object if a valid identifier was provided in the path.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - }, - "examples": { - "Get Export": { - "value": { - "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", - "object": "export", - "created_at": "2022-01-13T09:03:18.293Z", - "status": "DONE", - "channel": "API", - "exported_object": "customer", - "parameters": { - "order": "", - "fields": [ - "name", - "id", - "email", - "source_id", - "created_at" - ], - "filters": { - "junction": "and" - }, - "response_format": "CSV" + }, + "post": { + "operationId": "create-validation-rule-assignment", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Create Validation Rules Assignments", + "description": "Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the resource that you would like to assign the validation rule to.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments" + }, + "examples": { + "Voucher": { + "value": { + "voucher": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" + } }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" + "Campaign": { + "value": { + "campaign": "camp_Rv9EuIrkT08YEORb2pUMGSUo" + } + }, + "Distribution": { + "value": { + "distribution": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a validation rules assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" }, - "user_id": null + "examples": { + "Example": { + "value": { + "id": "asgm_kPPiNW3smQLRMWiF", + "rule_id": "val_ZEZmA9oit8aU", + "related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo", + "related_object_type": "campaign", + "created_at": "2022-09-14T07:06:49.557Z", + "object": "validation_rules_assignment" + } + } + } + } + } + }, + "409": { + "description": "Returns an error if an duplicate assignment is found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Duplicate": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated validation_rules_assignment exists with id asgm_ixJEwQbUv8hfPlhO", + "request_id": "v-0bb06fd1c3478dcb47", + "resource_id": "asgm_ixJEwQbUv8hfPlhO", + "resource_type": "validation_rules_assignment" + } + } + } } } } } } }, - "404": { - "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.", - "content": { - "application/json": { + "/v1/validation-rules/{validationRuleId}/assignments/{assignmentId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string" + }, + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "A unique validation rule ID." + }, + { + "schema": { + "type": "string" }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0", - "request_id": "v-0b029305af4524cf42", - "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0", - "resource_type": "export" + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique validation rule assignment ID." + } + ], + "delete": { + "operationId": "delete-validation-rule-assignment", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Delete Validation Rule Assignment", + "description": "This method deletes a validation rule assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the validation rule or validation rule assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Validation Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules with id val_4j7DCRm2IS5", + "request_id": "v-0ae3b84bac0683f697", + "resource_id": "val_4j7DCRm2IS5", + "resource_type": "validation_rules" + } + }, + "Validation Rule Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules_assignment with id asgm_tDN7MJNayjrf1wy", + "request_id": "v-0ae3b87eeb9027c916", + "resource_id": "asgm_tDN7MJNayjrf1wy", + "resource_type": "validation_rules_assignment" + } + } + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Delete Export", - "description": "This method deletes a previously created export object.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." }, - "404": { - "description": "Returns an error indicating that the export with given ID was not found.", - "content": { - "application/json": { + "/v1/segments/{segmentId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/e_404_not_found" + "type": "string", + "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" + }, + "name": "segmentId", + "in": "path", + "required": true, + "description": "A unique customer segment ID." + } + ], + "get": { + "operationId": "get-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Get Segment", + "description": "Retrieves the segment with given segment ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns segment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + }, + "examples": { + "Tier Segment": { + "value": { + "id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI2", + "name": "Tiers 2 - Senior", + "created_at": "2022-06-09T13:21:26.656Z", + "type": "auto-update", + "filter": { + "junction": "and", + "loyalty_points.campaigns.Tiers 2.points": { + "conditions": { + "$more_than_equal": [ + 41 + ] + } + } + }, + "initial_sync_status": "DONE", + "object": "segment" + } + } + } + } + } }, - "examples": { - "Export Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ", - "request_id": "v-0ae2a97a399027d719", - "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ", - "resource_type": "export" + "404": { + "description": "Returns an error when requesting a segment that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find segment with id seg_Mv5w1b2FIEbiCCO5ioT8TfI", + "request_id": "v-0b4d7a37a105797650", + "resource_id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI", + "resource_type": "segment" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Delete Segment", + "description": "This method deletes a customer segment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the customer segment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Customer Segment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find segment with id seg_DNAOhUtJffvX0f57ajLMFBY", + "request_id": "v-0ae3bb40409027cb63", + "resource_id": "seg_DNAOhUtJffvX0f57ajLMFBY", + "resource_type": "segment" + } + } + } } } } } } - } - } - } - }, - "/v1/exports/{export_Id}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ" }, - "name": "export_Id", - "in": "path", - "required": true, - "description": "Unique export object ID." - } - ], - "get": { - "operationId": "download-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Download Export", - "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [], - "Download-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns contents of CSV file.", - "content": { - "text/plain": { - "schema": { - "type": "string" - }, - "examples": { - "CSV file contents": { - "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0" + "/v1/customer-segment-object": { + "get": { + "operationId": "customer-segment-object", + "tags": [ + "SEGMENTS API" + ], + "summary": "Customer Segment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Segment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + } + } } } } } }, - "401": { - "description": "Returns an error if an invalid token was provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "default": 401, - "description": "Error's HTTP status code." - }, - "message": { - "type": "string", - "default": "Unauthorized", - "description": "A human-readable message providing a short description about the error." + "/v1/segments": { + "post": { + "operationId": "create-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Create Segment", + "description": "Create a customer segment.\n\n> 🚧 Limit on Static Segments\n>\n> There is a cap on the number of customers that you can assign to a static segment: **20,000**. If you would like to create a bigger segment, then you can use the unlimited auto-update segment instead and use some customer metadata to build this segment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the boundary conditions for the customer segment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_req_create_segment" }, - "key": { - "type": "string", - "default": "unauthorized", - "description": "Short string describing the kind of error which occurred." + "examples": { + "Static Segment": { + "value": { + "name": "Customers in a new Segment", + "type": "static", + "customers": [ + "cust_iajsExT2QB4sGWzABY85WRqV", + "cust_sehkNIi8Uq2qQuRqSr7xn4Zi" + ] + } + }, + "Dynamic": { + "value": { + "name": "Customers in a new Dynamic Segment", + "type": "auto-update", + "filter": { + "junction": "and", + "created_at": { + "conditions": { + "$after": [ + "2021-12-01T00:00:00.000Z" + ] + } + } + } + } + } } } - }, - "examples": { - "Unauthorized": { - "value": { - "code": 401, - "message": "Unauthorized", - "key": "unauthorized" + } + }, + "responses": { + "200": { + "description": "Returns a customer segment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + }, + "examples": { + "Static": { + "value": { + "id": "seg_vC8iOSCqUG02EsPzsHynLv8i", + "name": "Customers in a new Segment", + "created_at": "2022-09-13T08:57:15.801Z", + "type": "static", + "filter": null, + "initial_sync_status": "DONE", + "object": "segment" + } + }, + "Dynamic": { + "value": { + "id": "seg_nZULMFHhVWIFm9vQ0dytg83Q", + "name": "Customers in a new Dynamic Segment", + "created_at": "2022-09-13T09:03:32.764Z", + "type": "auto-update", + "filter": { + "junction": "and", + "created_at": { + "conditions": { + "$after": [ + "2021-12-01T00:00:00.000Z" + ] + } + } + }, + "initial_sync_status": "IN_PROGRESS", + "object": "segment" + } + } + } } } } } } - } - } - } - }, - "/v1/category-object": { - "get": { - "operationId": "category-object", - "tags": [ - "CATEGORIES API" - ], - "summary": "Category Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Category Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" + }, + "/v1/custom-event-object": { + "get": { + "operationId": "custom-event-object", + "tags": [ + "EVENTS API" + ], + "summary": "Custom Event Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Custom Event Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" + } + } + } } } } - } - } - } - }, - "/v1/categories": { - "get": { - "operationId": "list-categories", - "tags": [ - "CATEGORIES API" - ], - "summary": "List Categories", - "description": "List all categories.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of category objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_res_list_categories" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cat_0b5f49fb31c3bf6ab0", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T06:21:36.852Z", - "object": "category" - }, - { - "id": "cat_0b5f49e6e1ce5bd2ba", - "name": "Fifth", - "hierarchy": 5, - "created_at": "2022-07-13T06:21:16.039Z", - "object": "category" - }, - { - "id": "cat_0b5f49deafce5bd2b5", - "name": "Fourth", - "hierarchy": 4, - "created_at": "2022-07-13T06:21:07.662Z", - "object": "category" - }, - { - "id": "cat_0b5f49d45c43bf6a99", - "name": "Third", - "hierarchy": 3, - "created_at": "2022-07-13T06:20:57.094Z", - "object": "category" - }, - { - "id": "cat_0b5f3f9881ce5bccb6", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-07-13T05:36:14.355Z", - "object": "category" - }, - { - "id": "cat_0b53bc388dc2f108ba", - "name": "First", - "hierarchy": 1, - "created_at": "2022-07-04T06:58:57.734Z", - "object": "category" + }, + "/v1/events": { + "post": { + "operationId": "track-custom-event", + "tags": [ + "EVENTS API" + ], + "summary": "Track Custom Event", + "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the custom event.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" + }, + "examples": { + "Example": { + "value": { + "event": "event-name", + "customer": { + "source_id": "referee-source_id" + }, + "referral": { + "code": "voucher-code", + "referrer_id": "referrer-source_id" + } } - ], - "total": 6 + }, + "Referral triggered by custom event": { + "value": { + "event": "user_subscribed", + "customer": { + "source_id": "source_customer_event" + }, + "referral": { + "code": "46jL0kYI", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "metadata": { + "login": "bob", + "pricing_plan": "PP1", + "volume_number": 4 + } + } + }, + "Earning rule triggered by custom event": { + "value": { + "event": "cart_abandoned", + "customer": { + "source_id": "source_customer_event" + }, + "loyalty": { + "code": "6CB4KDAu" + }, + "metadata": { + "date": "2022-12-01", + "flag": true, + "text": "Cart abandoned event", + "date_time": "2022-12-01T09:24:33.061Z", + "number": 1 + } + } + } } } } - } - } - } - } - }, - "post": { - "operationId": "create-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Create Category", - "description": "Create category with a specific name and hierarchy.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the category that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_req_create_category" }, - "examples": { - "Example": { - "value": { - "name": "Eighth", - "hierarchy": 8 + "responses": { + "200": { + "description": "Returns the event type if the event was received by the application.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_res_track_custom_event" + }, + "examples": { + "Example": { + "value": { + "object": "event", + "type": "cart_abandoned", + "customer": {}, + "referral": null, + "loyalty": null + } + } + } + } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a newly created category object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_res_create_category" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b8b5a427a0283c854", - "name": "Eighth", - "hierarchy": 8, - "created_at": "2022-08-16T11:45:54.171Z", - "object": "category" + }, + "400": { + "description": "Returns an error if the request payload is incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .referral should have required property 'code'", + "request_id": "v-0c15694e0e022146dd" + } + } + } } } } } } }, - "400": { - "description": "Returns an error if the payload is incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - "examples": { - "Missing name": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'name'", - "request_id": "v-0b8b5b960990210b25" + "/client/v1/events": { + "post": { + "operationId": "track-custom-event-client-side", + "tags": [ + "EVENTS API" + ], + "summary": "Track Custom Event (client-side)", + "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the custom event.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" + }, + "examples": { + "Referral triggered by custom event": { + "value": { + "event": "user_subscribed", + "customer": { + "source_id": "source_customer_event" + }, + "referral": { + "code": "46jL0kYI", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "metadata": { + "login": "bob", + "pricing_plan": "PP1", + "volume_number": 4 + } + } + }, + "Earning rule triggered by custom event": { + "value": { + "event": "cart_abandoned", + "customer": { + "source_id": "source_customer_event" + }, + "loyalty": { + "code": "6CB4KDAu" + }, + "metadata": { + "date": "2022-12-01", + "flag": true, + "text": "Cart abandoned event", + "date_time": "2022-12-01T09:24:33.061Z", + "number": 1 + } + } + } } - }, - "Missing hierarchy": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'hierarchy'", - "request_id": "v-0b8b5bf9d9c6824a2f" + } + } + }, + "responses": { + "200": { + "description": "Returns the event type if the event was received by the application.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_res_track_custom_event" + }, + "examples": { + "Example": { + "value": { + "object": "event", + "type": "cart_abandoned", + "customer": {}, + "referral": null, + "loyalty": null + } + } + } + } + } + }, + "400": { + "description": "Returns an error if the request payload is incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .referral should have required property 'code'", + "request_id": "v-0c15694e0e022146dd" + } + } + } } } } } } - } - } - } - }, - "/v1/categories/{categoryId}": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "categoryId", - "in": "path", - "required": true, - "description": "Unique category ID assigned by Voucherify." - } - ], - "get": { - "operationId": "get-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Get Category", - "description": "Retrieve a category by the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a category object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b5f49fb31c3bf6ab0", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T06:21:36.852Z", - "object": "category" + "/v1/consents-object": { + "get": { + "operationId": "consents-object", + "tags": [ + "CONSENTS API" + ], + "summary": "Consents Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Consents Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/18_res_list_consents_GET" + } } } } } } - } - } - }, - "delete": { - "operationId": "delete-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Delete Category", - "description": "Delete a category by the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "No content is returned." }, - "404": { - "description": "Returns an error indicating that the category with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find category with id example_category", - "request_id": "v-0b8b49205f902176c9", - "resource_id": "example_category", - "resource_type": "category" + "/v1/consents": { + "get": { + "operationId": "list-consents", + "tags": [ + "CONSENTS API" + ], + "summary": "List Consents", + "description": "List the Marketing Permission definitions within the project along with opt-in consents.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns marketing permission groups and opt-in consents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/18_res_list_consents_GET" + }, + "examples": { + "Marketing Permissions Groups and Consents": { + "value": { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" + }, + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" + } + ], + "total": 2 + }, + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" + }, + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" + } + ], + "total": 2 + } + } + } + } } } } } } - } - } - }, - "put": { - "operationId": "update-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Update Category", - "description": "Update category using the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the category that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_req_update_categories_categoryId" - }, - "examples": { - "Example": { - "value": { - "name": "Summer", - "hierarchy": 1 + }, + "/client/v1/consents#": { + "get": { + "operationId": "list-consents-client-side", + "tags": [ + "CONSENTS API" + ], + "summary": "List Consents (client-side)", + "description": "List the Marketing Permission definitions within the project along with opt-in consents.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns marketing permission groups and opt-in consents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/18_res_list_consents_GET" + }, + "examples": { + "Marketing Permissions Groups and Consents": { + "value": { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" + }, + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" + } + ], + "total": 2 + }, + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" + }, + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" + } + ], + "total": 2 + } + } + } + } + } } } } } - } - }, - "responses": { - "200": { - "description": "Returns a category object with a refreshed `updated_at` property.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b60cfe7d0d7ddbb55", - "name": "Update", - "hierarchy": 1, - "created_at": "2022-07-14T10:45:13.156Z", - "updated_at": "2022-08-16T11:03:54.727Z", - "object": "category" + }, + "/v1/async-action-object": { + "get": { + "operationId": "async-action-object", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "Async Action Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Async Action Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_obj_async_action_object" + } } } } } } }, - "400": { - "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" + "/v1/async-actions": { + "get": { + "operationId": "list-async-actions", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "List Async Actions", + "description": "Track asynchronous operations scheduled in your project. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
          • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
          • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
            • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
              |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
              |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
              CUSTOMERS.METADATA_KEY_PURGE
              PRODUCTS.METADATA_KEY_PURGE
              VOUCHERS.METADATA_KEY_PURGE
              ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "Limit the number of asynchronous actions that the API returns in the response." }, - "examples": { - "Missing hierarchy": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'hierarchy'", - "request_id": "v-0b8b4e6b6210217c93" - } + { + "schema": { + "type": "string", + "example": "2021-09-08T13:52:18.227Z", + "format": "date-time" }, - "Missing name": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'name'", - "request_id": "v-0b8b4f418390217d82" + "in": "query", + "name": "end_date", + "description": "Limits results to actions scheduled before the `end_date`. The date format needs to be consistent with ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). " + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of all scheduled asynchronous actions and detailed information for each scheduled action. Note that a status `DONE`doesn't include the result of the completed action. If you need more information about the result, use the ID of the respective async action to call the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_res_list_async_actions_GET" + }, + "examples": { + "List Async Actions": { + "value": { + "object": "list", + "data_ref": "async_actions", + "async_actions": [ + { + "id": "aa_0ba518c55290c6fd62", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "created_at": "2022-09-05T11:40:17.098Z", + "updated_at": "2022-09-05T11:40:17.887Z", + "request_id": "v-0ba518c52bc99858f0", + "progress": 100, + "object": "async_action" + }, + { + "id": "aa_0ba50a7ff4d3574568", + "type": "CUSTOMERS.METADATA_UPDATE", + "status": "DONE", + "created_at": "2022-09-05T10:37:56.051Z", + "updated_at": "2022-09-05T10:37:56.862Z", + "request_id": "v-0ba50a7feb49984902", + "progress": 100, + "object": "async_action" + } + ] + } + } + } + } + } + }, + "400": { + "description": "Returns an error if incorrect query parameters were provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Query Parameters": { + "value": { + "code": 400, + "key": "invalid_query_params", + "message": "Invalid query params", + "details": "Property .end_date cannot be recognized as a ISO-8601 compliant date", + "request_id": "v-0c54493e444b0f61a6" + } + } + } } } } } } - } - } - } - }, - "/v1/metadata-schema-object": { - "get": { - "operationId": "metadata-schema-object", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "Metadata Schema Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Metadata Schema Object", - "content": { - "application/json": { + }, + "/v1/async-actions/{asyncActionId}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" - } + "type": "string", + "example": "aa_0afb3d009a55814a48" + }, + "name": "asyncActionId", + "in": "path", + "required": true, + "description": "Unique ID of the asynchronous operation." } - } - } - } - } - }, - "/v1/metadata-schemas": { - "get": { - "operationId": "list-metadata-schemas", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "List Metadata Schemas", - "description": "Retrieve metadata schema definitions.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/21_res_list_metadata_shemas" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "schemas", - "schemas": [ - { - "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", - "related_object": "Payment", - "properties": { - "payment_tax": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + ], + "get": { + "operationId": "get-async-action", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "Get Async Action", + "description": "Check the result of a scheduled asynchronous operation. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
              • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
              • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
                • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
                  |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
                  |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
                  CUSTOMERS.METADATA_KEY_PURGE
                  PRODUCTS.METADATA_KEY_PURGE
                  VOUCHERS.METADATA_KEY_PURGE
                  ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns detailed information about the async action result.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_obj_async_action_object" + }, + "examples": { + "CAMPAIGN.VOUCHERS_IMPORT": { + "value": { + "id": "aa_0af9b22296cf473a10", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 3 failed.", + "failed": [ + { + "code": "CODE9", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" + }, + { + "code": "CODE8", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" + }, + { + "code": "CODE7", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" + } + ], + "done_count": 0, + "failed_count": 3 }, - "payment_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": true, - "created_at": "2022-03-07T11:01:01.747Z", - "updated_at": "2022-03-07T11:01:44.785Z", - "object": "metadata_schema" + "created_at": "2023-01-20T07:23:43.289Z", + "updated_at": "2023-01-20T07:23:44.044Z", + "request_id": "v-0c553fdb325688d510", + "progress": 100, + "processing_time": 755, + "object": "async_action" + } }, - { - "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", - "related_object": "campaign", - "properties": { - "Store": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - }, - "locale": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_tag": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" + "CAMPAIGN.VOUCHERS_IMPORT_CSV": { + "value": { + "id": "aa_0c5543f00797b6113f", + "type": "CUSTOMERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 customer(s) imported successfully, 2 failed.", + "failed": [ + { + "source_id": "test-user@voucherify.io", + "row": 1, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" + }, + { + "source_id": "", + "row": 2, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" + } ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + "done_count": 0, + "failed_count": 2 }, - "date_time_tag": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null + "created_at": "2023-01-20T07:41:33.086Z", + "updated_at": "2023-01-20T07:41:33.216Z", + "request_id": "v-0c5543eff2cb0f547f", + "progress": 100, + "processing_time": 130, + "object": "async_action" + } + }, + "CAMPAIGN.VOUCHERS_DELETE": { + "value": { + "id": "aa_0c553853d957b67bd4", + "type": "CAMPAIGN.VOUCHERS_DELETE", + "status": "DONE", + "result": { + "message": "Deleted 2 vouchers.", + "done_count": 2 }, - "favorite_brands": { - "type": "string", - "array": true, - "deleted": true, - "optional": true, - "objectType": null - }, - "height_customer_number": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_country_string": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T13:33:44.556Z", - "updated_at": "2022-07-26T13:57:42.288Z", - "object": "metadata_schema" + "created_at": "2023-01-20T06:50:49.573Z", + "updated_at": "2023-01-20T06:50:50.053Z", + "request_id": "v-0c553853b5c418c826", + "progress": 100, + "processing_time": 480, + "object": "async_action" + } }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "birth_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "CRM_created_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "customer_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.894Z", - "updated_at": "2022-07-14T15:15:34.928Z", - "object": "metadata_schema" + "CAMPAIGN.VOUCHERS_UPDATE": { + "value": { + "id": "aa_0c5440c25c0e5728d0", + "type": "CAMPAIGN.VOUCHERS_UPDATE", + "status": "DONE", + "result": { + "message": "Updated 1 vouchers.", + "done_count": 1 + }, + "created_at": "2023-01-19T12:49:11.024Z", + "updated_at": "2023-01-19T12:49:11.852Z", + "request_id": "v-0c5440c24304189e44", + "progress": 100, + "processing_time": 828, + "object": "async_action" + } }, - { - "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", - "related_object": "earning_rule", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "minLength": 6, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:54:07.980Z", - "updated_at": null, - "object": "metadata_schema" + "CAMPAIGN.VOUCHERS_GENERATE": { + "value": { + "id": "aa_0c54441d14d7b60014", + "type": "CAMPAIGN.VOUCHERS_GENERATE", + "status": "DONE", + "result": { + "message": "Generated 2 vouchers.", + "done_count": 2 + }, + "created_at": "2023-01-19T13:03:50.355Z", + "updated_at": "2023-01-19T13:03:51.030Z", + "request_id": "v-0c54441d0e4418b647", + "progress": 100, + "processing_time": 675, + "object": "async_action" + } }, - { - "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", - "related_object": "loyalty_tier", - "properties": { - "has_funds": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:22:16.685Z", - "updated_at": "2022-07-27T08:55:01.628Z", - "object": "metadata_schema" + "CAMPAIGNS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c554b22664a0eb5fc", + "type": "CAMPAIGNS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 0 campaigns.", + "done_count": 0 + }, + "created_at": "2023-01-20T08:12:59.673Z", + "updated_at": "2023-01-20T08:13:00.638Z", + "request_id": "w-0c554b225f8a0eb5fb", + "progress": 100, + "processing_time": 965, + "object": "async_action" + } }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "Payment": { - "type": "object", - "array": false, - "deleted": true, - "optional": true, - "objectType": "Payment" - }, - "day_of_week": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" + "CUSTOMERS.IMPORT_CSV": { + "value": { + "id": "aa_0c5543f00797b6113f", + "type": "CUSTOMERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 customer(s) imported successfully, 2 failed.", + "failed": [ + { + "source_id": "test-user@voucherify.io", + "row": 1, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" + }, + { + "source_id": "", + "row": 2, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" + } ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" + "done_count": 0, + "failed_count": 2 + }, + "created_at": "2023-01-20T07:41:33.086Z", + "updated_at": "2023-01-20T07:41:33.216Z", + "request_id": "v-0c5543eff2cb0f547f", + "progress": 100, + "processing_time": 130, + "object": "async_action" + } + }, + "CUSTOMERS.BULK_UPDATE": { + "value": { + "id": "aa_0c5547cc5e17b617b6", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "source_id_1", + "updated": true, + "found": true + }, + { + "source_id": "source_id_2", + "updated": true, + "found": true + }, + { + "source_id": "source_id_3", + "updated": true, + "found": true + } ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "number_of_store_visits": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.798Z", - "updated_at": "2022-04-20T06:47:10.350Z", - "object": "metadata_schema" + "done_count": 3 + }, + "created_at": "2023-01-20T07:58:25.144Z", + "updated_at": "2023-01-20T07:58:25.869Z", + "request_id": "v-0c5547cc4d8b0f5be4", + "progress": 100, + "processing_time": 725, + "object": "async_action" + } }, - { - "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", - "related_object": "order_item", - "properties": { - "Size": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + "CUSTOMERS.METADATA_UPDATE": { + "value": { + "id": "aa_0c554a92030e576181", + "type": "CUSTOMERS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "source_1", + "updated": true, + "found": true + }, + { + "source_id": "source_2", + "updated": true, + "found": true + } + ], + "done_count": 2 }, - "Color": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Thickness": { - "eq": [ - "Thin", - "Medium", - "Thick" + "created_at": "2023-01-20T08:10:31.821Z", + "updated_at": "2023-01-20T08:10:32.564Z", + "request_id": "v-0c554a91fb4b0f61a2", + "progress": 100, + "processing_time": 743, + "object": "async_action" + } + }, + "CUSTOMERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c5551f2ab0a0ebf0e", + "type": "CUSTOMERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 0 customers.", + "done_count": 0 + }, + "created_at": "2023-01-20T08:42:45.804Z", + "updated_at": "2023-01-20T08:42:46.079Z", + "request_id": "w-0c5551f2a38a0ebf0d", + "progress": 100, + "processing_time": 275, + "object": "async_action" + } + }, + "PRODUCTS.BULK_UPDATE": { + "value": { + "id": "aa_0c5553f0f457b6328e", + "type": "PRODUCTS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "first_product", + "updated": false, + "found": true + }, + { + "source_id": "second_product", + "updated": false, + "found": true + } ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-11T13:32:55.029Z", - "updated_at": "2022-05-23T13:46:01.463Z", - "object": "metadata_schema" + "done_count": 2 + }, + "created_at": "2023-01-20T08:51:28.337Z", + "updated_at": "2023-01-20T08:51:28.439Z", + "request_id": "v-0c5553f0e94b0f7502", + "progress": 100, + "processing_time": 102, + "object": "async_action" + } }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "color": { - "type": "string", - "array": true, - "optional": true, - "objectType": null + "PRODUCTS.METADATA_UPDATE": { + "value": { + "id": "aa_0c5554869b97b633b4", + "type": "PRODUCTS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "123-567-3433", + "updated": false, + "found": true + }, + { + "source_id": "test_volleyball", + "updated": false, + "found": true + } + ], + "done_count": 2 }, - "origin": { - "type": "string", - "array": false, - "optional": true, - "minLength": 1, - "objectType": null - }, - "product_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_date_property": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_number_property": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_boolean_property": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_datetime_property": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.880Z", - "updated_at": "2022-07-14T15:46:47.994Z", - "object": "metadata_schema" + "created_at": "2023-01-20T08:54:01.582Z", + "updated_at": "2023-01-20T08:54:02.436Z", + "request_id": "v-0c55548694c418f9dd", + "progress": 100, + "processing_time": 854, + "object": "async_action" + } }, - { - "id": "ms_th8YHt9yFYY1yAA99XOasT5W", - "related_object": "promotion_tier", - "properties": { - "has_budget": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:21.523Z", - "updated_at": "2022-07-27T08:54:42.909Z", - "object": "metadata_schema" + "PRODUCTS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c5552d997ca0ec03a", + "type": "PRODUCTS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 2 products.", + "done_count": 2 + }, + "created_at": "2023-01-20T08:46:42.271Z", + "updated_at": "2023-01-20T08:46:43.240Z", + "request_id": "w-0c5552d98e8a0ec039", + "progress": 100, + "processing_time": 969, + "object": "async_action" + } }, - { - "id": "ms_Z7niydc0OpGjDRL4yB40niXn", - "related_object": "publication", - "properties": { - "year": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:23:49.715Z", - "updated_at": "2022-04-19T10:28:24.568Z", - "object": "metadata_schema" + "VOUCHERS.IMPORT": { + "value": { + "id": "aa_0c5559be44d7b63c06", + "type": "VOUCHERS.IMPORT", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 3 failed.", + "failed": [ + { + "code": "PROMO-CODE31", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" + }, + { + "code": "PROMO-CODE21", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" + }, + { + "code": "GIFT-CARD-100-1", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" + } + ], + "done_count": 0, + "failed_count": 3 + }, + "created_at": "2023-01-20T09:16:49.299Z", + "updated_at": "2023-01-20T09:16:50.238Z", + "request_id": "v-0c5559be25c418824a", + "progress": 100, + "processing_time": 939, + "object": "async_action" + } }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" + "VOUCHERS.IMPORT_CSV": { + "value": { + "id": "aa_0c555db3d697b643e1", + "type": "VOUCHERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 2 failed.", + "failed": [ + { + "code": "FALL2023", + "row": 1, + "reason": "Voucher Type is required" + }, + { + "code": "FALL2024", + "row": 2, + "reason": "Voucher Type is required" + } ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" + "done_count": 0, + "failed_count": 2 + }, + "created_at": "2023-01-20T09:34:07.194Z", + "updated_at": "2023-01-20T09:34:07.367Z", + "request_id": "v-0c555db3ba8b0f0767", + "progress": 100, + "processing_time": 173, + "object": "async_action" + } + }, + "VOUCHERS.BULK_UPDATE": { + "value": { + "id": "aa_0c555e8115d7b64504", + "type": "VOUCHERS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "code": "PROMO-CODE81019", + "updated": false, + "found": false + }, + { + "code": "PROMO-CODE7264786", + "updated": false, + "found": false + } ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.890Z", - "updated_at": "2022-07-26T14:58:24.546Z", - "object": "metadata_schema" + "done_count": 2 + }, + "created_at": "2023-01-20T09:37:37.367Z", + "updated_at": "2023-01-20T09:37:37.520Z", + "request_id": "v-0c555e810904188aa4", + "progress": 100, + "processing_time": 153, + "object": "async_action" + } }, - { - "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", - "related_object": "reward", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "objectType": null, - "exactLength": 4 - } - }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:53:32.257Z", - "updated_at": "2022-07-27T08:53:48.542Z", - "object": "metadata_schema" + "VOUCHERS.METADATA_UPDATE": { + "value": { + "id": "aa_0c555ed40857b6463a", + "type": "VOUCHERS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "code": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "updated": false, + "found": false + }, + { + "code": "LOYALTY-CARD-xLPbpbXR", + "updated": false, + "found": false + } + ], + "done_count": 2 + }, + "created_at": "2023-01-20T09:39:02.305Z", + "updated_at": "2023-01-20T09:39:02.640Z", + "request_id": "v-0c555ed40084188b55", + "progress": 100, + "processing_time": 335, + "object": "async_action" + } + }, + "VOUCHERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c55534bd64a0ec0e0", + "type": "VOUCHERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 9 vouchers.", + "done_count": 9 + }, + "created_at": "2023-01-20T08:48:39.257Z", + "updated_at": "2023-01-20T08:48:40.503Z", + "request_id": "w-0c55534bcfca0ec0df", + "progress": 100, + "processing_time": 1246, + "object": "async_action" + } }, - { - "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", - "related_object": "voucher", - "properties": { - "unit": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + "SKUS.IMPORT_CSV": { + "value": { + "id": "aa_0c5558728d0e577e67", + "type": "SKUS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "4 sku(s) imported successfully, 0 failed.", + "failed": [], + "done_count": 4, + "failed_count": 0 }, - "Region": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" + "created_at": "2023-01-20T09:11:09.620Z", + "updated_at": "2023-01-20T09:11:10.270Z", + "request_id": "v-0c5558726f0b0f7d82", + "progress": 100, + "processing_time": 650, + "object": "async_action" + } + }, + "PRODUCTS.IMPORT_CSV": { + "value": { + "id": "aa_0c55578e914e577cf1", + "type": "PRODUCTS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "1 product(s) imported successfully, 1 failed.", + "failed": [ + { + "row": 1, + "reason": "vendor: must be a string, property is required, must be equal to one of Vendor 1,Vendor 2 (actual value is 'Vendor 3')" + } ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + "done_count": 1, + "failed_count": 1 }, - "CATEGORY": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "created_at": "2023-01-20T09:07:16.165Z", + "updated_at": "2023-01-20T09:07:17.025Z", + "request_id": "v-0c55578e7a0418fef5", + "progress": 100, + "processing_time": 860, + "object": "async_action" + } + }, + "ORDERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c555fda50472c83a8", + "type": "ORDERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 1 orders.", + "done_count": 1 }, - "active_on_calendar_month": { - "eq": [ - 1, - 2, - 3, - 5, - 7, - 9, - 10, - 11, - 12 + "created_at": "2023-01-20T09:43:30.881Z", + "updated_at": "2023-01-20T09:43:31.217Z", + "request_id": "w-0c555fda45c72c83a7", + "progress": 100, + "processing_time": 336, + "object": "async_action" + } + }, + "ORDERS.IMPORT": { + "value": { + "id": "aa_0c5564b67d0e571534", + "type": "ORDERS.IMPORT", + "status": "DONE", + "result": { + "message": "1 order(s) imported successfully, 1 failed.", + "failed": [ + { + "source_id": null, + "reason": "Internal error" + } ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:01.281Z", - "updated_at": "2022-06-22T07:22:09.577Z", - "object": "metadata_schema" + "done_count": 1, + "failed_count": 1 + }, + "created_at": "2023-01-20T10:04:44.916Z", + "updated_at": "2023-01-20T10:04:46.102Z", + "request_id": "v-0c5564b6688b0f155d", + "progress": 100, + "processing_time": 1186, + "object": "async_action" + } } - ], - "total": 13 + } + } + } + }, + "404": { + "description": "Returns an error indicating that the async action with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Async-Action-Not-Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find async_action with id aa_0aeb82bd55d5beffb", + "request_id": "v-0aeb88df54c82af560", + "resource_id": "aa_0aeb82bd55d5beffb", + "resource_type": "async_action" + } + } + } } } } } } - } - } - } - }, - "/v1/metadata-schemas/{resource}": { - "parameters": [ - { - "schema": { - "type": "string" }, - "name": "resource", - "in": "path", - "required": true, - "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas." - } - ], - "get": { - "operationId": "get-metadata-schema", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "Get Metadata Schema", - "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" + "/v1/export-object": { + "get": { + "operationId": "export-object", + "tags": [ + "EXPORTS API" + ], + "summary": "Export Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Export Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + } + } + } + } + } + } + }, + "/v1/exports": { + "post": { + "operationId": "create-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Create Export", + "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                  `GIFT_VOUCHER`: amount left to spend
                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the export that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_req_create_export_POST" + } + } + } + }, + "responses": { + "200": { + "description": "Returns export object and URL of CSV file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + } + } + } }, - "examples": { - "earning_rule": { - "value": { - "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", - "related_object": "earning_rule", - "properties": { - "channel_id": { - "type": "string", - "array": true, - "optional": true, - "objectType": null, - "exactLength": 5 + "400": { + "description": "Returns an error if an invalid payload is provided.", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + { + "$ref": "#/components/schemas/e_400_invalid_export_fields" + } + ] + }, + "examples": { + "Invalid Export Fields": { + "value": { + "code": 400, + "key": "invalid_export_fields", + "message": "Invalid Export", + "details": "Unsupported field used. Allowed fields: 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", + "request_id": "v-0afdb603910a1a14e0" + } }, - "channel_name": { - "eq": [ - "instagram", - "facebook", - "google", - "twitter", - "linkedin", - "website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]", + "request_id": "v-0afdb5bd68d20bdb81" + } } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:09:59.970Z", - "updated_at": "2022-08-25T13:11:15.704Z", - "object": "metadata_schema" + } } + } + } + } + }, + "get": { + "operationId": "list-exports", + "tags": [ + "EXPORTS API" + ], + "summary": "List Exports", + "description": "List all exports. ", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "status", + "-status" + ] }, - "campaign": { - "value": { - "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", - "related_object": "campaign", - "properties": { - "region": { - "eq": [ - "EMEA", - "AMER", - "APAC" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_res_list_exports" + }, + "examples": { + "List Exports": { + "value": { + "object": "list", + "data_ref": "exports", + "exports": [ + { + "id": "exp_323UOPsH42twhJVaDZXf4UNo", + "object": "export", + "created_at": "2022-08-04T09:11:25.208Z", + "status": "DONE", + "channel": "API", + "exported_object": "order", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "source_id", + "status" + ], + "filters": { + "junction": "and" + } + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o" + }, + "user_id": null + }, + { + "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9", + "object": "export", + "created_at": "2022-05-02T06:44:03.186Z", + "status": "DONE", + "channel": "API", + "exported_object": "voucher", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "code", + "voucher_type", + "value" + ], + "filters": { + "junction": "and" + } + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ" + }, + "user_id": null + }, + { + "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", + "object": "export", + "created_at": "2022-01-13T09:03:18.293Z", + "status": "DONE", + "channel": "API", + "exported_object": "customer", + "parameters": { + "order": "", + "fields": [ + "name", + "id", + "email", + "source_id", + "created_at" + ], + "filters": { + "junction": "and" + }, + "response_format": "CSV" + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" + }, + "user_id": null + } + ], + "total": 3 + } } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:12:58.447Z", - "updated_at": null, - "object": "metadata_schema" + } } - }, - "customer": { - "value": { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "age": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "city_id": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + } + } + } + } + }, + "/v1/exports/{exportId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ" + }, + "name": "exportId", + "in": "path", + "required": true, + "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`." + } + ], + "get": { + "operationId": "get-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Get Export", + "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the export object if a valid identifier was provided in the path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + }, + "examples": { + "Get Export": { + "value": { + "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", + "object": "export", + "created_at": "2022-01-13T09:03:18.293Z", + "status": "DONE", + "channel": "API", + "exported_object": "customer", + "parameters": { + "order": "", + "fields": [ + "name", + "id", + "email", + "source_id", + "created_at" + ], + "filters": { + "junction": "and" + }, + "response_format": "CSV" + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" + }, + "user_id": null + } } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.889Z", - "updated_at": "2022-09-12T07:34:49.163Z", - "object": "metadata_schema" + } } - }, - "loyalty_tier": { - "value": { - "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", - "related_object": "loyalty_tier", - "properties": { - "level_name": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "audience_restricted": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null + } + }, + "404": { + "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0", + "request_id": "v-0b029305af4524cf42", + "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0", + "resource_type": "export" + } } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:14:54.954Z", - "updated_at": "2022-08-25T13:15:24.436Z", - "object": "metadata_schema" + } } - }, - "order": { - "value": { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "card": { - "eq": [ - "Visa", - "MasterCard", - "Other" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "currency": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "ne": [ - 1, - 2, - 18, - 22 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "store_city": { - "eq": [ - "Hampden", - "San Francisco", - "Warsaw" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null + } + } + } + }, + "delete": { + "operationId": "delete-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Delete Export", + "description": "This method deletes a previously created export object.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the export with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Export Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ", + "request_id": "v-0ae2a97a399027d719", + "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ", + "resource_type": "export" + } } + } + } + } + } + } + } + }, + "/v1/exports/{export_Id}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ" + }, + "name": "export_Id", + "in": "path", + "required": true, + "description": "Unique export object ID." + } + ], + "get": { + "operationId": "download-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Download Export", + "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [], + "Download-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns contents of CSV file.", + "content": { + "text/plain": { + "schema": { + "type": "string" }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:47.575Z", - "updated_at": "2022-10-25T10:05:18.978Z", - "object": "metadata_schema" + "examples": { + "CSV file contents": { + "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0" + } + } } - }, - "order_item": { - "value": { - "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", - "related_object": "order_item", - "properties": { - "manufacturer_id": { - "gte": 15, - "type": "number", - "array": false, - "optional": true, - "objectType": null + } + }, + "401": { + "description": "Returns an error if an invalid token was provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "default": 401, + "description": "Error's HTTP status code." + }, + "message": { + "type": "string", + "default": "Unauthorized", + "description": "A human-readable message providing a short description about the error." + }, + "key": { + "type": "string", + "default": "unauthorized", + "description": "Short string describing the kind of error which occurred." + } } }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:03.167Z", - "updated_at": null, - "object": "metadata_schema" + "examples": { + "Unauthorized": { + "value": { + "code": 401, + "message": "Unauthorized", + "key": "unauthorized" + } + } + } } - }, - "product": { - "value": { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "vendor": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "category": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null + } + } + } + } + }, + "/v1/category-object": { + "get": { + "operationId": "category-object", + "tags": [ + "CATEGORIES API" + ], + "summary": "Category Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Category Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + } + } + } + } + }, + "/v1/categories": { + "get": { + "operationId": "list-categories", + "tags": [ + "CATEGORIES API" + ], + "summary": "List Categories", + "description": "List all categories.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of category objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_res_list_categories" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cat_0b5f49fb31c3bf6ab0", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T06:21:36.852Z", + "object": "category" + }, + { + "id": "cat_0b5f49e6e1ce5bd2ba", + "name": "Fifth", + "hierarchy": 5, + "created_at": "2022-07-13T06:21:16.039Z", + "object": "category" + }, + { + "id": "cat_0b5f49deafce5bd2b5", + "name": "Fourth", + "hierarchy": 4, + "created_at": "2022-07-13T06:21:07.662Z", + "object": "category" + }, + { + "id": "cat_0b5f49d45c43bf6a99", + "name": "Third", + "hierarchy": 3, + "created_at": "2022-07-13T06:20:57.094Z", + "object": "category" + }, + { + "id": "cat_0b5f3f9881ce5bccb6", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-07-13T05:36:14.355Z", + "object": "category" + }, + { + "id": "cat_0b53bc388dc2f108ba", + "name": "First", + "hierarchy": 1, + "created_at": "2022-07-04T06:58:57.734Z", + "object": "category" + } + ], + "total": 6 + } } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.298Z", - "updated_at": "2022-07-14T15:53:29.226Z", - "object": "metadata_schema" + } } - }, - "promotion_tier": { - "value": { - "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", - "related_object": "promotion_tier", - "properties": { - "level": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + } + } + } + }, + "post": { + "operationId": "create-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Create Category", + "description": "Create category with a specific name and hierarchy.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the category that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_req_create_category" + }, + "examples": { + "Example": { + "value": { + "name": "Eighth", + "hierarchy": 8 } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a newly created category object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_res_create_category" }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:04.937Z", - "updated_at": "2022-09-23T08:51:46.266Z", - "object": "metadata_schema" + "examples": { + "Example": { + "value": { + "id": "cat_0b8b5a427a0283c854", + "name": "Eighth", + "hierarchy": 8, + "created_at": "2022-08-16T11:45:54.171Z", + "object": "category" + } + } + } } - }, - "publication": { - "value": { - "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", - "related_object": "publication", - "properties": { - "file_uploaded": { - "type": "image_url", - "array": false, - "optional": true, - "objectType": null + } + }, + "400": { + "description": "Returns an error if the payload is incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Missing name": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'name'", + "request_id": "v-0b8b5b960990210b25" + } }, - "publication_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "Missing hierarchy": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'hierarchy'", + "request_id": "v-0b8b5bf9d9c6824a2f" + } } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:35.534Z", - "updated_at": "2022-09-12T10:26:31.135Z", - "object": "metadata_schema" + } } - }, - "redemption": { - "value": { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "redemption_location": { - "type": "object", - "array": false, - "optional": true, - "objectType": "Location" + } + } + } + } + }, + "/v1/categories/{categoryId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "categoryId", + "in": "path", + "required": true, + "description": "Unique category ID assigned by Voucherify." + } + ], + "get": { + "operationId": "get-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Get Category", + "description": "Retrieve a category by the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a category object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "examples": { + "Example": { + "value": { + "id": "cat_0b5f49fb31c3bf6ab0", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T06:21:36.852Z", + "object": "category" + } } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.794Z", - "updated_at": "2022-08-25T13:19:50.497Z", - "object": "metadata_schema" + } } - }, - "reward": { - "value": { - "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", - "related_object": "reward", - "properties": { - "reward_type": { - "eq": [ - "MATERIAL", - "PAY-WITH-POINTS", - "DISCOUNT-COUPON", - "GIFT-CARD-CREDITS", - "LOYALTY POINTS" - ], - "type": "string", - "array": false, - "optional": false, - "objectType": null + } + } + } + }, + "delete": { + "operationId": "delete-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Delete Category", + "description": "Delete a category by the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "No content is returned." + }, + "404": { + "description": "Returns an error indicating that the category with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find category with id example_category", + "request_id": "v-0b8b49205f902176c9", + "resource_id": "example_category", + "resource_type": "category" + } + } + } + } + } + } + } + }, + "put": { + "operationId": "update-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Update Category", + "description": "Update category using the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the category that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_req_update_categories_categoryId" + }, + "examples": { + "Example": { + "value": { + "name": "Summer", + "hierarchy": 1 } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a category object with a refreshed `updated_at` property.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" }, - "allow_defined_only": true, - "created_at": "2022-08-25T13:07:13.689Z", - "updated_at": "2022-08-25T13:08:26.696Z", - "object": "metadata_schema" + "examples": { + "Example": { + "value": { + "id": "cat_0b60cfe7d0d7ddbb55", + "name": "Update", + "hierarchy": 1, + "created_at": "2022-07-14T10:45:13.156Z", + "updated_at": "2022-08-16T11:03:54.727Z", + "object": "category" + } + } + } } - }, - "voucher": { - "value": { - "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", - "related_object": "voucher", - "properties": { - "lang": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "marketing_text": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + } + }, + "400": { + "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Missing hierarchy": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'hierarchy'", + "request_id": "v-0b8b4e6b6210217c93" + } }, - "ProductionVoucherCodeMetaData": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null + "Missing name": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'name'", + "request_id": "v-0b8b4f418390217d82" + } } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:23.994Z", - "updated_at": "2022-09-19T14:13:30.590Z", - "object": "metadata_schema" + } } } } } } }, - "404": { - "description": "Returns an error if the resource provided in the path is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find metadata schema with id earning_rules", - "request_id": "v-0c1b9ce0098a391421", - "resource_id": "earning_rules", - "resource_type": "metadata schema" + "/v1/metadata-schema-object": { + "get": { + "operationId": "metadata-schema-object", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "Metadata Schema Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Metadata Schema Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/21_obj_metadata_schema_object" + } } } } } } - } - } - } - }, - "/v1/location-object": { - "get": { - "operationId": "location-object", - "tags": [ - "LOCATIONS API" - ], - "summary": "Location Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Location Object", - "content": { - "application/json": { + }, + "/v1/metadata-schemas": { + "get": { + "operationId": "list-metadata-schemas", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "List Metadata Schemas", + "description": "Retrieve metadata schema definitions.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/21_res_list_metadata_shemas" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "schemas", + "schemas": [ + { + "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", + "related_object": "Payment", + "properties": { + "payment_tax": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "payment_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": true, + "created_at": "2022-03-07T11:01:01.747Z", + "updated_at": "2022-03-07T11:01:44.785Z", + "object": "metadata_schema" + }, + { + "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", + "related_object": "campaign", + "properties": { + "Store": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + }, + "locale": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_tag": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_time_tag": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "deleted": true, + "optional": true, + "objectType": null + }, + "height_customer_number": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_country_string": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T13:33:44.556Z", + "updated_at": "2022-07-26T13:57:42.288Z", + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "birth_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "CRM_created_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "customer_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.894Z", + "updated_at": "2022-07-14T15:15:34.928Z", + "object": "metadata_schema" + }, + { + "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", + "related_object": "earning_rule", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "minLength": 6, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-07-27T08:54:07.980Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", + "related_object": "loyalty_tier", + "properties": { + "has_funds": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-30T06:22:16.685Z", + "updated_at": "2022-07-27T08:55:01.628Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "Payment": { + "type": "object", + "array": false, + "deleted": true, + "optional": true, + "objectType": "Payment" + }, + "day_of_week": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "number_of_store_visits": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.798Z", + "updated_at": "2022-04-20T06:47:10.350Z", + "object": "metadata_schema" + }, + { + "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", + "related_object": "order_item", + "properties": { + "Size": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Color": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Thickness": { + "eq": [ + "Thin", + "Medium", + "Thick" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-11T13:32:55.029Z", + "updated_at": "2022-05-23T13:46:01.463Z", + "object": "metadata_schema" + }, + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "color": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "origin": { + "type": "string", + "array": false, + "optional": true, + "minLength": 1, + "objectType": null + }, + "product_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_date_property": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_number_property": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_boolean_property": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_datetime_property": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.880Z", + "updated_at": "2022-07-14T15:46:47.994Z", + "object": "metadata_schema" + }, + { + "id": "ms_th8YHt9yFYY1yAA99XOasT5W", + "related_object": "promotion_tier", + "properties": { + "has_budget": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:21.523Z", + "updated_at": "2022-07-27T08:54:42.909Z", + "object": "metadata_schema" + }, + { + "id": "ms_Z7niydc0OpGjDRL4yB40niXn", + "related_object": "publication", + "properties": { + "year": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-30T06:23:49.715Z", + "updated_at": "2022-04-19T10:28:24.568Z", + "object": "metadata_schema" + }, + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.890Z", + "updated_at": "2022-07-26T14:58:24.546Z", + "object": "metadata_schema" + }, + { + "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", + "related_object": "reward", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "objectType": null, + "exactLength": 4 + } + }, + "allow_defined_only": false, + "created_at": "2022-07-27T08:53:32.257Z", + "updated_at": "2022-07-27T08:53:48.542Z", + "object": "metadata_schema" + }, + { + "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", + "related_object": "voucher", + "properties": { + "unit": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Region": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "CATEGORY": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "active_on_calendar_month": { + "eq": [ + 1, + 2, + 3, + 5, + 7, + 9, + 10, + 11, + 12 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:01.281Z", + "updated_at": "2022-06-22T07:22:09.577Z", + "object": "metadata_schema" + } + ], + "total": 13 + } + } + } + } + } + } + } + } + }, + "/v1/metadata-schemas/{resource}": { + "parameters": [ + { "schema": { - "$ref": "#/components/schemas/22_obj_location_object" + "type": "string" + }, + "name": "resource", + "in": "path", + "required": true, + "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas." + } + ], + "get": { + "operationId": "get-metadata-schema", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "Get Metadata Schema", + "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/21_obj_metadata_schema_object" + }, + "examples": { + "earning_rule": { + "value": { + "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", + "related_object": "earning_rule", + "properties": { + "channel_id": { + "type": "string", + "array": true, + "optional": true, + "objectType": null, + "exactLength": 5 + }, + "channel_name": { + "eq": [ + "instagram", + "facebook", + "google", + "twitter", + "linkedin", + "website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:09:59.970Z", + "updated_at": "2022-08-25T13:11:15.704Z", + "object": "metadata_schema" + } + }, + "campaign": { + "value": { + "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", + "related_object": "campaign", + "properties": { + "region": { + "eq": [ + "EMEA", + "AMER", + "APAC" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:12:58.447Z", + "updated_at": null, + "object": "metadata_schema" + } + }, + "customer": { + "value": { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "age": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "city_id": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.889Z", + "updated_at": "2022-09-12T07:34:49.163Z", + "object": "metadata_schema" + } + }, + "loyalty_tier": { + "value": { + "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", + "related_object": "loyalty_tier", + "properties": { + "level_name": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "audience_restricted": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:14:54.954Z", + "updated_at": "2022-08-25T13:15:24.436Z", + "object": "metadata_schema" + } + }, + "order": { + "value": { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "card": { + "eq": [ + "Visa", + "MasterCard", + "Other" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "currency": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "ne": [ + 1, + 2, + 18, + 22 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "store_city": { + "eq": [ + "Hampden", + "San Francisco", + "Warsaw" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:47.575Z", + "updated_at": "2022-10-25T10:05:18.978Z", + "object": "metadata_schema" + } + }, + "order_item": { + "value": { + "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", + "related_object": "order_item", + "properties": { + "manufacturer_id": { + "gte": 15, + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:03.167Z", + "updated_at": null, + "object": "metadata_schema" + } + }, + "product": { + "value": { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "vendor": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "category": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.298Z", + "updated_at": "2022-07-14T15:53:29.226Z", + "object": "metadata_schema" + } + }, + "promotion_tier": { + "value": { + "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", + "related_object": "promotion_tier", + "properties": { + "level": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:04.937Z", + "updated_at": "2022-09-23T08:51:46.266Z", + "object": "metadata_schema" + } + }, + "publication": { + "value": { + "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", + "related_object": "publication", + "properties": { + "file_uploaded": { + "type": "image_url", + "array": false, + "optional": true, + "objectType": null + }, + "publication_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:35.534Z", + "updated_at": "2022-09-12T10:26:31.135Z", + "object": "metadata_schema" + } + }, + "redemption": { + "value": { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "redemption_location": { + "type": "object", + "array": false, + "optional": true, + "objectType": "Location" + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.794Z", + "updated_at": "2022-08-25T13:19:50.497Z", + "object": "metadata_schema" + } + }, + "reward": { + "value": { + "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", + "related_object": "reward", + "properties": { + "reward_type": { + "eq": [ + "MATERIAL", + "PAY-WITH-POINTS", + "DISCOUNT-COUPON", + "GIFT-CARD-CREDITS", + "LOYALTY POINTS" + ], + "type": "string", + "array": false, + "optional": false, + "objectType": null + } + }, + "allow_defined_only": true, + "created_at": "2022-08-25T13:07:13.689Z", + "updated_at": "2022-08-25T13:08:26.696Z", + "object": "metadata_schema" + } + }, + "voucher": { + "value": { + "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", + "related_object": "voucher", + "properties": { + "lang": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "marketing_text": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "ProductionVoucherCodeMetaData": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:23.994Z", + "updated_at": "2022-09-19T14:13:30.590Z", + "object": "metadata_schema" + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the resource provided in the path is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find metadata schema with id earning_rules", + "request_id": "v-0c1b9ce0098a391421", + "resource_id": "earning_rules", + "resource_type": "metadata schema" + } + } + } + } + } } } } - } - } - } - }, - "/v1/locations": { - "get": { - "operationId": "list-locations", - "tags": [ - "LOCATIONS API" - ], - "summary": "List Locations", - "description": "Returns a list of your locations.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "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." + "/v1/location-object": { + "get": { + "operationId": "location-object", + "tags": [ + "LOCATIONS API" + ], + "summary": "Location Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Location Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_obj_location_object" + } + } + } + } + } + } }, - { - "name": "filters", - "in": "query", - "required": false, - "schema": { - "anyOf": [ + "/v1/locations": { + "get": { + "operationId": "list-locations", + "tags": [ + "LOCATIONS API" + ], + "summary": "List Locations", + "description": "Returns a list of your locations.", + "parameters": [ { - "$ref": "#/components/schemas/22_filter_updated_at" + "$ref": "#/components/parameters/limit" }, { - "$ref": "#/components/schemas/22_filter_created_at" + "name": "order", + "in": "query", + "required": false, + "schema": { + "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." }, { - "$ref": "#/components/schemas/22_filter_name" + "name": "filters", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/22_filter_updated_at" + }, + { + "$ref": "#/components/schemas/22_filter_created_at" + }, + { + "$ref": "#/components/schemas/22_filter_name" + }, + { + "$ref": "#/components/schemas/22_filter_id" + } + ] + }, + "description": "Filter the locations using one of the available filters.", + "style": "deepObject", + "explode": true }, { - "$ref": "#/components/schemas/22_filter_id" + "name": "end_date", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)." } - ] - }, - "description": "Filter the locations using one of the available filters.", - "style": "deepObject", - "explode": true + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_res_list_locations" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" + } + }, + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null + }, + { + "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", + "object": "location", + "name": "New York", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + -74.016167, + 40.703186 + ], + [ + -74.008687, + 40.750656 + ], + [ + -73.943597, + 40.851838 + ], + [ + -73.928559, + 40.845285 + ], + [ + -73.936152, + 40.8356 + ], + [ + -73.934298, + 40.810015 + ], + [ + -73.92711, + 40.795145 + ], + [ + -73.978623, + 40.710432 + ], + [ + -74.013201, + 40.701619 + ], + [ + -74.016167, + 40.703186 + ] + ] + ] + } + }, + "created_at": "2022-07-15T05:37:45.299Z", + "updated_at": null + }, + { + "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", + "object": "location", + "name": "Germany", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:51.303908897065064,10.222253628401518", + "radius": "192.37 km" + } + }, + "created_at": "2022-07-14T15:51:39.265Z", + "updated_at": null + }, + { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], + [ + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 + ] + ] + ] + } + }, + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null + } + ], + "total": 4, + "has_more": false + } + } + } + } + } + } + } + } }, - { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "date-time" - }, - "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/22_res_list_locations" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } - }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - }, - { - "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", - "object": "location", - "name": "New York", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - -74.016167, - 40.703186 - ], - [ - -74.008687, - 40.750656 - ], - [ - -73.943597, - 40.851838 - ], - [ - -73.928559, - 40.845285 - ], - [ - -73.936152, - 40.8356 - ], - [ - -73.934298, - 40.810015 - ], - [ - -73.92711, - 40.795145 - ], - [ - -73.978623, - 40.710432 - ], - [ - -74.013201, - 40.701619 - ], - [ - -74.016167, - 40.703186 - ] - ] - ] - } - }, - "created_at": "2022-07-15T05:37:45.299Z", - "updated_at": null - }, - { - "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", - "object": "location", - "name": "Germany", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:51.303908897065064,10.222253628401518", - "radius": "192.37 km" - } - }, - "created_at": "2022-07-14T15:51:39.265Z", - "updated_at": null + "/v1/locations/{locationId}": { + "get": { + "operationId": "get-location", + "tags": [ + "LOCATIONS API" + ], + "summary": "Get Location", + "description": "Returns a location object.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "locationId", + "in": "path", + "required": true, + "description": "The unique location ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a location object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_obj_location_object" + }, + "examples": { + "Circle Example": { + "value": { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" + } + }, + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null + } }, - { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], + "Polygon Example": { + "value": { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], + [ + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 + ] ] ] - ] - } - }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null + } + }, + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null + } } - ], - "total": 4, - "has_more": false + } } } } } } - } - } - } - }, - "/v1/locations/{locationId}": { - "get": { - "operationId": "get-location", - "tags": [ - "LOCATIONS API" - ], - "summary": "Get Location", - "description": "Returns a location object.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "locationId", - "in": "path", - "required": true, - "description": "The unique location ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a location object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/22_obj_location_object" - }, - "examples": { - "Circle Example": { - "value": { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } - }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - } - }, - "Polygon Example": { - "value": { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], - [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 - ] - ] - ] - } - }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null + }, + "/v1/qualification-object": { + "get": { + "operationId": "qualification-object", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Qualification Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Qualification Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" + } } } } } } - } - } - } - }, - "/v1/qualification-object": { - "get": { - "operationId": "qualification-object", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Qualification Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Qualification Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" + }, + "/v1/qualifications": { + "post": { + "operationId": "check-eligibility", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Check Eligibility", + "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] } - } - } - } - } - } - }, - "/v1/qualifications": { - "post": { - "operationId": "check-eligibility", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Check Eligibility", - "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define order and customer context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_req_create_qualification" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a qualifications object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" + ], + "requestBody": { + "description": "Define order and customer context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_req_create_qualification" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a qualifications object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" + } + } + } } } } - } - } - } - }, - "/client/v1/qualifications": { - "post": { - "operationId": "check-eligibility-client-side", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Check Eligibility (client-side)", - "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", - "parameters": [], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Define order and customer context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_req_create_qualification" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a qualifications object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" + }, + "/client/v1/qualifications": { + "post": { + "operationId": "check-eligibility-client-side", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Check Eligibility (client-side)", + "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", + "parameters": [], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Define order and customer context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_req_create_qualification" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a qualifications object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" + } + } + } } } } From a769187f53d784cf0710a0d2fcce5deb0ee1e01a Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:57:35 +0200 Subject: [PATCH 042/108] done? --- CONTRIBUTING.md | 2 +- package-lock.json | 9 ++++ package.json | 3 +- scripts/{index.ts => manage-project.ts} | 55 ++++++++++++++++++------- 4 files changed, 53 insertions(+), 16 deletions(-) rename scripts/{index.ts => manage-project.ts} (71%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bc5258e7a..9a78df7b8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -140,7 +140,7 @@ Good practices: - Test changes on readme (you can use the version prepared by the contributor). - Ensure the changelog was updated. - Merge PR to `master` branch -- In reamde.io, change the current documentation version from `v2018-08-01` to `v2018-08-01-deprecated-mm-dd-yyyy` +- In readme.io, change the current documentation version from `v2018-08-01` to `v2018-08-01-deprecated-mm-dd-yyyy` - Change the name of your new release version from `2018-08-01-{your name}-{pull request number}` to `v2018-08-01` > [!NOTE] Readme.io cache pages for 15 minutes, for only logged out users. If you are logged in, then you will always receive the most recent content. diff --git a/package-lock.json b/package-lock.json index 89e83ad65..b987351eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "version": "1.0.0", "dependencies": { + "colors": "^1.4.0", "dotenv": "^16.3.1", "markdown-it": "^13.0.2", "minimist": "^1.2.8", @@ -105,6 +106,14 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", diff --git a/package.json b/package.json index b23047b4c..077d58609 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,10 @@ "build-md-tables-from-openapi": "ts-node ./scripts/build-md-tables-from-openapi.ts", "readme-fix-reference-docs": "ts-node ./scripts/readme-fix-reference-docs.ts", "remove-stoplight-tags-from-openapi": "ts-node ./scripts/remove-stoplight-tags-from-openapi.ts", - "all": "ts-node ./scripts/index.ts" + "manage-project": "ts-node ./scripts/manage-project.ts" }, "dependencies": { + "colors": "^1.4.0", "dotenv": "^16.3.1", "markdown-it": "^13.0.2", "minimist": "^1.2.8", diff --git a/scripts/index.ts b/scripts/manage-project.ts similarity index 71% rename from scripts/index.ts rename to scripts/manage-project.ts index a22a79ffa..239217d37 100644 --- a/scripts/index.ts +++ b/scripts/manage-project.ts @@ -1,12 +1,18 @@ -import * as fsPromises from "fs/promises"; -import path from "path"; import dotenv from "dotenv"; import minimist from "minimist"; +import colors from "colors"; dotenv.config(); -const { versionTag } = minimist(process.argv.slice(2)); +const options = minimist(process.argv.slice(2)); +const versionTag = options.versionTag || options.vt; +const versionOption = options.version || options.v; + +const cleanOnly = options.cleanOnly || options.co; +const help = options.help || options.h; const mainVersion = "v2018-08-01"; +const version = + versionOption || versionTag ? `${mainVersion}-${versionTag}` : undefined; const listOfGuideCategories = [ "Getting started", @@ -21,13 +27,34 @@ const listOfGuideCategories = [ const listOfReferenceCategories = ["Introduction"]; const main = async () => { - if (!versionTag) { + if (help) { console.log( - "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" + colors.green( + `options:` + + `\n"versionTag" or "vt" for versionTag, for example "npm run manage-project -- --vt=piotr-1234"` + + `\n"version" or "v" for version, for example "npm run manage-project -- --v=v2018-08-01-piotr-1234"` + + `\n"cleanOnly" or "co" for version, for example "npm run manage-project -- --vt=piotr-1234" --co` + + `\n\nuse "versionTag" or "version" for version, not both!` + ) ); return; } - const version = `${mainVersion}-${versionTag}`; + if (!version) { + console.log( + colors.red( + "invalid arguments, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return; + } + if (!cleanOnly) { + await createNewVersion(version); + } + await cleanProject(version); + console.log(colors.green(`\nVisit: https://docs.voucherify.io/${version}/`)); +}; + +const createNewVersion = async (version) => { //create fork try { const response = await fetch( @@ -55,15 +82,14 @@ https://dash.readme.com/api/v1/version`, `Response status: ${response.status}, maybe this versionTag is already used?` ); } - console.log(`FORK CREATED!`); + console.log(colors.green(`FORK CREATED! VERSION "${version}"`)); } catch (error) { - console.log(`Error while creating fork from ${mainVersion}`, error); + console.log(colors.red(`Error while creating fork from ${mainVersion}!`)), + error; throw new Error(error); } }; -const createNewVersion = - const cleanProject = async (version) => { const categoriesToDelete = await getAllCategories(version); //delete all categories @@ -71,13 +97,13 @@ const cleanProject = async (version) => { categoriesToDelete, async (category) => await deleteCategory(version, category.slug) ); - console.log(`OLD CATEGORIES DELETED`); + console.log(colors.green(`OLD CATEGORIES DELETED!`)); //create categories await asyncMap( [...listOfGuideCategories, ...listOfReferenceCategories], async (title) => await createCategory(version, title) ); - console.log(`NEW CATEGORIES CREATED`); + console.log(colors.green(`NEW CATEGORIES CREATED!`)); const allCategories = await getAllCategories(version); //update reference categories types await asyncMap( @@ -89,10 +115,11 @@ const cleanProject = async (version) => { { type: "reference" } ) ); - console.log(`REFERENCE CATEGORIES UPDATED`); + console.log(colors.green(`REFERENCE CATEGORIES UPDATED!`)); const allApiSpecifications = await getAllApiSpecifications(version); await asyncMap(allApiSpecifications, deleteSpecification); - console.log(`API SPECIFICATIONS DELETED`); + console.log(colors.green(`API SPECIFICATIONS DELETED!`)); + console.log(colors.green(`VERSION "${version}" IS CLEANED UP!`)); }; const updateCategory = async (version, slug, data = {}) => { From 21680217b899f5a0348ecafc70b978af1ca92fe2 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:14:00 +0200 Subject: [PATCH 043/108] Update CONTRIBUTING.md --- CONTRIBUTING.md | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a78df7b8..07d5a153b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,25 +107,14 @@ Good practices: ### Development process - For each change / pull request, create your copy of the current documentation, where you will test changes. - - Create your own branch from `master`, - - Create a draft pull request, - - Go to `Manage Versions` page in readme.io - - Click `Add New Version` from top right corner. - - Select the current public version in `Fork from` field, most likely `2018-08-01` - - Type your version name in `Create version` field following the pattern: - `2018-08-01-{your name}-{pull request number}` + - `npm run manage-project -- --vt={your name}-{pull request number}` - Make changes in the repository following patterns and good practices. - Deploy changes to test your documentation: - - Update tables in markdown tables: + - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number}`, choose `Create a new spec` option. Command most likely will fail with the message: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks`, but so far, we see that this operation still works correctly. + - Update tables in mark down tables: - `npm run build-md-tables-from-openapi` - `npm run update-md-tables-in-doc` - - from API Reference page in readme dashboard: - - remove Voucherify OpenAPI Definition - - refresh the page and remove `VOUCHERIFY API` category from left sidebar, DO NOT REMOVE `INTRODUCTION` catregory from left sidebar - the existing OpenAPI file and all specification files. - - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number}`, choose `Create a new spec` option. Command most likely will fail with the message: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks`, but so far, we see that this operation still works correctly. - - Deploy guides pages: `rdme docs ./docs/guides --version=2018-08-01-{your name}-{pull request number}` - - Deploy api reference pages: `rdme docs ./docs/reference-docs --version=2018-08-01-{your name}-{pull request number}` + - Deploy guides and reference pages: `rdme docs ./docs --version=2018-08-01-{your name}-{pull request number}` - Fix docs order: `npm run readme-fix-docs-order -- --version=v2018-08-01-{your name}-{pull request number}` - test changes using preview on readme.io - if changes are fine, then: From 8b5b2e2eca30da62b916301f3dfd4481b23ec4b9 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:39:50 +0200 Subject: [PATCH 044/108] in progress --- CONTRIBUTING.md | 2 +- scripts/build-md-tables-from-openapi.ts | 51 ++++++---- scripts/manage-project.ts | 81 +++++++++++++++- scripts/update-md-tables-in-doc.ts | 120 +++++++++++++----------- 4 files changed, 175 insertions(+), 79 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 07d5a153b..d3c1e7d0c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ Good practices: - `npm run manage-project -- --vt={your name}-{pull request number}` - Make changes in the repository following patterns and good practices. - Deploy changes to test your documentation: - - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number}`, choose `Create a new spec` option. Command most likely will fail with the message: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks`, but so far, we see that this operation still works correctly. + - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number} --create`. - Update tables in mark down tables: - `npm run build-md-tables-from-openapi` - `npm run update-md-tables-in-doc` diff --git a/scripts/build-md-tables-from-openapi.ts b/scripts/build-md-tables-from-openapi.ts index 20c29655e..4adf003c2 100644 --- a/scripts/build-md-tables-from-openapi.ts +++ b/scripts/build-md-tables-from-openapi.ts @@ -1,23 +1,34 @@ -import * as fs from 'fs/promises' -import path from 'path'; -import './globals.t' -import * as openApi from '../reference/OpenAPI.json'; -import { mdTables } from './md-tables'; -import SchemaToMarkdownTable, {RenderMode, ExamplesRenderedAs} from './src/schema-to-md-table'; +import * as fs from "fs/promises"; +import path from "path"; +import "./globals.t"; +import * as openApi from "../reference/OpenAPI.json"; +import { mdTables } from "./md-tables"; +import SchemaToMarkdownTable, { + RenderMode, + ExamplesRenderedAs, +} from "./src/schema-to-md-table"; -const PATH_TO_GERENATED_TABLES = [__dirname, './output']; +const PATH_TO_GERENATED_TABLES = [__dirname, "./output"]; -(async () => { - const stm = new SchemaToMarkdownTable(openApi.components.schemas, RenderMode.List, ExamplesRenderedAs.PartOfDescription); - for(const [objectName] of mdTables){ - try{ - const fileName = `${objectName}.md`; - await fs.writeFile(path.join(...PATH_TO_GERENATED_TABLES, fileName), stm.render(objectName)) - console.log(`Generated markdown table in ${fileName}`) - }catch(e){ - console.log(`Error for ${objectName}`, e) - - } +export const buildMdTablesFromOpenApi = async () => { + const stm = new SchemaToMarkdownTable( + openApi.components.schemas, + RenderMode.List, + ExamplesRenderedAs.PartOfDescription + ); + for (const [objectName] of mdTables) { + try { + const fileName = `${objectName}.md`; + await fs.writeFile( + path.join(...PATH_TO_GERENATED_TABLES, fileName), + stm.render(objectName) + ); + console.log(`Generated markdown table in ${fileName}`); + } catch (e) { + console.log(`Error for ${objectName}`, e); } - console.log('done') -})() \ No newline at end of file + } + console.log("done"); +}; + +buildMdTablesFromOpenApi(); diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 239217d37..9726d38b8 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -1,13 +1,16 @@ import dotenv from "dotenv"; import minimist from "minimist"; import colors from "colors"; +import { exec } from "child_process"; +import { buildMdTablesFromOpenApi } from "./build-md-tables-from-openapi"; +import { updateMdTablesInDoc } from "./update-md-tables-in-doc"; dotenv.config(); const options = minimist(process.argv.slice(2)); const versionTag = options.versionTag || options.vt; const versionOption = options.version || options.v; -const cleanOnly = options.cleanOnly || options.co; +const createNew = options.create || options.c; const help = options.help || options.h; const mainVersion = "v2018-08-01"; @@ -33,8 +36,9 @@ const main = async () => { `options:` + `\n"versionTag" or "vt" for versionTag, for example "npm run manage-project -- --vt=piotr-1234"` + `\n"version" or "v" for version, for example "npm run manage-project -- --v=v2018-08-01-piotr-1234"` + - `\n"cleanOnly" or "co" for version, for example "npm run manage-project -- --vt=piotr-1234" --co` + - `\n\nuse "versionTag" or "version" for version, not both!` + `\n"create" or "c" for version, for example "npm run manage-project -- --vt=piotr-1234" --c` + + `\n\nuse "versionTag" or "version" for version, not both!` + + `\n\nby default, cleans up version (not creates one)` ) ); return; @@ -47,11 +51,78 @@ const main = async () => { ); return; } - if (!cleanOnly) { + if (createNew) { await createNewVersion(version); } await cleanProject(version); - console.log(colors.green(`\nVisit: https://docs.voucherify.io/${version}/`)); + console.log( + colors.green( + "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" + ) + ); + await new Promise((resolve) => { + exec( + `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, + (error, stdout, stderr) => { + if ( + error + ?.toString?.() + ?.includes?.( + `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.` + ) || + stderr + ) { + console.log(colors.green("OPEN API FILE WAS UPLOADED")); + return resolve(true); + } + throw new Error( + error?.toString?.() || "OPEN API FILE WAS NOT UPLOADED" + ); + } + ); + }); + console.log(colors.green("BUILDING MD TABLES FROM OPEN API...")); + await new Promise((resolve) => { + exec(`npm run build-md-tables-from-openapi`, (error, stdout, stderr) => { + if (stderr) { + console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); + return resolve(true); + } + console.log(colors.red(error?.toString?.())); + throw new Error("MD TABLES WERE NOT BUILDED!"); + }); + }); + console.log(colors.green("UPDATING MD TABLES IN DOCS...")); + await new Promise((resolve) => { + exec(`npm run update-md-tables-in-doc`, (error, stdout, stderr) => { + if (stderr) { + console.log( + colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!") + ); + return resolve(true); + } + console.log(colors.red(error?.toString?.())); + throw new Error("MD TABLES WERE NOT UPDATED IN DOCS!"); + }); + }); + console.log(colors.green("UPLOADING GUIDES DOC FILES...")); + await new Promise((resolve) => { + exec( + `rdme docs ./docs/guides --version=${version} --create`, + (error, stdout, stderr) => { + if (stderr) { + console.log(colors.green("GUIDES FILES WERE UPLOADED!")); + return resolve(true); + } + console.log(colors.red(error?.toString?.())); + throw new Error("GUIDES WERE NOT UPLOADED!"); + } + ); + }); + + console.log( + colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) + ); }; const createNewVersion = async (version) => { diff --git a/scripts/update-md-tables-in-doc.ts b/scripts/update-md-tables-in-doc.ts index ba3bc0ee7..8014e3861 100644 --- a/scripts/update-md-tables-in-doc.ts +++ b/scripts/update-md-tables-in-doc.ts @@ -1,56 +1,70 @@ -import * as fs from 'fs/promises' -import path from 'path'; -import { EOL } from 'os'; -import { mdTables } from './md-tables'; - -const PATH_TO_DOCS_REFERENCE = [__dirname, '../docs/reference-docs']; -const PATH_TO_GENERATED_TABLES = [__dirname, './output']; - -const updateMdTablesInDoc = async () => { - for (const [objectName, docFile] of mdTables) { - if (!docFile) { - continue; - } - try { - const docPath = path.join(...PATH_TO_DOCS_REFERENCE, docFile); - const fileContent = await fs.readFile(docPath) - const fileContentBlocks = fileContent - .toString() - .split(/(^---$)|(^\[block\:html\]$)/m) // Split by `---` and [block:html] that surrounds the table - .filter(e => !!e); - - // Find block with table by part of the markdown table syntax - const contentBlockIndexWithTableToReplace = fileContentBlocks.findIndex(block => block.indexOf('|:-----') >= 0) - - if (contentBlockIndexWithTableToReplace < 0) { - throw new Error(`Could not find table to replace in file ${docFile} (object: ${objectName}) `) - } - - const additionalBlockquotes = fileContentBlocks[contentBlockIndexWithTableToReplace].match(/^\>.*$/gm) - - const contentBeforeTable = fileContentBlocks.slice(0, contentBlockIndexWithTableToReplace).join('') - const contentAfterTable = fileContentBlocks.slice(contentBlockIndexWithTableToReplace + 1).join('') - - const newTable = (await fs.readFile(path.join(...PATH_TO_GENERATED_TABLES, `${objectName}.md`))) - .toString(); - // .replace((/^\# .*$/m), ''); // Remove first header as in readme.io it already exists - - const newFileContent = [ - contentBeforeTable, - additionalBlockquotes?.length? additionalBlockquotes.join(EOL) : false, - newTable, - contentAfterTable - ].filter(e => !!e) - .join(`${EOL}${EOL}`) - - await fs.writeFile(docPath, newFileContent) - console.log(`Updated table in ${docFile} `) - } catch (e) { - console.log(`Error for ${objectName}`, e) - - } +import * as fs from "fs/promises"; +import path from "path"; +import { EOL } from "os"; +import { mdTables } from "./md-tables"; + +const PATH_TO_DOCS_REFERENCE = [__dirname, "../docs/reference-docs"]; +const PATH_TO_GENERATED_TABLES = [__dirname, "./output"]; + +export const updateMdTablesInDoc = async () => { + for (const [objectName, docFile] of mdTables) { + if (!docFile) { + continue; + } + try { + const docPath = path.join(...PATH_TO_DOCS_REFERENCE, docFile); + const fileContent = await fs.readFile(docPath); + const fileContentBlocks = fileContent + .toString() + .split(/(^---$)|(^\[block\:html\]$)/m) // Split by `---` and [block:html] that surrounds the table + .filter((e) => !!e); + + // Find block with table by part of the markdown table syntax + const contentBlockIndexWithTableToReplace = fileContentBlocks.findIndex( + (block) => block.indexOf("|:-----") >= 0 + ); + + if (contentBlockIndexWithTableToReplace < 0) { + throw new Error( + `Could not find table to replace in file ${docFile} (object: ${objectName}) ` + ); + } + + const additionalBlockquotes = + fileContentBlocks[contentBlockIndexWithTableToReplace].match( + /^\>.*$/gm + ); + + const contentBeforeTable = fileContentBlocks + .slice(0, contentBlockIndexWithTableToReplace) + .join(""); + const contentAfterTable = fileContentBlocks + .slice(contentBlockIndexWithTableToReplace + 1) + .join(""); + + const newTable = ( + await fs.readFile( + path.join(...PATH_TO_GENERATED_TABLES, `${objectName}.md`) + ) + ).toString(); + // .replace((/^\# .*$/m), ''); // Remove first header as in readme.io it already exists + + const newFileContent = [ + contentBeforeTable, + additionalBlockquotes?.length ? additionalBlockquotes.join(EOL) : false, + newTable, + contentAfterTable, + ] + .filter((e) => !!e) + .join(`${EOL}${EOL}`); + + await fs.writeFile(docPath, newFileContent); + console.log(`Updated table in ${docFile} `); + } catch (e) { + console.log(`Error for ${objectName}`, e); } - console.log('done') -} + } + console.log("done"); +}; updateMdTablesInDoc(); From e7fdec9bf0ef16cb87613102f682541d2dab7f4f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:15:07 +0200 Subject: [PATCH 045/108] Revert "update list gift card transactions" This reverts commit 8960194f456d87febd621e6d49ea5f3f6eb0d9ba. --- Changelog.md | 2 - ...UCHERS-API-List-Gift-Card-Transactions.md} | 4 +- reference/OpenAPI.json | 154316 ++++++++------- 3 files changed, 77195 insertions(+), 77127 deletions(-) rename docs/reference-docs/{VOUCHERS-API-List-Voucher-Transactions.md => VOUCHERS-API-List-Gift-Card-Transactions.md} (85%) diff --git a/Changelog.md b/Changelog.md index addb76030..da4deaaf3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,7 +1,5 @@ # Changelog -# 20231017 -- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions ## 20231012 - Product Collections diff --git a/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md b/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md similarity index 85% rename from docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md rename to docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md index d9c3268fd..0c0946408 100644 --- a/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md +++ b/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md @@ -1,8 +1,8 @@ --- -title: List Voucher Transactions +title: List Gift Card Transactions type: endpoint categorySlug: voucherify-api -slug: list-voucher-transactions +slug: list-gift-card-transactions parentDocSlug: vouchers-api hidden: false order: 11 diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 98178cc31..dae42e817 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3890,8 +3890,8 @@ } } }, - "vouchers_list_transactions_response_body": { - "title": "Get Voucher Transactions Response Body", + "1_res_vouchers_code_transactions": { + "title": "Get Gift Card Transactions Response Body", "type": "object", "description": "List of voucher transactions", "properties": { @@ -3909,58 +3909,36 @@ "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/voucher_transaction" + "$ref": "#/components/schemas/1_obj_gift_card_transaction_object" } }, "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" - ] - }, - "voucher_transaction": { - "title": "Voucher Transaction", - "description": "Voucher transaction object", - "oneOf": [ - { - "$ref": "#/components/schemas/gift_card_transaction", - "x-stoplight": { - "id": "z5j73encc7u23" - } - }, - { - "$ref": "#/components/schemas/LoyaltyCardTransaction", - "x-stoplight": { - "id": "57gaoie3qn3il" - } - } - ] + } }, - "gift_card_transaction": { - "title": "Gift Card Transaction", + "1_obj_gift_card_transaction_object": { + "title": "Gift Card Transaction Object", "description": "Gift card transaction object", - "allOf": [ + "anyOf": [ { - "$ref": "#/components/schemas/gift_card_transaction_identity" + "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_redemption" }, { - "$ref": "#/components/schemas/gift_card_transaction_base" + "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_refund" }, { - "$ref": "#/components/schemas/gift_card_transaction_response_data" + "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_addition" }, { - "$ref": "#/components/schemas/gift_card_transaction_details" + "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_removal" } ] }, - "gift_card_transaction_identity": { + "1_obj_gift_card_transaction_object_redemption": { + "title": "Redemption", + "description": "When credits are used to pay for an order.", "type": "object", "properties": { "id": { @@ -3969,96 +3947,19 @@ "example": "vtx_0c9dccc4d5813e71bd" }, "source_id": { - "type": [ - "string", - "null" - ], + "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. In case of a redemption, this value is `null`." - } - }, - "required": [ - "id", - "source_id" - ], - "title": "Gift Card Transaction Base" - }, - "gift_card_transaction_base": { - "type": "object", - "properties": { + }, "voucher_id": { "type": "string", "description": "Unique voucher ID.", "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" }, "campaign_id": { - "type": [ - "string", - "null" - ], + "type": "string", "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" }, - "related_transaction_id": { - "type": [ - "string", - "null" - ], - "description": "This field is `null` in the case of gift voucher transactions." - }, - "reason": { - "type": [ - "string", - "null" - ], - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - } - }, - "required": [ - "voucher_id", - "campaign_id", - "related_transaction_id", - "reason" - ], - "title": "Gift Card Transaction Base" - }, - "gift_card_transaction_response_data": { - "type": "object", - "title": "Gift Card Transaction Response Data", - "properties": { - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - }, - "required": [ - "created_at" - ] - }, - "gift_card_transaction_details": { - "title": "Gift Card Transaction Details", - "anyOf": [ - { - "$ref": "#/components/schemas/gift_card_transaction_redemption_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_refund_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_addition_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_removal_details" - } - ], - "type": "object" - }, - "gift_card_transaction_redemption_details": { - "title": "Redemption", - "description": "When credits are used to pay for an order.", - "type": "object", - "properties": { "source": { "type": "string", "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`.", @@ -4067,6 +3968,10 @@ "API" ] }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." + }, "type": { "type": "string", "description": "Type of transaction.", @@ -4150,1685 +4055,2028 @@ } } } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } - }, - "gift_card_transaction_refund_details": { - "title": "Refund", - "description": "When funds are credited back to a card through a redemption rollback.", - "type": "object", - "properties": { - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_REFUND", - "enum": [ - "CREDITS_REFUND" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is added back to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } + } + }, + "1_obj_gift_card_transaction_object_refund": { + "title": "Refund", + "description": "When funds are credited back to a card through a redemption rollback.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a redemption rollback, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a redemption rollback, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_REFUND", + "enum": [ + "CREDITS_REFUND" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" + }, + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is added back to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } + } + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" } - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID.", - "example": "rr_0c94edbb8d0bef5d9e" - } + } + }, + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID.", + "example": "rr_0c94edbb8d0bef5d9e" } } } } }, - "gift_card_transaction_addition_details": { - "title": "Addition", - "description": "When funds are deposited to a gift card.", + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_gift_card_transaction_object_addition": { + "title": "Addition", + "description": "When funds are deposited to a gift card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_ADDITION", + "enum": [ + "CREDITS_ADDITION" + ] + }, + "details": { "type": "object", + "description": "Contains the detailed information about the transaction.", "properties": { - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_ADDITION", - "enum": [ - "CREDITS_ADDITION" - ] - }, - "details": { + "balance": { "type": "object", - "description": "Contains the detailed information about the transaction.", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" + }, + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", + "description": "Defines the resource that is being modified with the values that are returned in the balance object.", "properties": { - "type": { + "id": { "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, - "object": { + "type": { "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, - "gift_card_transaction_removal_details": { - "title": "Removal", - "description": "When funds are removed from a gift card.", + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_gift_card_transaction_object_removal": { + "title": "Removal", + "description": "When funds are removed from a gift card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "CREDITS_REMOVAL", + "enum": [ + "CREDITS_REMOVAL" + ] + }, + "details": { "type": "object", + "description": "Contains the detailed information about the transaction.", "properties": { - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "CREDITS_REMOVAL", - "enum": [ - "CREDITS_REMOVAL" - ] - }, - "details": { + "balance": { "type": "object", - "description": "Contains the detailed information about the transaction.", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "gift_voucher" + }, + "total": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "amount": { + "type": "integer", + "description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "related_object": { "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", + "description": "Defines the resource that is being modified with the values that are returned in the balance object.", "properties": { - "type": { + "id": { "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" - }, - "total": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "amount": { - "type": "integer", - "description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, - "object": { + "type": { "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the amount is subtracted from the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } } } - }, - "1_req_create_gift_card_transactions_export": { - "type": "object", - "title": "Create Gift Card Transactions Export Request Body", - "description": "Request body schema for **POST** `/vouchers/transactions/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/1_obj_export_gift_card_transactions", - "description": "Contains the parameters that define the data to be exported." - } - } - }, - "1_obj_export_gift_card_transactions": { - "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "items": { - "type": "string" - } - } + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_req_create_gift_card_transactions_export": { + "type": "object", + "title": "Create Gift Card Transactions Export Request Body", + "description": "Request body schema for **POST** `/vouchers/transactions/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/1_obj_export_gift_card_transactions", + "description": "Contains the parameters that define the data to be exported." + } + } + }, + "1_obj_export_gift_card_transactions": { + "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", + "title": "Export Transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "items": { + "type": "string" + } + } + } + }, + "1_obj_export_transactions_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "default": "API" + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "default": "voucher_transactions" + }, + "parameters": { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + "result": { + "type": "object", + "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](ref:download-export) method." } + } + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } + } + }, + "1_req_vouchers_import": { + "title": "Import Vouchers Request Body", + "type": "array", + "description": "Request body schema for **POST** `/vouchers/import`.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_vouchers_import_gift_voucher" }, - "1_obj_export_transactions_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "default": "API" - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "default": "voucher_transactions" - }, - "parameters": { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - "result": { - "type": "object", - "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](ref:download-export) method." - } - } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" - } + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_voucher" + } + ] + } + }, + "1_obj_vouchers_import_gift_voucher": { + "title": "Import Gift Voucher", + "type": "object", + "description": "Object model for gift voucher object being imported.", + "properties": { + "code": { + "type": "string", + "description": "Value representing the imported code." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "type": { + "type": "string", + "description": "Represents the voucher type. ", + "default": "GIFT_VOUCHER" + }, + "gift": { + "type": "object", + "properties": { + "amount": { + "type": "string", + "description": "Total gift card income. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } }, - "1_req_vouchers_import": { - "title": "Import Vouchers Request Body", - "type": "array", - "description": "Request body schema for **POST** `/vouchers/import`.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_vouchers_import_gift_voucher" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_voucher" - } - ] + "required": [ + "amount" + ] + }, + "start_date": { + "type": "string", + "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2020-12-28T12:49:16.272Z" + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2053-12-28T12:49:16.272Z" + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", + "example": 10 } - }, - "1_obj_vouchers_import_gift_voucher": { - "title": "Import Gift Voucher", - "type": "object", - "description": "Object model for gift voucher object being imported.", - "properties": { - "code": { - "type": "string", - "description": "Value representing the imported code." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "type": { - "type": "string", - "description": "Represents the voucher type. ", - "default": "GIFT_VOUCHER" - }, - "gift": { - "type": "object", - "properties": { - "amount": { - "type": "string", - "description": "Total gift card income. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - } - }, - "required": [ - "amount" - ] - }, - "start_date": { - "type": "string", - "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2020-12-28T12:49:16.272Z" - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed date formats are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2053-12-28T12:49:16.272Z" - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", - "example": 10 - } - } + } + }, + "additional_info": { + "type": "string", + "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." + } + }, + "required": [ + "code" + ] + }, + "1_obj_vouchers_import_discount_voucher": { + "title": "Import Discount Voucher", + "type": "object", + "description": "Object model for discount voucher object being imported.", + "properties": { + "code": { + "type": "string", + "description": "Value representing the imported code." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "type": { + "type": "string", + "description": "Represents the voucher type.", + "default": "DISCOUNT_VOUCHER" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_vouchers_import_discount_shipping" + } + ] + }, + "start_date": { + "type": "string", + "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2020-12-28T12:49:16.272Z" + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", + "format": "date-time", + "example": "2053-12-28T12:49:16.272Z" + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", + "example": 10 + } + } + }, + "additional_info": { + "type": "string", + "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." + } + }, + "required": [ + "code" + ] + }, + "1_req_vouchers_importCSV": { + "type": "object", + "title": "Import Vouchers by CSV Request Body", + "description": "Request body schema for `vouchers/importCSV`.", + "format": "binary", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "The property name 'file' will be used for the file path." + } + } + }, + "1_res_vouchers_qualification": { + "title": "Vouchers Qualification Response Body", + "type": "object", + "description": "Response body schema for vouchers/qualification", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. Default is `list`." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of qualified vouchers." + }, + "data": { + "type": "array", + "description": "Array of qualified vouchers.", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object" }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." + { + "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_applicable_to" }, - "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." + { + "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_inapplicable_to" } - }, - "required": [ - "code" ] + } + }, + "total": { + "type": "integer", + "example": 37, + "description": "Total valid and active vouchers matching the qualification criteria in given context. " + }, + "id": { + "type": "string", + "example": "qfl_nAMVLoxIqSLh9O6YmfoAXRPG", + "description": "Unique qualification ID." + }, + "created_at": { + "type": "string", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", + "format": "date-time" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + } + } + }, + "1_res_obj_vouchers_qualification_applicable_to": { + "title": "ApplicableToObject", + "type": "object", + "description": "", + "properties": { + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + } + } + }, + "1_res_obj_vouchers_qualification_inapplicable_to": { + "title": "InapplicableToObject", + "type": "object", + "properties": { + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + } + } + }, + "1_req_vouchers_bulk_async": { + "title": "Vouchers Bulk Async Request Body", + "type": "array", + "description": "Array of objects each containing the code to be updated and the metadata object containing the key/value pairs to be updated.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." }, - "1_obj_vouchers_import_discount_voucher": { - "title": "Import Discount Voucher", + "metadata": { "type": "object", - "description": "Object model for discount voucher object being imported.", - "properties": { - "code": { - "type": "string", - "description": "Value representing the imported code." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the [List Vouchers](ref:list-vouchers) endpoint." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "type": { - "type": "string", - "description": "Represents the voucher type.", - "default": "DISCOUNT_VOUCHER" - }, - "discount": { + "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." + } + } + } + }, + "1_req_vouchers_qualification": { + "title": "Vouchers Qualification Request Body", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "order": { + "type": "object", + "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", + "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" + }, + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "amount": { + "type": "integer", + "minimum": 0, + "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the total order amount or the amount of each item individually in the request body to check against vouchers requiring specific total order amount validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_ \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity.", + "items": { "anyOf": [ { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_percentage" + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" }, { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_fixed" + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" }, { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_one" + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_product_id" }, { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_vouchers_import_discount_shipping" + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_source_id" } ] - }, - "start_date": { - "type": "string", - "description": "Activation timestamp in ISO 8601 format. Voucher is *inactive before* this date. Start date defines when the code starts to be active.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2020-12-28T12:49:16.272Z" - }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is *inactive after* this date.\nAllowed formats of dates are:\n- YYYY-MM-DD\n- YYYY-MM-DDTHH\n- YYYY-MM-DDTHH:mm\n- YYYY-MM-DDTHH:mm:ss\n- YYYY-MM-DDTHH:mm:ssZ\n- YYYY-MM-DDTHH:mm:ss.SSSZ", - "format": "date-time", - "example": "2053-12-28T12:49:16.272Z" - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited.", - "example": 10 - } - } - }, - "additional_info": { - "type": "string", - "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." } }, - "required": [ - "code" - ] - }, - "1_req_vouchers_importCSV": { - "type": "object", - "title": "Import Vouchers by CSV Request Body", - "description": "Request body schema for `vouchers/importCSV`.", - "format": "binary", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "The property name 'file' will be used for the file path." - } - } - }, - "1_res_vouchers_qualification": { - "title": "Vouchers Qualification Response Body", - "type": "object", - "description": "Response body schema for vouchers/qualification", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. Default is `list`." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of qualified vouchers." - }, - "data": { - "type": "array", - "description": "Array of qualified vouchers.", - "items": { - "allOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - { - "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_applicable_to" - }, - { - "$ref": "#/components/schemas/1_res_obj_vouchers_qualification_inapplicable_to" - } - ] - } - }, - "total": { - "type": "integer", - "example": 37, - "description": "Total valid and active vouchers matching the qualification criteria in given context. " - }, - "id": { - "type": "string", - "example": "qfl_nAMVLoxIqSLh9O6YmfoAXRPG", - "description": "Unique qualification ID." - }, - "created_at": { - "type": "string", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", - "format": "date-time" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - } - } - }, - "1_res_obj_vouchers_qualification_applicable_to": { - "title": "ApplicableToObject", - "type": "object", - "description": "", - "properties": { - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - } + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": "object" + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_res_obj_vouchers_qualification_inapplicable_to": { - "title": "InapplicableToObject", - "type": "object", - "properties": { - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - } + } + }, + "reward": { + "type": "object", + "properties": { + "points": { + "type": "integer" + }, + "assignment_id": { + "type": "string" + }, + "id": { + "type": "string" } - }, - "1_req_vouchers_bulk_async": { - "title": "Vouchers Bulk Async Request Body", - "type": "array", - "description": "Array of objects each containing the code to be updated and the metadata object containing the key/value pairs to be updated.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "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." - } - } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "1_req_obj_vouchers_qualification_customer": { + "title": "Customer Object", + "type": "object", + "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": "string", + "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", + "example": "firstname.lastname@mycompany.com" + }, + "name": { + "type": "string", + "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", + "example": "FirstName LastName" + }, + "email": { + "type": "string", + "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", + "example": "firstname.lastname@mycompany.com" + }, + "phone": { + "type": "string", + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]", + "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." + }, + "address": { + "type": "object", + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", + "properties": { + "city": { + "type": "string", + "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", + "example": "New York" + }, + "country": { + "type": "string", + "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", + "example": "United States of America" + }, + "postal_code": { + "type": "string", + "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", + "example": "10001" + }, + "state": { + "type": "string", + "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", + "example": "NY" } - }, - "1_req_vouchers_qualification": { - "title": "Vouchers Qualification Request Body", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "order": { - "type": "object", - "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", - "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" - }, - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "amount": { - "type": "integer", - "minimum": 0, - "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the total order amount or the amount of each item individually in the request body to check against vouchers requiring specific total order amount validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_ \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" - }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" - }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_product_id" - }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product_using_source_id" - } - ] - } - }, - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": "object" - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "reward": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "assignment_id": { - "type": "string" - }, - "id": { - "type": "string" - } - } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "birthdate": { + "type": "string", + "example": "2022-01-01", + "format": "date", + "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied." + } + } + }, + "1_req_obj_vouchers_qualification_product": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_req_obj_vouchers_qualification_customer": { - "title": "Customer Object", - "type": "object", - "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](https://docs.voucherify.io/reference/create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": "string", - "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", - "example": "firstname.lastname@mycompany.com" - }, - "name": { - "type": "string", - "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", - "example": "FirstName LastName" - }, - "email": { - "type": "string", - "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", - "example": "firstname.lastname@mycompany.com" - }, - "phone": { - "type": "string", - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]", - "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." - }, - "address": { - "type": "object", - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", - "properties": { - "city": { - "type": "string", - "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", - "example": "New York" - }, - "country": { - "type": "string", - "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", - "example": "United States of America" - }, - "postal_code": { - "type": "string", - "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", - "example": "10001" - }, - "state": { - "type": "string", - "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", - "example": "NY" - } - } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "birthdate": { - "type": "string", - "example": "2022-01-01", - "format": "date", - "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied." - } + } + } + } + }, + "1_req_obj_vouchers_qualification_product_using_product_id": { + "title": "Product Item using product_id", + "type": "object", + "description": "Schema model for a product item sent using the `product_id`. \n\nYou can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. \nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. Even if this price is explicitly provided, it will not override the `price` when running qualifications against _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select/create a product collection filtered by a Price_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_req_obj_vouchers_qualification_product": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } + } + } + } + }, + "1_req_obj_vouchers_qualification_product_using_source_id": { + "title": "Product Item using source_id", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": "string", + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_req_obj_vouchers_qualification_product_using_product_id": { - "title": "Product Item using product_id", - "type": "object", - "description": "Schema model for a product item sent using the `product_id`. \n\nYou can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. \nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. Even if this price is explicitly provided, it will not override the `price` when running qualifications against _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select/create a product collection filtered by a Price_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } + } + } + }, + "required": [ + "source_id", + "related_object" + ] + }, + "1_req_obj_vouchers_qualification_product-copy-2-use-for-other-objects-as-reference": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "product_id": { + "type": "string", + "description": "A unique identifier that represents the product and is assigned by Voucherify.", + "example": "prod_0a9f9aeddb019a42db" + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "price": { + "type": "integer", + "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "related_object": { + "type": "string", + "enum": [ + "product" + ], + "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", + "example": "Phone" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used to store the product in the system. If product does not exist, it will be created with the use of `source_id`." } - }, - "1_req_obj_vouchers_qualification_product_using_source_id": { - "title": "Product Item using source_id", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - } + } + } + } + }, + "1_req_obj_vouchers_qualification_sku": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "sku_id": { + "type": "string", + "example": "sku_0a41e31c7b41c28358", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "amount": { + "type": "integer", + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", + "example": 10000 + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "related_object": { + "type": "string", + "enum": [ + "product", + "sku" + ], + "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": "object", + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" }, - "required": [ - "source_id", - "related_object" - ] - }, - "1_req_obj_vouchers_qualification_product-copy-2-use-for-other-objects-as-reference": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If product does not exist, it will be created with the use of `source_id`." - } - } - } + "name": { + "type": "string", + "description": "Product name.", + "example": "Phone" + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_req_obj_vouchers_qualification_sku": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "sku_id": { - "type": "string", - "example": "sku_0a41e31c7b41c28358", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "amount": { - "type": "integer", - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "related_object": { - "type": "string", - "enum": [ - "product", - "sku" - ], - "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": "object", - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": "string", - "description": "Product name.", - "example": "Phone" - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "sku": { - "type": "object", - "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": "string", - "description": "A unique SKU identifier from your inventory system.", - "example": "sku_1234" - }, - "sku": { - "type": "string", - "description": "SKU name.", - "example": "iPhone 12" - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a SKU." - } - } - } + } + }, + "sku": { + "type": "object", + "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": "string", + "description": "A unique SKU identifier from your inventory system.", + "example": "sku_1234" + }, + "sku": { + "type": "string", + "description": "SKU name.", + "example": "iPhone 12" + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a SKU." } - }, - "1_req_obj_vouchers_qualification_sku-copy-2_forfuturereference": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "sku_id": { - "type": [ - "string", - "null" - ], - "example": "sku_0a41e31c7b41c28358", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", - "example": 10000 - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If the product does not exist, it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique SKU identifier from your inventory system.", - "example": "sku_1234" - }, - "sku": { - "type": [ - "string", - "null" - ], - "description": "SKU name.", - "example": "iPhone 12" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of custom key/value pairs that you can attach to a SKU." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist, it will be created with the use of `source_id`. If a SKU does not exist, it's required to set `product_id` that it belongs to." - } + } + } + } + }, + "1_req_obj_vouchers_qualification_sku-copy-2_forfuturereference": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": "product_1234" + }, + "sku_id": { + "type": [ + "string", + "null" + ], + "example": "sku_0a41e31c7b41c28358", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", + "example": 10000 + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", + "example": 1 + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ], + "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique product identifier from your inventory system.", + "example": "product_1234" + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "Product name.", + "example": "Phone" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used to store the product in the system. If the product does not exist, it will be created with the use of `source_id`." + } + } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "properties": { + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique SKU identifier from your inventory system.", + "example": "sku_1234" + }, + "sku": { + "type": [ + "string", + "null" + ], + "description": "SKU name.", + "example": "iPhone 12" + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of custom key/value pairs that you can attach to a SKU." + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exist, it will be created with the use of `source_id`. If a SKU does not exist, it's required to set `product_id` that it belongs to." + } + } + } + } + }, + "1_req_obj_vouchers_qualification_sku-copy": { + "title": "SKU Item", + "type": "object", + "description": "Schema model for a SKU item.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce, a database or a 3rd-party service." + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ] + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]" + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart." + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "integer", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exist it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } + } + } + }, + "1_req_vouchers_qualification_copy_for_reverting_changes": { + "title": "Vouchers Qualification Request Body", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", + "example": "firstname.lastname@mycompany.com" + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", + "example": "FirstName LastName" + }, + "email": { + "type": [ + "string", + "null" + ], + "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", + "example": "firstname.lastname@mycompany.com" + }, + "phone": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]", + "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." + }, + "address": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", + "properties": { + "city": { + "type": [ + "string", + "null" + ], + "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", + "example": "New York" + }, + "country": { + "type": [ + "string", + "null" + ], + "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", + "example": "United States of America" + }, + "postal_code": { + "type": [ + "string", + "null" + ], + "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", + "example": "10001" + }, + "state": { + "type": [ + "string", + "null" + ], + "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", + "example": "NY" } } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "format": "date", + "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied, i.e. `YYYY-MM-DD`." } - }, - "1_req_obj_vouchers_qualification_sku-copy": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce, a database or a 3rd-party service." - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ] - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]" - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] + } + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", + "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the amount in the request body to check against vouchers requiring specific order amount validation rules to be satisfied. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", + "example": 10000 + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity. Read more about the [order item object] (hyperlink the Order Item Object).\n", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" } - } + ] } + }, + "customer": { + "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - }, - "1_req_vouchers_qualification_copy_for_reverting_changes": { - "title": "Vouchers Qualification Request Body", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", - "example": "firstname.lastname@mycompany.com" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", - "example": "FirstName LastName" - }, - "email": { - "type": [ - "string", - "null" - ], - "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", - "example": "firstname.lastname@mycompany.com" - }, - "phone": { - "type": [ - "string", - "null" - ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]", - "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", - "properties": { - "city": { - "type": [ - "string", - "null" - ], - "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", - "example": "New York" - }, - "country": { - "type": [ - "string", - "null" - ], - "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", - "example": "United States of America" - }, - "postal_code": { - "type": [ - "string", - "null" - ], - "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", - "example": "10001" - }, - "state": { - "type": [ - "string", - "null" - ], - "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", - "example": "NY" - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "format": "date", - "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied, i.e. `YYYY-MM-DD`." - } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", - "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the amount in the request body to check against vouchers requiring specific order amount validation rules to be satisfied. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity. Read more about the [order item object] (hyperlink the Order Item Object).\n", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" - }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" - } - ] - } - }, - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "1_req_obj_vouchers_qualification_product-copy": { + "title": "Product Item", + "type": "object", + "description": "Schema model for a product item.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "Product/SKU reference ID" + }, + "product_id": { + "type": [ + "string", + "null" + ] + }, + "sku_id": { + "type": [ + "string", + "null" + ] + }, + "related_object": { + "type": [ + "string", + "null" + ], + "enum": [ + "product", + "sku" + ] + }, + "amount": { + "type": [ + "integer", + "null" + ], + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." + }, + "quantity": { + "type": [ + "integer", + "null" + ], + "description": "Quantity of the item in the cart." + }, + "price": { + "type": [ + "integer", + "null" + ], + "description": "Unit price of an item" + }, + "product": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related product. These details will be used for validation and redemption processes on top of details already stored in the system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "name": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "integer", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ] + } + } + }, + "sku": { + "type": [ + "object", + "null" + ], + "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } + } + } + }, + "1_req_vouchers_qualification-prepforcampaignqualification": { + "title": "RequestBodyVouchersQualification", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details.", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "First and Last Name" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ], + "minLength": 1, + "maxLength": 30, + "pattern": "^[-+.() 0-9]" + }, + "address": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address.", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "postal_code": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate, i.e. `YYYY-MM-DD`.", + "format": "date" } - }, - "1_req_obj_vouchers_qualification_product-copy": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ] - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { + } + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions.", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order that will be linked to redemption in this request." + }, + "status": { + "type": [ + "string", + "null" + ], + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "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." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", + "items": { "type": [ "object", "null" ], - "description": "An object containing details of the related product. These details will be used for validation and redemption processes on top of details already stored in the system.", "properties": { "id": { "type": [ @@ -5840,203 +6088,444 @@ "type": [ "string", "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] + ], + "description": "Product/SKU reference ID" }, - "source_id": { + "product_id": { "type": [ "string", "null" ] }, - "sku": { + "sku_id": { "type": [ "string", "null" ] }, - "price": { + "related_object": { "type": [ "string", "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] + ], + "enum": [ + "product", + "sku" + ], + "description": "Allowed values: `product`, `sku`" }, - "override": { + "amount": { "type": [ - "boolean", + "integer", "null" ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - }, - "1_req_vouchers_qualification-prepforcampaignqualification": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." }, - "source_id": { + "discount_amount": { "type": [ - "string", + "integer", "null" ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." + "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "name": { + "quantity": { "type": [ - "string", + "integer", "null" - ], - "description": "First and Last Name" + ] }, - "email": { + "discount_quantity": { "type": [ - "string", + "integer", "null" - ] + ], + "description": "number of items being discounted\t" }, - "phone": { + "price": { "type": [ - "string", + "integer", "null" ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]" + "description": "Unit price of an item" }, - "address": { + "product": { "type": [ "object", "null" ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", + "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", "properties": { - "city": { + "id": { "type": [ "string", "null" ] }, - "country": { + "source_id": { "type": [ "string", "null" ] }, - "postal_code": { + "name": { "type": [ "string", "null" ] }, - "state": { + "price": { "type": [ - "string", + "null", + "integer" + ] + }, + "metadata": { + "type": [ + "object", "null" ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." } } }, - "metadata": { + "sku": { "type": [ "object", "null" ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate, i.e. `YYYY-MM-DD`.", - "format": "date" + "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", + "properties": { + "id": { + "type": [ + "string", + "null" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ] + }, + "sku": { + "type": [ + "string", + "null" + ] + }, + "price": { + "type": [ + "string", + "null" + ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." + } + } } } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ + } + }, + "customer": { + "type": [ + "object", + "null" + ], + "description": "The customer used for the order." + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ] + } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." + } + } + }, + "1_req_vouchers_qualification-copy": { + "title": "RequestBodyVouchersQualification", + "type": "object", + "description": "Request body schema for /vouchers/qualification.", + "properties": { + "customer": { + "type": [ + "object", + "null" + ], + "description": "This object stores customer details.", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + }, + "source_id": { + "type": [ + "string", + "null" + ], + "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "First and Last Name" + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.\t" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "phone": { + "type": [ + "string", + "null" + ] + }, + "address": { + "type": [ + "object", + "null" + ], + "additionalProperties": false, + "description": "A set of key/value pairs which describes the address.", + "properties": { + "city": { + "type": [ + "string", + "null" + ] + }, + "country": { + "type": [ + "string", + "null" + ] + }, + "line_1": { + "type": [ + "string", + "null" + ] + }, + "line_2": { + "type": [ + "string", + "null" + ] + }, + "postal_code": { + "type": [ + "string", + "null" + ] + }, + "state": { + "type": [ + "string", + "null" + ] + } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." + }, + "email_unsubscribed": { + "type": [ + "boolean", + "null" + ] + }, + "birthday": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate.", + "format": "date", + "example": "2022-03-07" + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate", + "example": "2022-03-07", + "format": "date" + }, + "customer_landing_page": { + "type": [ + "object", + "null" + ], + "properties": { + "custom_event": { + "type": [ + "object", + "null" + ] + }, + "consents": { + "type": [ + "object", + "null" + ] + }, + "publication_id": { + "type": [ + "string", + "null" + ] + }, + "voucher_code": { + "type": [ + "string", + "null" + ] + } + } + }, + "created_at": { + "type": "string" + } + } + }, + "order": { + "type": [ + "object", + "null" + ], + "description": "Tracks purchase transactions.", + "properties": { + "id": { + "type": [ + "string", + "null" + ], + "description": "The ID of an existing order that will be linked to redemption in this request." + }, + "status": { + "type": [ + "string", + "null" + ], + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "source_id": { + "type": [ + "string", + "null" + ], + "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." + }, + "amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "discount_amount": { + "type": [ + "integer", + "null" + ], + "minimum": 0, + "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "items": { + "type": "array", + "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", + "items": { + "type": [ + "object", + "null" + ], + "properties": { + "id": { + "type": [ "string", "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" ] }, "source_id": { @@ -6044,37284 +6533,36814 @@ "string", "null" ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { - "type": [ - "object", - "null" - ], - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "quantity": { - "type": [ - "integer", - "null" - ] - }, - "discount_quantity": { - "type": [ - "integer", - "null" - ], - "description": "number of items being discounted\t" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] + "description": "Product/SKU reference ID" }, - "metadata": { + "product_id": { "type": [ "string", "null" ] - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] }, - "assignment_id": { + "sku_id": { "type": [ "string", "null" ] }, - "id": { + "related_object": { "type": [ "string", "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - } - } - }, - "1_req_vouchers_qualification-copy": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + ], + "enum": [ + "product", + "sku" + ], + "description": "Allowed values: `product`, `sku`" }, - "source_id": { + "amount": { "type": [ - "string", + "integer", "null" ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." + "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." }, - "name": { + "discount_amount": { "type": [ - "string", + "integer", "null" ], - "description": "First and Last Name" + "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "description": { + "quantity": { "type": [ - "string", + "integer", "null" - ], - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.\t" + ] }, - "email": { + "discount_quantity": { "type": [ - "string", + "integer", "null" - ] + ], + "description": "number of items being discounted\t" }, - "phone": { + "price": { "type": [ - "string", + "integer", "null" - ] + ], + "description": "Unit price of an item" }, - "address": { + "product": { "type": [ "object", "null" ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", + "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", "properties": { - "city": { + "id": { "type": [ "string", "null" ] }, - "country": { + "source_id": { "type": [ "string", "null" ] }, - "line_1": { + "name": { "type": [ "string", "null" ] }, - "line_2": { + "price": { "type": [ - "string", - "null" + "null", + "integer" ] }, - "postal_code": { + "metadata": { "type": [ - "string", + "object", "null" ] }, - "state": { + "override": { "type": [ - "string", + "boolean", "null" - ] + ], + "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." } } }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "email_unsubscribed": { - "type": [ - "boolean", - "null" - ] - }, - "birthday": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate.", - "format": "date", - "example": "2022-03-07" - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate", - "example": "2022-03-07", - "format": "date" - }, - "customer_landing_page": { + "sku": { "type": [ "object", "null" ], + "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", "properties": { - "custom_event": { + "id": { "type": [ - "object", + "string", "null" ] }, - "consents": { + "source_id": { "type": [ - "object", + "string", "null" ] }, - "publication_id": { + "sku": { "type": [ "string", "null" ] }, - "voucher_code": { + "price": { "type": [ "string", "null" ] + }, + "metadata": { + "type": [ + "object", + "null" + ] + }, + "override": { + "type": [ + "boolean", + "null" + ], + "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." } } - }, - "created_at": { - "type": "string" } } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ - "string", - "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { - "type": [ - "object", - "null" - ], - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "quantity": { - "type": [ - "integer", - "null" - ] - }, - "discount_quantity": { - "type": [ - "integer", - "null" - ], - "description": "number of items being discounted\t" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ] - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - }, - "gift": { - "type": [ - "object", - "null" - ], - "properties": { - "credits": { - "type": [ - "number", - "null" - ] - } - } - }, - "session": { - "type": [ - "object", - "null" - ], - "properties": { - "key": { - "type": [ - "string", - "null" - ], - "description": "Unique session identifier assigned by the Voucherify API." - }, - "type": { - "type": [ - "string", - "null" - ], - "enum": [ - "COUNT_PER_CUSTOMER", - "ORDER", - "LOCK" - ], - "description": "The type of session. Required to establish a new session. \n\n`LOCK`: Locks the following parameters within the session:\n\n- redemption quantity by 1\n- redemption gift credits specified with the requests\n- redemption loyalty points specified with the request" - }, - "ttl": { - "type": [ - "number", - "null" - ], - "description": "Value for the period of time that the session is active. Units for this parameter are defined by `session.ttl_unit`." - }, - "ttl_unit": { - "type": [ - "string", - "null" - ], - "enum": [ - "DAYS", - "HOURS", - "MICROSECONDS", - "MILLISECONDS", - "MINUTES", - "NANOSECONDS", - "SECONDS" - ], - "description": "Defines the type of unit in which the session time is counted." - } - } - }, - "tracking_id": { - "type": [ - "string", - "null" - ], - "maxLength": 2500, - "example": "track_fxEMFisanb7t4l96X8WKcemyGNPnHpGM3KTfUsqZGCOx/p57/J2+Yw==", - "description": "A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation. This is a hashed customer source ID." } + }, + "customer": { + "type": [ + "object", + "null" + ], + "description": "The customer used for the order." + }, + "referrer": { + "description": "The person who referred the customer to make the order.", + "type": [ + "object", + "null" + ] + }, + "metadata": { + "type": [ + "string", + "null" + ] } - }, - "1_req_obj_vouchers_qualification_order": { - "title": "OrderObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } + } + }, + "reward": { + "type": [ + "object", + "null" + ], + "properties": { + "points": { + "type": [ + "number", + "null" + ] + }, + "assignment_id": { + "type": [ + "string", + "null" + ] + }, + "id": { + "type": [ + "string", + "null" + ] } - }, - "1_req_obj_vouchers_qualification_reward": { - "title": "RewardObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } + } + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." + }, + "gift": { + "type": [ + "object", + "null" + ], + "properties": { + "credits": { + "type": [ + "number", + "null" + ] } - }, - "0_obj_metadata": { - "title": "MetadataObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } + } + }, + "session": { + "type": [ + "object", + "null" + ], + "properties": { + "key": { + "type": [ + "string", + "null" + ], + "description": "Unique session identifier assigned by the Voucherify API." + }, + "type": { + "type": [ + "string", + "null" + ], + "enum": [ + "COUNT_PER_CUSTOMER", + "ORDER", + "LOCK" + ], + "description": "The type of session. Required to establish a new session. \n\n`LOCK`: Locks the following parameters within the session:\n\n- redemption quantity by 1\n- redemption gift credits specified with the requests\n- redemption loyalty points specified with the request" + }, + "ttl": { + "type": [ + "number", + "null" + ], + "description": "Value for the period of time that the session is active. Units for this parameter are defined by `session.ttl_unit`." + }, + "ttl_unit": { + "type": [ + "string", + "null" + ], + "enum": [ + "DAYS", + "HOURS", + "MICROSECONDS", + "MILLISECONDS", + "MINUTES", + "NANOSECONDS", + "SECONDS" + ], + "description": "Defines the type of unit in which the session time is counted." } - }, - "res_empty_json": { - "type": "object", - "description": "Schema model for an empty json.", - "title": "Empty JSON", - "examples": [ - {} - ] - }, - "2_obj_campaign_object": { - "type": "object", - "title": "Campaign Object", - "description": "This is an object representing a campaign.", - "x-tags": [ - "CAMPAIGNS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM", - "GIFT_VOUCHERS", - "DISCOUNT_COUPONS", - "PROMOTION", - "REFERRAL_PROGRAM", - "LUCKY_DRAW" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + } + }, + "tracking_id": { + "type": [ + "string", + "null" + ], + "maxLength": 2500, + "example": "track_fxEMFisanb7t4l96X8WKcemyGNPnHpGM3KTfUsqZGCOx/p57/J2+Yw==", + "description": "A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation. This is a hashed customer source ID." + } + } + }, + "1_req_obj_vouchers_qualification_order": { + "title": "OrderObject", + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "1_req_obj_vouchers_qualification_reward": { + "title": "RewardObject", + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "0_obj_metadata": { + "title": "MetadataObject", + "type": "object", + "properties": { + "id": { + "type": "string" + } + } + }, + "res_empty_json": { + "type": "object", + "description": "Schema model for an empty json.", + "title": "Empty JSON", + "examples": [ + {} + ] + }, + "2_obj_campaign_object": { + "type": "object", + "title": "Campaign Object", + "description": "This is an object representing a campaign.", + "x-tags": [ + "CAMPAIGNS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM", + "GIFT_VOUCHERS", + "DISCOUNT_COUPONS", + "PROMOTION", + "REFERRAL_PROGRAM", + "LUCKY_DRAW" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + } + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "category": { + "type": "string", + "description": "Unique category name." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + }, + "referral_program": { + "type": "object", + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "How a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "category": { - "type": "string", - "description": "Unique category name." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - }, - "referral_program": { - "type": "object", - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "How a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "description": "Type of reward.", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ] - }, - "amount": { - "type": "string", - "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - } + } + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "description": "Type of resource represented by the source of the reward." } } + }, + "type": { + "type": "string", + "description": "Type of reward.", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ] + }, + "amount": { + "type": "string", + "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } - }, - "promotion": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] } } - }, - "2_loyalty_tiers_expiration_balance": { - "title": "Balance", - "type": "object", - "description": "Defines the Balance expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "BALANCE" - ], - "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." - } - } - }, - "expiration_date": { - "description": "Defines the conditions for the expiration date of a tier.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_balance_drop" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_custom" - } - ] - } + } + }, + "promotion": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" } - }, - "2_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { - "title": "Balance Drop", - "type": "object", - "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", - "properties": { - "type": { - "type": "string", - "enum": [ - "BALANCE_DROP" - ], - "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." - } + ] + } + } + }, + "2_loyalty_tiers_expiration_balance": { + "title": "Balance", + "type": "object", + "description": "Defines the Balance expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "BALANCE" + ], + "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." } - }, - "2_loyalty_tiers_expiration_balance_expiration_date_custom": { - "title": "Custom", - "type": "object", - "description": "Defines the custom conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." - }, - "extend": { - "type": "string", - "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." - }, - "rounding": { - "description": "Defines the rounding mechanism for tier expiration.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_default_options" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_custom" - } - ] - } + } + }, + "expiration_date": { + "description": "Defines the conditions for the expiration date of a tier.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_balance_drop" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance_expiration_date_custom" } - }, - "2_loyalty_tiers_expiration_expiration_date_rounding_default_options": { - "title": "Calendar Periods", - "type": "object", - "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", - "properties": { - "type": { - "type": "string", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ], - "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." - }, - "strategy": { - "type": "string", - "description": "Which portion of the given period should the rounding be applied to.", - "enum": [ - "END" - ] - } + ] + } + } + }, + "2_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { + "title": "Balance Drop", + "type": "object", + "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", + "properties": { + "type": { + "type": "string", + "enum": [ + "BALANCE_DROP" + ], + "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." + } + } + }, + "2_loyalty_tiers_expiration_balance_expiration_date_custom": { + "title": "Custom", + "type": "object", + "description": "Defines the custom conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." + }, + "extend": { + "type": "string", + "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." + }, + "rounding": { + "description": "Defines the rounding mechanism for tier expiration.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_default_options" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_expiration_date_rounding_custom" } - }, - "2_loyalty_tiers_expiration_expiration_date_rounding_custom": { - "title": "Specific Month", - "type": "object", - "description": "Defines the custom rounding mechanism for tier expiration.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "This mechanism describes a custom rounding for the expiration date." - }, - "strategy": { - "type": "string", - "description": "Which portion of the given period should the rounding be applied to.", - "enum": [ - "END" - ] - }, - "unit": { - "type": "string", - "description": "Defines the type of unit of time in which the rounding period is counted.", - "enum": [ - "MONTH" - ] - }, - "value": { - "type": "integer", - "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" - } + ] + } + } + }, + "2_loyalty_tiers_expiration_expiration_date_rounding_default_options": { + "title": "Calendar Periods", + "type": "object", + "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", + "properties": { + "type": { + "type": "string", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ], + "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." + }, + "strategy": { + "type": "string", + "description": "Which portion of the given period should the rounding be applied to.", + "enum": [ + "END" + ] + } + } + }, + "2_loyalty_tiers_expiration_expiration_date_rounding_custom": { + "title": "Specific Month", + "type": "object", + "description": "Defines the custom rounding mechanism for tier expiration.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "This mechanism describes a custom rounding for the expiration date." + }, + "strategy": { + "type": "string", + "description": "Which portion of the given period should the rounding be applied to.", + "enum": [ + "END" + ] + }, + "unit": { + "type": "string", + "description": "Defines the type of unit of time in which the rounding period is counted.", + "enum": [ + "MONTH" + ] + }, + "value": { + "type": "integer", + "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" + } + } + }, + "2_loyalty_tiers_expiration_points_in_period": { + "title": "Points in Period", + "type": "object", + "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "POINTS_IN_PERIOD" + ], + "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." + }, + "qualification_period": { + "type": "string", + "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
                  January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
                  - January - March
                  - April - June
                  - July - September
                  - October - December |\n| **Calendar Half-year** | Points collected in the half-year
                  - January - June
                  - July - December |\n| **Calendar Year** | Points collected in one calendar year
                  January - December |", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ] + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE", + "NEXT_PERIOD" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." } - }, - "2_loyalty_tiers_expiration_points_in_period": { - "title": "Points in Period", - "type": "object", - "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "POINTS_IN_PERIOD" - ], - "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." - }, - "qualification_period": { - "type": "string", - "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
                  January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
                  - January - March
                  - April - June
                  - July - September
                  - October - December |\n| **Calendar Half-year** | Points collected in the half-year
                  - January - June
                  - July - December |\n| **Calendar Year** | Points collected in one calendar year
                  January - December |", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ] - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE", - "NEXT_PERIOD" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." - } - } - }, - "expiration_date": { - "type": "object", - "description": "Defines the conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "END_OF_PERIOD", - "END_OF_NEXT_PERIOD" - ], - "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." - }, - "extend": { - "type": "string", - "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." - } - } - } + } + }, + "expiration_date": { + "type": "object", + "description": "Defines the conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "END_OF_PERIOD", + "END_OF_NEXT_PERIOD" + ], + "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." + }, + "extend": { + "type": "string", + "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." } - }, - "2_req_create_campaign": { - "title": "Create Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns`.", - "oneOf": [ - { - "$ref": "#/components/schemas/2_req_create_campaign_discount_voucher" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_loyalty" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_gift" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_promotion" - }, - { - "$ref": "#/components/schemas/2_req_create_campaign_referral" - } - ] - }, - "2_req_create_campaign_discount_voucher": { - "type": "object", - "title": "Discount Campaign", - "description": "Request body schema for creating a discount voucher campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "DISCOUNT_COUPONS", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - } + } + } + } + }, + "2_req_create_campaign": { + "title": "Create Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns`.", + "oneOf": [ + { + "$ref": "#/components/schemas/2_req_create_campaign_discount_voucher" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_loyalty" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_gift" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_promotion" + }, + { + "$ref": "#/components/schemas/2_req_create_campaign_referral" + } + ] + }, + "2_req_create_campaign_discount_voucher": { + "type": "object", + "title": "Discount Campaign", + "description": "Request body schema for creating a discount voucher campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "DISCOUNT_COUPONS", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "2_req_create_campaign_loyalty": { - "type": "object", - "title": "Loyalty Campaign", - "description": "Request body schema for creating a loyalty campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "LOYALTY_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + } + } + }, + "2_req_create_campaign_loyalty": { + "type": "object", + "title": "Loyalty Campaign", + "description": "Request body schema for creating a loyalty campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "LOYALTY_PROGRAM", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "2_req_create_campaign_gift": { - "type": "object", - "title": "Gift Card campaign", - "description": "Request body schema for creating a gift card campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "GIFT_VOUCHERS", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + } + } + }, + "2_req_create_campaign_gift": { + "type": "object", + "title": "Gift Card campaign", + "description": "Request body schema for creating a gift card campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "GIFT_VOUCHERS", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "2_req_create_campaign_referral": { - "type": "object", - "title": "Referral Campaign", - "description": "Request body schema for creating a referral campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "REFERRAL_PROGRAM", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "referral_program": { - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "type": "object", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "Define how a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "enum": [ - "CAMPAIGN" - ], - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ], - "description": "Type of reward." - }, - "amount": { - "type": "string", - "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - } - } - } - } - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + } + } + }, + "2_req_create_campaign_referral": { + "type": "object", + "title": "Referral Campaign", + "description": "Request body schema for creating a referral campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "REFERRAL_PROGRAM", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "2_req_create_campaign_promotion": { - "type": "object", - "title": "Promotion", - "description": "Request body schema for creating a promotions campaign using **POST** `/campaigns`.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "default": "PROMOTION", - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "promotion": { - "type": "object", - "description": "Define the promotion tiers within the campaign.", - "properties": { - "tiers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" - } - } - } - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" } - }, - "2_req_update_campaign": { - "type": "object", - "title": "Update Campaign Request Body", - "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", - "properties": { - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + ] + }, + "referral_program": { + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "type": "object", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "Define how a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_Ll9enAm2BCN0M1s4VxWobLFM", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter or the `category` parameter.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id` parameter." } - } - }, - "2_req_add_vouchers_to_campaign": { - "type": "object", - "title": "Add Vouchers to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers`.", - "properties": { - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher.", - "example": "cat_0b688929a2476386a7" - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "example": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Type of resource represented by the source of the reward." + } } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ], + "description": "Type of reward." + }, + "amount": { + "type": "string", + "description": "Define the number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } } } - }, - "2_req_add_vouchers_with_specific_code_to_campaign": { - "type": "object", - "title": "Add Vouchers with Specific Code to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers/{code}`.", - "properties": { - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher.", - "example": "cat_0b688929a2476386a7" - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - } + } + } + } + }, + "2_req_create_campaign_promotion": { + "type": "object", + "title": "Promotion", + "description": "Request body schema for creating a promotions campaign using **POST** `/campaigns`.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "default": "PROMOTION", + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "2_req_import_vouchers_to_campaign": { - "type": "array", - "title": "Import Vouchers to Campaign Request Body", - "description": "Request body schema for **POST** `/campaigns/{campaignId}/import`.", - "items": { - "$ref": "#/components/schemas/2_obj_import_vouchers_to_campaign_object" + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "promotion": { + "type": "object", + "description": "Define the promotion tiers within the campaign.", + "properties": { + "tiers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" + } } - }, - "2_obj_import_vouchers_to_campaign_object": { - "type": "object", - "title": "Import Vouchers to Campaign", - "description": "Import Vouchers to Campaign", - "properties": { - "code": { - "type": "string", - "description": "Unique custom voucher code." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that you would like to assign to the voucher. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." - }, - "redemption": { - "type": "object", - "description": "Stores the quantity of redemptions that can be applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "additional_info": { - "type": "string", - "description": "An optional field to keep any extra textual information about the code such as a code description and details." - }, - "loyalty_card": { - "type": "object", - "description": " Assign an initial points balance for a loyalty card. Context: `LOYALTY_PROGRAM`.", - "properties": { - "points": { - "type": "integer", - "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card." - } - } - }, - "gift": { + } + } + } + }, + "2_req_update_campaign": { + "type": "object", + "title": "Update Campaign Request Body", + "description": "Request body schema for **PUT** `/campaigns/{campaignId}`.", + "properties": { + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter or the `category` parameter.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id` parameter." + } + } + }, + "2_req_add_vouchers_to_campaign": { + "type": "object", + "title": "Add Vouchers to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers`.", + "properties": { + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher.", + "example": "cat_0b688929a2476386a7" + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + } + } + }, + "2_req_add_vouchers_with_specific_code_to_campaign": { + "type": "object", + "title": "Add Vouchers with Specific Code to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/vouchers/{code}`.", + "properties": { + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher.", + "example": "cat_0b688929a2476386a7" + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + } + } + }, + "2_req_import_vouchers_to_campaign": { + "type": "array", + "title": "Import Vouchers to Campaign Request Body", + "description": "Request body schema for **POST** `/campaigns/{campaignId}/import`.", + "items": { + "$ref": "#/components/schemas/2_obj_import_vouchers_to_campaign_object" + } + }, + "2_obj_import_vouchers_to_campaign_object": { + "type": "object", + "title": "Import Vouchers to Campaign", + "description": "Import Vouchers to Campaign", + "properties": { + "code": { + "type": "string", + "description": "Unique custom voucher code." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that you would like to assign to the voucher. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the voucher. A set of key/value pairs that you can attach to a voucher object. It can be useful for storing additional information about the voucher in a structured format." + }, + "redemption": { + "type": "object", + "description": "Stores the quantity of redemptions that can be applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "additional_info": { + "type": "string", + "description": "An optional field to keep any extra textual information about the code such as a code description and details." + }, + "loyalty_card": { + "type": "object", + "description": " Assign an initial points balance for a loyalty card. Context: `LOYALTY_PROGRAM`.", + "properties": { + "points": { + "type": "integer", + "description": "The initial number of points to assign to the loyalty card. This is the current loyalty card score i.e. the number of loyalty points on the card." + } + } + }, + "gift": { + "type": "object", + "description": "Assign an initial cash balance for a gift card. Context: `GIFT_VOUCHERS`.", + "properties": { + "amount": { + "type": "integer", + "description": "The cash balance to assign to the gift card. This is the current gift card balance." + } + } + } + }, + "required": [ + "code" + ] + }, + "2_req_examine_qualification": { + "type": "object", + "title": "Examine Qualification Request Body", + "description": "Request body schema for **POST** `/campaigns/qualification`.", + "examples": [], + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + } + } + }, + "2_res_examine_qualification": { + "type": "object", + "title": "Examine Qualification Response Body", + "description": "Response body schema for **POST** `/campaigns/qualification`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of campaign objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of campaign objects.", + "items": { + "$ref": "#/components/schemas/2_obj_campaign_object_campaigns_qualification" + } + }, + "total": { + "type": "integer", + "description": "Total valid and active campaigns matching the qualification criteria in given context." + }, + "id": { + "type": "string", + "description": "Unique qualification ID.", + "example": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU" + }, + "created_at": { + "type": "string", + "format": "datetime", + "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", + "example": "2023-04-04T13:13:03.119Z" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + } + } + }, + "2_obj_campaign_object_campaigns_qualification": { + "type": "object", + "title": "Campaign Object", + "description": "This is an object representing a campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "GIFT_VOUCHERS", + "DISCOUNT_COUPONS", + "REFERRAL_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" + }, + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + } + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "category": { + "type": "string", + "description": "Unique category name." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "validation_rules_assignments": { + "type": "object", + "description": "Stores information about validation rules assigned to the campaign.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented is by default `list`.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of validation rule assignments.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.", + "items": { "type": "object", - "description": "Assign an initial cash balance for a gift card. Context: `GIFT_VOUCHERS`.", "properties": { - "amount": { - "type": "integer", - "description": "The cash balance to assign to the gift card. This is the current gift card balance." - } - } - } - }, - "required": [ - "code" - ] - }, - "2_req_examine_qualification": { - "type": "object", - "title": "Examine Qualification Request Body", - "description": "Request body schema for **POST** `/campaigns/qualification`.", - "examples": [], - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + "id": { + "type": "string", + "example": "asgm_N7t39epaQR2SkQcW", + "description": "Assigned by the Voucherify API, identifies the validation rule assignment." }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + "rule_id": { + "type": "string", + "example": "val_ssbxf1L9aKri", + "description": "Assigned by the Voucherify API, identifies the validation rule." }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + "related_object_id": { + "type": "string", + "example": "camp_AaP9MC1Y0GpBII84UTIuasvb", + "description": "ID of the object from which the rule originates." }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + "related_object_type": { + "type": "string", + "example": "campaign", + "description": "Which object does the rule originate from: the `voucher` itself or inherited from its parent `campaign`." }, - { - "$ref": "#/components/schemas/10_req_create_order" + "created_at": { + "type": "string", + "example": "2022-02-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "validation_rules_assignment", + "description": "The type of resource represented by the object. Default is `validation_rules_assignment`." + }, + "rule": { + "type": "object", + "description": "Describes the details of the rule." } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + } } + }, + "total": { + "type": "integer", + "description": "Total number of validation rules assigned to the campaign." } - }, - "2_res_examine_qualification": { - "type": "object", - "title": "Examine Qualification Response Body", - "description": "Response body schema for **POST** `/campaigns/qualification`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of campaign objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of campaign objects.", - "items": { - "$ref": "#/components/schemas/2_obj_campaign_object_campaigns_qualification" + } + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + }, + "referral_program": { + "type": "object", + "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", + "properties": { + "conversion_event_type": { + "type": "string", + "enum": [ + "redemption", + "custom_event" + ], + "description": "How a referral is triggered." + }, + "custom_event": { + "type": "object", + "description": "Contains details about the custom event.", + "properties": { + "id": { + "type": "string", + "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", + "description": "Unique custom event ID." + }, + "name": { + "type": "string", + "description": "Custom event name." + } + } + }, + "referee_reward": { + "type": "object", + "description": "Defines the referee reward.", + "properties": { + "related_object_parent": { + "type": "object", + "description": "Details of the resource from which the reward originates.", + "properties": { + "id": { + "type": "string", + "description": "Unique ID of the reward source." + }, + "name": { + "type": "string", + "description": "Name of the reward source." + }, + "object": { + "type": "string", + "description": "Type of resource represented by the source of the reward." + } + } + }, + "type": { + "type": "string", + "description": "Type of reward.", + "enum": [ + "LOYALTY_CARD", + "GIFT_VOUCHER" + ] + }, + "amount": { + "type": "string", + "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." } - }, - "total": { - "type": "integer", - "description": "Total valid and active campaigns matching the qualification criteria in given context." - }, - "id": { - "type": "string", - "description": "Unique qualification ID.", - "example": "qfl_dNZ3gWfKVNa8Zw15hn30uqdU" - }, - "created_at": { - "type": "string", - "format": "datetime", - "description": "Timestamp representing the date and time when the qualification was created in ISO 8601 format.", - "example": "2023-04-04T13:13:03.119Z" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." } } - }, - "2_obj_campaign_object_campaigns_qualification": { - "type": "object", - "title": "Campaign Object", - "description": "This is an object representing a campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "GIFT_VOUCHERS", - "DISCOUNT_COUPONS", - "REFERRAL_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "category": { - "type": "string", - "description": "Unique category name." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "validation_rules_assignments": { - "type": "object", - "description": "Stores information about validation rules assigned to the campaign.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented is by default `list`.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of validation rule assignments.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Array of validation rule assignment objects. Each validation rule assignment object contains details about the rule.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "asgm_N7t39epaQR2SkQcW", - "description": "Assigned by the Voucherify API, identifies the validation rule assignment." - }, - "rule_id": { - "type": "string", - "example": "val_ssbxf1L9aKri", - "description": "Assigned by the Voucherify API, identifies the validation rule." - }, - "related_object_id": { - "type": "string", - "example": "camp_AaP9MC1Y0GpBII84UTIuasvb", - "description": "ID of the object from which the rule originates." - }, - "related_object_type": { - "type": "string", - "example": "campaign", - "description": "Which object does the rule originate from: the `voucher` itself or inherited from its parent `campaign`." - }, - "created_at": { - "type": "string", - "example": "2022-02-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "validation_rules_assignment", - "description": "The type of resource represented by the object. Default is `validation_rules_assignment`." - }, - "rule": { - "type": "object", - "description": "Describes the details of the rule." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of validation rules assigned to the campaign." - } - } - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." - }, - "referral_program": { - "type": "object", - "description": "Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.", - "properties": { - "conversion_event_type": { - "type": "string", - "enum": [ - "redemption", - "custom_event" - ], - "description": "How a referral is triggered." - }, - "custom_event": { - "type": "object", - "description": "Contains details about the custom event.", - "properties": { - "id": { - "type": "string", - "example": "ms_fi47Dcu5T0m3v3nT5ch3ma", - "description": "Unique custom event ID." - }, - "name": { - "type": "string", - "description": "Custom event name." - } - } - }, - "referee_reward": { - "type": "object", - "description": "Defines the referee reward.", - "properties": { - "related_object_parent": { - "type": "object", - "description": "Details of the resource from which the reward originates.", - "properties": { - "id": { - "type": "string", - "description": "Unique ID of the reward source." - }, - "name": { - "type": "string", - "description": "Name of the reward source." - }, - "object": { - "type": "string", - "description": "Type of resource represented by the source of the reward." - } - } - }, - "type": { - "type": "string", - "description": "Type of reward.", - "enum": [ - "LOYALTY_CARD", - "GIFT_VOUCHER" - ] - }, - "amount": { - "type": "string", - "description": "The number of `points` to add to a loyalty card or `credits` to the balance on a gift card. In case of the gift card, the value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - } - } - } - } - } + } + } + } + }, + "2_res_list_campaigns": { + "type": "object", + "description": "Schema model for **GET** `/campaigns`.", + "title": "List Campaigns Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of campaign objects.", + "default": "campaigns" + }, + "campaigns": { + "type": "array", + "description": "Contains array of campaign objects.", + "items": { + "$ref": "#/components/schemas/2_obj_campaign_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of campaigns." + } + } + }, + "2_obj_campaign_object_voucher_object_DISCOUNT": { + "type": "object", + "description": "Schema model for a discount voucher.", + "title": "Discount Voucher", + "properties": { + "type": { + "type": "string", + "default": "DISCOUNT_VOUCHER", + "description": "Type of voucher." + }, + "discount": { + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "2_res_list_campaigns": { - "type": "object", - "description": "Schema model for **GET** `/campaigns`.", - "title": "List Campaigns Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about campaigns in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of campaign objects.", - "default": "campaigns" - }, - "campaigns": { - "type": "array", - "description": "Contains array of campaign objects.", - "items": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of campaigns." - } + ], + "description": "Defines the voucher discount type and details." + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." } - }, - "2_obj_campaign_object_voucher_object_DISCOUNT": { - "type": "object", - "description": "Schema model for a discount voucher.", - "title": "Discount Voucher", - "properties": { - "type": { - "type": "string", - "default": "DISCOUNT_VOUCHER", - "description": "Type of voucher." - }, - "discount": { - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ], - "description": "Defines the voucher discount type and details." - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + } + } + }, + "2_obj_campaign_object_voucher_object_GIFT_CARD": { + "type": "object", + "description": "Schema model for a gift card.", + "title": "Gift Card", + "properties": { + "type": { + "type": "string", + "default": "GIFT_VOUCHER", + "description": "Type of voucher." + }, + "gift": { + "description": "Defines the gift card details.", + "type": "object", + "properties": { + "amount": { + "type": "integer", + "description": "Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "description": "Defines how the credits are applied to the customer's order.", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ] + } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + } + } + }, + "2_obj_campaign_object_voucher_object_LOYALTY_CARD": { + "type": "object", + "description": "Schema model for a loyalty card.", + "title": "Loyalty Card", + "properties": { + "type": { + "type": "string", + "default": "LOYALTY_CARD", + "description": "Type of voucher." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." } } - }, - "2_obj_campaign_object_voucher_object_GIFT_CARD": { - "type": "object", - "description": "Schema model for a gift card.", - "title": "Gift Card", - "properties": { - "type": { - "type": "string", - "default": "GIFT_VOUCHER", - "description": "Type of voucher." - }, - "gift": { - "description": "Defines the gift card details.", - "type": "object", - "properties": { - "amount": { - "type": "integer", - "description": "Initial gift card income to be applied to the gift card at voucher generation. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "description": "Defines how the credits are applied to the customer's order.", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ] - } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." + } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." + } + } + }, + "2_req_campaign_object_voucher_object_LOYALTY_CARD": { + "type": "object", + "description": "Schema model for a loyalty card.", + "title": "Loyalty Card", + "properties": { + "type": { + "type": "string", + "default": "LOYALTY_CARD", + "description": "Type of voucher." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." } } - }, - "2_obj_campaign_object_voucher_object_LOYALTY_CARD": { - "type": "object", - "description": "Schema model for a loyalty card.", - "title": "Loyalty Card", - "properties": { - "type": { - "type": "string", - "default": "LOYALTY_CARD", - "description": "Type of voucher." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." - } - } - } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Indicates whether the voucher is a referral code; this is `true` for campaign type `REFERRAL_PROGRAM`." - } + } + }, + "redemption": { + "type": "object", + "description": "Defines the redemption limits on vouchers.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." } - }, - "2_req_campaign_object_voucher_object_LOYALTY_CARD": { - "type": "object", - "description": "Schema model for a loyalty card.", - "title": "Loyalty Card", - "properties": { - "type": { - "type": "string", - "default": "LOYALTY_CARD", - "description": "Type of voucher." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." - } - } - } - } - }, - "redemption": { - "type": "object", - "description": "Defines the redemption limits on vouchers.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - } - } - }, - "code_config": { - "type": "object", - "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", - "properties": { - "length": { - "type": "string", - "description": "Number of characters in a generated code (excluding prefix and postfix)." - }, - "charset": { - "type": "string", - "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" - }, - "prefix": { - "type": "string", - "description": "A text appended before the code." - }, - "postfix": { - "type": "string", - "description": "A text appended after the code." - }, - "pattern": { - "type": "string", - "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." - } - } - } + } + }, + "code_config": { + "type": "object", + "description": "Defines code's pattern (prefix, suffix, length, charset, etc). ", + "properties": { + "length": { + "type": "string", + "description": "Number of characters in a generated code (excluding prefix and postfix)." + }, + "charset": { + "type": "string", + "description": "Characters that can appear in the code. \n\nExamples:\n\n- Alphanumeric: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic: `abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Alphabetic Lowercase: `abcdefghijklmnopqrstuvwxyz` \n- Alphabetic Uppercase: `ABCDEFGHIJKLMNOPQRSTUVWXYZ` \n- Numbers: `0123456789` \n- Custom: a custom character set" + }, + "prefix": { + "type": "string", + "description": "A text appended before the code." + }, + "postfix": { + "type": "string", + "description": "A text appended after the code." + }, + "pattern": { + "type": "string", + "description": "A pattern for codes where hashes (#) will be replaced with random characters. Overrides `length`." } - }, - "3_obj_promotion_tier_object": { - "type": "object", - "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.", - "title": "Promotion Tier Object", - "x-tags": [ - "PROMOTIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "description": "Unique promotion tier ID." - }, - "created_at": { - "type": "string", - "example": "2021-12-15T11:34:01.333Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-02-09T09:20:05.603Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion tier was updated in ISO 8601 format." - }, - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website." - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ], - "description": "The type of discount that will be applied to a customer's order." - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "campaign": { - "type": "object", - "description": "Contains details about promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-22T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](ref:disable-campaign) endpoint. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "category_id": { - "type": "string", - "example": "cat_0b688929a2476386a6", - "description": "Unique category ID that this campaign belongs to." - }, - "object": { - "type": "string", - "description": "The type of object represented by the campaign object. This object stores information about the campaign.", - "default": "campaign" - } - } - }, - "campaign_id": { - "type": "string", - "description": "Promotion tier's parent campaign's unique ID." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "summary": { - "type": "object", - "description": "Contains statistics about promotion tier redemptions and orders.", - "properties": { - "redemptions": { - "type": "object", - "description": "Contains statistics about promotion tier redemptions.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Number of times the promotion tier was redeemed." - } - } - }, - "orders": { - "type": "object", - "description": "Contains statistics about orders related to the promotion tier.", - "properties": { - "total_amount": { - "type": "integer", - "description": "Sum of order totals." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of total discount applied using the promotion tier." - } - } - } + } + } + } + }, + "3_obj_promotion_tier_object": { + "type": "object", + "description": "This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.", + "title": "Promotion Tier Object", + "x-tags": [ + "PROMOTIONS API" + ], + "properties": { + "id": { + "type": "string", + "example": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "description": "Unique promotion tier ID." + }, + "created_at": { + "type": "string", + "example": "2021-12-15T11:34:01.333Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion tier was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-02-09T09:20:05.603Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion tier was updated in ISO 8601 format." + }, + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website." + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "validation_rule_assignments": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" - }, - "category_id": { - "type": "string", - "description": "Promotion tier category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion tier." - } + ], + "description": "The type of discount that will be applied to a customer's order." } - }, - "3_req_add_promotion_tier_to_campaign": { - "type": "object", - "description": "Request body schema for creating a promotion tier within a campaign in **POST** `/promotions/{campaignId}/tiers`.", - "title": "Add Promotion Tier to Campaign Request Body", - "properties": { - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.\t" - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ], - "description": "The type of discount that will be applied to a customer's order." - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "validation_rules": { - "type": "array", - "description": "Array containing the ID of the validation rule associated with the promotion tier.", - "items": { - "type": "string" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "campaign": { + "type": "object", + "description": "Contains details about promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-22T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "category": { - "type": "string", - "description": "Assign category to the promotion tier." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" } - } - }, - "3_req_update_promotion_tier": { - "type": "object", - "description": "Request body schema for updating a promotion tier within a campaign in **POST** `/promotions/tiers/{promotionTierId}`.", - "title": "Update Promotion Tier Request Body", - "properties": { - "name": { - "type": "string", - "description": "Name of the promotion tier." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.\t" - }, - "action": { - "type": "object", - "description": "Contains details about the discount applied by the promotion tier.", - "properties": { - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ], - "description": "The type of discount that will be applied to a customer's order." - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", - "format": "date-time", - "example": "2022-09-23T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", - "format": "date-time", - "example": "2022-09-26T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. If you update a hierarchy of a promotion tier, then the remaining promotion tier hierarchies will be recalculated." - }, - "category": { - "type": "string", - "description": "Assign a new or update the promotion tier's category." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" } + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date` using the [Disable Campaign](ref:disable-campaign) endpoint. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "category_id": { + "type": "string", + "example": "cat_0b688929a2476386a6", + "description": "Unique category ID that this campaign belongs to." + }, + "object": { + "type": "string", + "description": "The type of object represented by the campaign object. This object stores information about the campaign.", + "default": "campaign" } - }, - "3_res_list_promotion_tiers": { - "type": "object", - "description": "Promotion Tiers", - "title": "Promotion Tiers", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "tiers", - "description": "Identifies the name of the attribute that contains the array of promotion tier objects." - }, - "tiers": { - "type": "array", - "description": "Contains array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + }, + "campaign_id": { + "type": "string", + "description": "Promotion tier's parent campaign's unique ID." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "summary": { + "type": "object", + "description": "Contains statistics about promotion tier redemptions and orders.", + "properties": { + "redemptions": { + "type": "object", + "description": "Contains statistics about promotion tier redemptions.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Number of times the promotion tier was redeemed." } - }, - "total": { - "type": "integer", - "description": "Total number of promotion tiers." } - } - }, - "3_res_list_promotion_stacks": { - "type": "object", - "description": "Promotion Stacks", - "title": "Promotion Stacks", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of promotion stack objects." - }, - "data": { - "type": "array", - "description": "Contains array of promotion stack objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "orders": { + "type": "object", + "description": "Contains statistics about orders related to the promotion tier.", + "properties": { + "total_amount": { + "type": "integer", + "description": "Sum of order totals." + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of total discount applied using the promotion tier." } - }, - "total": { - "type": "integer", - "description": "Total number of promotion stacks." } } - }, - "3_obj_promotion_stack_object": { - "type": "object", - "title": "Promotion Stack Object", - "description": "Model schema for a promotion stack.", - "properties": { - "id": { - "type": "string", - "example": "stack_p0WhtyyDU95crobleMpRabhH", - "description": "Unique promotion stack ID." - }, - "name": { - "type": "string", - "description": "Promotion stack name." - }, - "created_at": { - "type": "string", - "example": "2022-09-22T13:03:25.740Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-09-23T07:59:44.172Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." - }, - "campaign_id": { - "type": "string", - "example": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "description": "Promotion stack's parent campaign's unique ID." - }, - "object": { - "type": "string", - "default": "promotion_stack", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "tiers": { - "type": "object", - "description": "Contains the tier configuration.", - "properties": { - "ids": { - "type": "array", - "description": "Contains the list of tiers in a pre-defined sequence.", - "items": { - "type": "string" - } - }, - "hierarchy_mode": { - "type": "string", - "default": "MANUAL" - } - } - }, - "category_id": { - "type": "string", - "description": "Promotion stack category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion stack." - } - } - }, - "3_req_create_promotion_stack": { - "type": "object", - "title": "Create Promotion Stack Request Body", - "description": "Model schema for a creating a promotion stack using **POST** `/promotions/{campaignId}/stacks`.", - "properties": { - "name": { - "type": "string", - "description": "Promotion stack name." - }, - "tiers": { - "type": "object", - "description": "Contains the tier configuration.", - "properties": { - "ids": { - "type": "array", - "description": "Contains the list of tiers in a pre-defined sequence.", - "items": { - "type": "string" - } - }, - "hierarchy_mode": { - "type": "string", - "example": "MANUAL" - } + } + }, + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + }, + "validation_rule_assignments": { + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + }, + "category_id": { + "type": "string", + "description": "Promotion tier category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion tier." + } + } + }, + "3_req_add_promotion_tier_to_campaign": { + "type": "object", + "description": "Request body schema for creating a promotion tier within a campaign in **POST** `/promotions/{campaignId}/tiers`.", + "title": "Add Promotion Tier to Campaign Request Body", + "properties": { + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.\t" + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "category": { - "type": "string", - "description": "Assign a category." - }, - "category_id": { - "type": "string", - "description": "Instead of using the category name, you can alternatively assign a new category to a promotion stack using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", - "example": "cat_0c9da30e7116ba6bba" - } + ], + "description": "The type of discount that will be applied to a customer's order." } - }, - "3_res_list_promotion_tiers_from_campaign": { - "type": "object", - "description": "Promotion Tiers", - "title": "Promotion Tiers", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "tiers", - "description": "Identifies the name of the attribute that contains the array of promotion tier objects." - }, - "tiers": { - "type": "array", - "description": "Contains array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of promotion tiers." - }, - "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." - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* promotion tier\n- `false` indicates an *inactive* promotion tier" + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "4_obj_reward_object": { - "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": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_obj_reward_object_parameters_MATERIAL" - } - ], - "description": "Defines how the reward is generated." - }, - "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.\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." - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "validation_rules": { + "type": "array", + "description": "Array containing the ID of the validation rule associated with the promotion tier.", + "items": { + "type": "string" + } + }, + "category": { + "type": "string", + "description": "Assign category to the promotion tier." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } + } + }, + "3_req_update_promotion_tier": { + "type": "object", + "description": "Request body schema for updating a promotion tier within a campaign in **POST** `/promotions/tiers/{promotionTierId}`.", + "title": "Update Promotion Tier Request Body", + "properties": { + "name": { + "type": "string", + "description": "Name of the promotion tier." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.\t" + }, + "action": { + "type": "object", + "description": "Contains details about the discount applied by the promotion tier.", + "properties": { + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "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." - } + ], + "description": "The type of discount that will be applied to a customer's order." } - }, - "4_obj_reward_object_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" - } - ] - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is *inactive before* this date. ", + "format": "date-time", + "example": "2022-09-23T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive after* this date. ", + "format": "date-time", + "example": "2022-09-26T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the promotion tier is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a promotion tier with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the promotion tier will be active in ISO 8601 format. For example, a promotion tier with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS": { - "title": "Discount Coupons", - "type": "object", - "description": "These are parameters representing a discount coupon, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "type": { - "type": "string", - "description": "Campaign type.", - "default": "DISCOUNT_COUPONS" + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the promotion tier is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy. If you update a hierarchy of a promotion tier, then the remaining promotion tier hierarchies will be recalculated." + }, + "category": { + "type": "string", + "description": "Assign a new or update the promotion tier's category." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion tier using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } + } + }, + "3_res_list_promotion_tiers": { + "type": "object", + "description": "Promotion Tiers", + "title": "Promotion Tiers", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "tiers", + "description": "Identifies the name of the attribute that contains the array of promotion tier objects." + }, + "tiers": { + "type": "array", + "description": "Contains array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion tiers." + } + } + }, + "3_res_list_promotion_stacks": { + "type": "object", + "description": "Promotion Stacks", + "title": "Promotion Stacks", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion stacks in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of promotion stack objects." + }, + "data": { + "type": "array", + "description": "Contains array of promotion stack objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion stacks." + } + } + }, + "3_obj_promotion_stack_object": { + "type": "object", + "title": "Promotion Stack Object", + "description": "Model schema for a promotion stack.", + "properties": { + "id": { + "type": "string", + "example": "stack_p0WhtyyDU95crobleMpRabhH", + "description": "Unique promotion stack ID." + }, + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "created_at": { + "type": "string", + "example": "2022-09-22T13:03:25.740Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-09-23T07:59:44.172Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the promotion stack was updated in ISO 8601 format." + }, + "campaign_id": { + "type": "string", + "example": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "description": "Promotion stack's parent campaign's unique ID." + }, + "object": { + "type": "string", + "default": "promotion_stack", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + }, + "tiers": { + "type": "object", + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" } + }, + "hierarchy_mode": { + "type": "string", + "default": "MANUAL" } - }, - "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { - "title": "Gift Vouchers", - "type": "object", - "description": "These are parameters representing a gift voucher, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "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", - "description": "Campaign type.", - "default": "GIFT_VOUCHERS" + } + }, + "category_id": { + "type": "string", + "description": "Promotion stack category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion stack." + } + } + }, + "3_req_create_promotion_stack": { + "type": "object", + "title": "Create Promotion Stack Request Body", + "description": "Model schema for a creating a promotion stack using **POST** `/promotions/{campaignId}/stacks`.", + "properties": { + "name": { + "type": "string", + "description": "Promotion stack name." + }, + "tiers": { + "type": "object", + "description": "Contains the tier configuration.", + "properties": { + "ids": { + "type": "array", + "description": "Contains the list of tiers in a pre-defined sequence.", + "items": { + "type": "string" } + }, + "hierarchy_mode": { + "type": "string", + "example": "MANUAL" } - }, - "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { - "title": "Points on loyalty card", - "type": "object", - "description": "These are parameters representing points on a loyalty card, which is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "balance": { - "type": "integer", - "description": "The incremental points to be added to the current balance on the loyalty card." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "default": "LOYALTY_PROGRAM" - } + } + }, + "category": { + "type": "string", + "description": "Assign a category." + }, + "category_id": { + "type": "string", + "description": "Instead of using the category name, you can alternatively assign a new category to a promotion stack using a unique category ID, i.e. `cat_0c9da30e7116ba6bba`.", + "example": "cat_0c9da30e7116ba6bba" + } + } + }, + "3_res_list_promotion_tiers_from_campaign": { + "type": "object", + "description": "Promotion Tiers", + "title": "Promotion Tiers", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about promotion tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "tiers", + "description": "Identifies the name of the attribute that contains the array of promotion tier objects." + }, + "tiers": { + "type": "array", + "description": "Contains array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of promotion tiers." + }, + "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." + } + } + }, + "4_obj_reward_object": { + "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": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_obj_reward_object_parameters_MATERIAL" } - }, - "4_obj_reward_object_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`.", - "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." - } - } - } + ], + "description": "Defines how the reward is generated." + }, + "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.\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." } - }, - "4_obj_reward_object_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" - } - } - } + } + }, + "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." + } + } + }, + "4_obj_reward_object_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" } - }, - "4_req_create_reward": { - "title": "Create Reward Request Body", - "description": "Request body schema for **POST** `/rewards`.", - "anyOf": [ - { - "$ref": "#/components/schemas/4_req_create_reward_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_req_create_reward_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_create_reward_COIN" - } - ] - }, - "4_req_create_reward-copy": { - "title": "Create Reward Request Body", - "type": "object", - "description": "Request body schema for **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "CAMPAIGN", - "COIN", - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } - } - }, - "4_req_create_reward_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Request body schema for creating a digital reward using **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "CAMPAIGN" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - }, - "metadata": { - "type": "string", - "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." - } - } - }, - "4_req_create_reward_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Request body schema for creating a pay with points reward using **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "COIN" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - "metadata": { - "type": "string", - "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." - } + ] + } + } + }, + "4_obj_reward_object_parameters_CAMPAIGN_DISCOUNT_COUPONS": { + "title": "Discount Coupons", + "type": "object", + "description": "These are parameters representing a discount coupon, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "type": { + "type": "string", + "description": "Campaign type.", + "default": "DISCOUNT_COUPONS" + } + } + }, + "4_obj_reward_object_parameters_CAMPAIGN_GIFT_VOUCHERS": { + "title": "Gift Vouchers", + "type": "object", + "description": "These are parameters representing a gift voucher, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "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", + "description": "Campaign type.", + "default": "GIFT_VOUCHERS" + } + } + }, + "4_obj_reward_object_parameters_CAMPAIGN_LOYALTY_PROGRAM": { + "title": "Points on loyalty card", + "type": "object", + "description": "These are parameters representing points on a loyalty card, which is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "balance": { + "type": "integer", + "description": "The incremental points to be added to the current balance on the loyalty card." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "default": "LOYALTY_PROGRAM" + } + } + }, + "4_obj_reward_object_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`.", + "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." } - }, - "4_req_create_reward_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Request body schema to create a material reward using\n **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - "stock": { - "type": "integer", - "description": "The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } + } + } + } + }, + "4_obj_reward_object_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" } - }, - "4_req_update_reward": { - "title": "Update Reward Request Body", - "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", - "anyOf": [ - { - "$ref": "#/components/schemas/4_req_update_reward_CAMPAIGN" - }, - { - "$ref": "#/components/schemas/4_req_update_reward_COIN" - }, - { - "$ref": "#/components/schemas/4_req_update_reward_MATERIAL" - } - ] - }, - "4_req_update_reward-copy": { - "title": "Update Reward Request Body", - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } + } + } + } + }, + "4_req_create_reward": { + "title": "Create Reward Request Body", + "description": "Request body schema for **POST** `/rewards`.", + "anyOf": [ + { + "$ref": "#/components/schemas/4_req_create_reward_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_req_create_reward_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_create_reward_COIN" + } + ] + }, + "4_req_create_reward-copy": { + "title": "Create Reward Request Body", + "type": "object", + "description": "Request body schema for **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN", + "COIN", + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" } - }, - "4_req_update_reward_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Request body schema for updating a digital reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - }, - "metadata": { - "type": "string", - "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": "Defines how the reward is generated." + }, + "stock": { + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." + }, + "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." } - }, - "4_req_update_reward_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Request body schema for updating a pay with points reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - "metadata": { - "type": "string", - "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." - } + } + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_create_reward_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Request body schema for creating a digital reward using **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "CAMPAIGN" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_create_reward_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Request body schema for creating a pay with points reward using **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "COIN" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_create_reward_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Request body schema to create a material reward using\n **POST** `/rewards`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "type": { + "type": "string", + "enum": [ + "MATERIAL" + ], + "description": "Reward type." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + "stock": { + "type": "integer", + "description": "The number of units of the product that you want to share as a reward." + }, + "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." } - }, - "4_req_update_reward_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Request body schema for updating a material reward using **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - "stock": { - "type": "integer", - "description": "The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } + } + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_update_reward": { + "title": "Update Reward Request Body", + "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", + "anyOf": [ + { + "$ref": "#/components/schemas/4_req_update_reward_CAMPAIGN" + }, + { + "$ref": "#/components/schemas/4_req_update_reward_COIN" + }, + { + "$ref": "#/components/schemas/4_req_update_reward_MATERIAL" + } + ] + }, + "4_req_update_reward-copy": { + "title": "Update Reward Request Body", + "type": "object", + "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "oneOf": [ + { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" } - }, - "4_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM": { - "title": "Points on loyalty card", - "type": "object", - "description": "Configure a reward that adds points to a loyalty card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the loyalty cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "balance": { - "type": "integer", - "description": "The incremental points to be added to the current balance on the loyalty card." - } + ], + "description": "Defines how the reward is generated." + }, + "stock": { + "type": "integer", + "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." + }, + "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." } - }, - "4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS": { - "title": "Gift Vouchers", - "type": "object", - "description": "Configure a reward that adds cash to a gift card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the gift cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - }, - "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." - } + } + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_update_reward_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Request body schema for updating a digital reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_update_reward_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Request body schema for updating a pay with points reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_COIN" + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_update_reward_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Request body schema for updating a material reward using **PUT** `/rewards/{rewardId}`.", + "properties": { + "name": { + "type": "string", + "description": "Reward name." + }, + "parameters": { + "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" + }, + "stock": { + "type": "integer", + "description": "The number of units of the product that you want to share as a reward." + }, + "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." } - }, - "4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS": { - "title": "Discount Coupons", - "type": "object", - "description": "Configure a reward that provides a discount coupon. This type of reward is a subset of a Digital (CAMPAIGN) reward.", - "properties": { - "id": { - "type": "string", - "description": "Assign the reward to the campaign that contains the vouchers that will be the source of the reward. Provide the unique campaign ID, assigned by Voucherify.", - "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" - } + } + }, + "metadata": { + "type": "string", + "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." + } + } + }, + "4_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM": { + "title": "Points on loyalty card", + "type": "object", + "description": "Configure a reward that adds points to a loyalty card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the loyalty cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "balance": { + "type": "integer", + "description": "The incremental points to be added to the current balance on the loyalty card." + } + } + }, + "4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS": { + "title": "Gift Vouchers", + "type": "object", + "description": "Configure a reward that adds cash to a gift card. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the gift cards that will be replenished by the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + }, + "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." + } + } + }, + "4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS": { + "title": "Discount Coupons", + "type": "object", + "description": "Configure a reward that provides a discount coupon. This type of reward is a subset of a Digital (CAMPAIGN) reward.", + "properties": { + "id": { + "type": "string", + "description": "Assign the reward to the campaign that contains the vouchers that will be the source of the reward. Provide the unique campaign ID, assigned by Voucherify.", + "example": "camp_13BbZ0kQsNinhqsX3wUts2UP" + } + } + }, + "4_req_reward_parameters_CAMPAIGN": { + "title": "Digital Reward", + "type": "object", + "description": "Configure 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_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS" + }, + { + "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS" } - }, - "4_req_reward_parameters_CAMPAIGN": { - "title": "Digital Reward", - "type": "object", - "description": "Configure 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_req_reward_parameters_CAMPAIGN_LOYALTY_PROGRAM" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_GIFT_VOUCHERS" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN_DISCOUNT_COUPONS" - } - ] - } + ] + } + } + }, + "4_req_reward_parameters_MATERIAL": { + "title": "Material Reward", + "type": "object", + "description": "Configure parameters representing products as a (MATERIAL) reward.", + "properties": { + "product": { + "type": "object", + "description": "Define the product given as a reward.", + "properties": { + "id": { + "type": "string", + "example": "prod_0b7d7dfb05cbe5c616", + "description": "Unique product ID, assigned by Voucherify, given as a reward." + }, + "sku_id": { + "type": [ + "string", + "null" + ], + "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", + "example": "sku_0b7d7dfb090be5c619" } - }, - "4_req_reward_parameters_MATERIAL": { - "title": "Material Reward", - "type": "object", - "description": "Configure parameters representing products as a (MATERIAL) reward.", - "properties": { - "product": { - "type": "object", - "description": "Define the product given as a reward.", - "properties": { - "id": { - "type": "string", - "example": "prod_0b7d7dfb05cbe5c616", - "description": "Unique product ID, assigned by Voucherify, given as a reward." - }, - "sku_id": { - "type": [ - "string", - "null" - ], - "description": "Unique SKU ID, assigned by Voucherify, of the SKU given as a reward.", - "example": "sku_0b7d7dfb090be5c619" - } - } - } + } + } + } + }, + "4_req_reward_parameters_COIN": { + "title": "Pay with Points Reward", + "type": "object", + "description": "Configure parameters representing a Pay with Points (COIN) reward. ", + "properties": { + "coin": { + "type": "object", + "description": "Define the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.", + "properties": { + "exchange_ratio": { + "type": [ + "string", + "integer" + ], + "description": "The cash equivalent of the points defined in the `points_ratio` property." + }, + "points_ratio": { + "type": [ + "string", + "integer" + ], + "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." } - }, - "4_req_reward_parameters_COIN": { - "title": "Pay with Points Reward", - "type": "object", - "description": "Configure parameters representing a Pay with Points (COIN) reward. ", - "properties": { - "coin": { - "type": "object", - "description": "Define the ratio by mapping the number of loyalty points in `points_ratio` to a predefined cash amount in `exchange_ratio`.", - "properties": { - "exchange_ratio": { - "type": [ - "string", - "integer" - ], - "description": "The cash equivalent of the points defined in the `points_ratio` property." - }, - "points_ratio": { - "type": [ - "string", - "integer" - ], - "description": "The number of loyalty points that will map to the predefined cash amount defined by the `exchange_ratio` property." - } - } - } - } - }, - "4_res_list_rewards": { - "type": "object", - "description": "Response body schema for **GET** `/rewards`.", - "title": "List Rewards Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about rewards in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of rewards.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of reward objects.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_object" + } + } + } + }, + "4_res_list_rewards": { + "type": "object", + "description": "Response body schema for **GET** `/rewards`.", + "title": "List Rewards Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about rewards in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of rewards.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of reward objects.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of rewards." + } + } + }, + "4_obj_reward_assignment_object": { + "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", + "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." } - }, - "total": { - "type": "integer", - "description": "Total number of rewards." } } - }, - "4_obj_reward_assignment_object": { - "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", - "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." - } - } - } + } + }, + "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", + "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." + } + } + }, + "4_res_list_reward_assignments": { + "type": "object", + "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", + "title": "List Reward Assignments Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about reward assignments in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of reward assignments.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of reward assignments." + } + } + }, + "4_req_update_reward_assignment": { + "type": "object", + "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", + "title": "Update Reward Assignment Request Body", + "properties": { + "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": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." } - }, - "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", - "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." } } - }, - "4_res_list_reward_assignments": { - "type": "object", - "description": "Response body schema for **GET** `/rewards/{rewardID}/assignments`.", - "title": "List Reward Assignments Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about reward assignments in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of reward assignments.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + } + } + }, + "4_req_create_reward_assignment": { + "type": "object", + "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" + ], + "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." } - }, - "total": { - "type": "integer", - "description": "Total number of reward assignments." } } - }, - "4_req_update_reward_assignment": { - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardID}/assignments/{assignmentID}`.", - "title": "Update Reward Assignment Request Body", - "properties": { - "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": "Number of points that will be subtracted from the loyalty card points balance if the reward is redeemed." - } - } - } - } - } + } + } + }, + "required": [ + "campaign", + "parameters" + ] + }, + "5_obj_publication_object": { + "title": "Publication Object", + "type": "object", + "description": "This is an object representing a publication. ", + "x-tags": [ + "PUBLICATIONS API" + ], + "properties": { + "id": { + "type": "string", + "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", + "description": "Unique publication ID, assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "publication", + "description": "The type of object represented by the JSON. This object stores information about the publication." + }, + "created_at": { + "type": "string", + "example": "2022-09-23T09:57:00.434Z", + "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", + "format": "date-time" + }, + "customer_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of the customer receiving the publication." + }, + "tracking_id": { + "type": "string", + "description": "Customer's `source_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Status of the publication attempt." + }, + "customer": { + "type": "object", + "description": "Contains information about the customer to whom the publication was directed.", + "properties": { + "id": { + "type": "string", + "description": "Unique customer ID, assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's name." + }, + "email": { + "type": "string", + "description": "Customer's email." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "object": { + "type": "string", + "default": "customer", + "description": "The type of object represented by the JSON. This object stores information about the customer." } - }, - "4_req_create_reward_assignment": { - "type": "object", - "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" - ], - "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." - } - } - } - } - } + } + }, + "voucher": { + "description": "Contains information about the voucher being published.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_obj_publication_object_discount" }, - "required": [ - "campaign", - "parameters" - ] - }, - "5_obj_publication_object": { - "title": "Publication Object", - "type": "object", - "description": "This is an object representing a publication. ", - "x-tags": [ - "PUBLICATIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", - "description": "Unique publication ID, assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "publication", - "description": "The type of object represented by the JSON. This object stores information about the publication." - }, - "created_at": { - "type": "string", - "example": "2022-09-23T09:57:00.434Z", - "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", - "format": "date-time" - }, - "customer_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of the customer receiving the publication." - }, - "tracking_id": { - "type": "string", - "description": "Customer's `source_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Status of the publication attempt." - }, - "customer": { - "type": "object", - "description": "Contains information about the customer to whom the publication was directed.", - "properties": { - "id": { - "type": "string", - "description": "Unique customer ID, assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's name." - }, - "email": { - "type": "string", - "description": "Customer's email." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "object": { - "type": "string", - "default": "customer", - "description": "The type of object represented by the JSON. This object stores information about the customer." - } - } - }, - "voucher": { - "description": "Contains information about the voucher being published.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_obj_publication_object_discount" - }, - { - "$ref": "#/components/schemas/5_obj_publication_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/5_obj_publication_object_gift_card" - } - ] - }, - "vouchers_id": { - "type": "array", - "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", - "items": { - "type": "string", - "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" - } - } + { + "$ref": "#/components/schemas/5_obj_publication_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/5_obj_publication_object_gift_card" } - }, - "5_req_create_publication_standalone_voucher": { - "title": "Standalone Voucher", - "type": "object", - "description": "Create publication for standalone voucher.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } + ] + }, + "vouchers_id": { + "type": "array", + "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", + "items": { + "type": "string", + "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" + } + } + } + }, + "5_req_create_publication_standalone_voucher": { + "title": "Standalone Voucher", + "type": "object", + "description": "Create publication for standalone voucher.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "5_req_create_publication_from_campaign": { - "title": "Voucher from Campaign", - "description": "Create a publication for a voucher from a campaign.", - "oneOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_auto_update" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_one_specific_voucher" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign_multiple_vouchers" - } - ] - }, - "5_req_create_publication_from_campaign_auto_update": { - "title": "Voucher from Auto-Update Campaign", - "type": "object", - "description": "Create a publication for a voucher from an auto-update campaign. It will choose the next available voucher.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ] - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } + ] + }, + "voucher": { + "description": "Code of voucher being published.", + "type": "string" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign": { + "title": "Voucher from Campaign", + "description": "Create a publication for a voucher from a campaign.", + "oneOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_auto_update" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_one_specific_voucher" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign_multiple_vouchers" + } + ] + }, + "5_req_create_publication_from_campaign_auto_update": { + "title": "Voucher from Auto-Update Campaign", + "type": "object", + "description": "Create a publication for a voucher from an auto-update campaign. It will choose the next available voucher.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "5_req_create_publication_from_campaign_one_specific_voucher": { - "title": "Voucher from Campaign", - "type": "object", - "description": "Create a publication for a specific voucher code from a campaign.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } + ] + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign_one_specific_voucher": { + "title": "Voucher from Campaign", + "type": "object", + "description": "Create a publication for a specific voucher code from a campaign.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "5_req_create_publication_from_campaign_multiple_vouchers": { - "title": "Vouchers from Campaign", - "type": "object", - "description": "Create a publication of multiple vouchers from a campaign.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "anyOf": [ - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ] - }, - "voucher": { - "description": "Code of voucher being published.", - "type": "string" - }, - "campaign": { - "type": "object", - "description": "Contains name of source campaign and number of vouchers to be published.", - "properties": { - "name": { - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." - }, - "count": { - "type": "string", - "description": "Number of vouchers to be published to customer." - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } - } - }, - "5_req_create_publication": { - "title": "Create Publication Request Body", - "description": "Request body schema for publishing a voucher.", - "oneOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_standalone_voucher" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_from_campaign" - } - ] - }, - "5_res_create_publication": { - "title": "Create Publication Response Body", - "type": "object", - "description": "Response schema model for publishing a voucher to a specific customer.", - "properties": { - "id": { - "type": "string", - "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", - "description": "Unique publication ID, assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "publication", - "description": "The type of object represented by the JSON. This object stores information about the `publication`." - }, - "created_at": { - "type": "string", - "example": "2022-09-23T09:57:00.434Z", - "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", - "format": "date-time" - }, - "customer_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of the customer receiving the publication." - }, - "tracking_id": { - "type": "string", - "description": "Customer's `source_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - }, - "channel": { - "type": "string", - "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", - "enum": [ - "voucherify-website", - "Dashboard", - "Automation", - "API", - "Braze", - "Reward", - "SMS", - "Email", - "Activecampaign", - "Webhook", - "Intercom", - "Mailchimp", - "Shopify" - ] - }, - "source_id": { - "type": "string", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Status of the publication attempt." - }, - "customer": { - "description": "Contains information about the customer to whom the publication was directed.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique customer ID, assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's name." - }, - "email": { - "type": "string", - "description": "Customer's email." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "object": { - "type": "string", - "default": "customer", - "description": "The type of object represented by the JSON. This object stores information about the `customer`." - } - } - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "vouchers_id": { - "type": "array", - "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", - "items": { - "type": "string", - "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" - } - } - } - }, - "5_req_create_publication_campaign_id": { - "title": "Campaign ID", - "type": "object", - "description": "Campaign's unique ID assigned by Voucherify.", - "properties": { - "id": { - "type": "string", - "example": "camp_7AZCZeF1VvD6EHC5anAMtvcK", - "description": "Unique campaign ID, assigned by Voucherify." - } - } - }, - "5_req_create_publication_campaign_name": { - "title": "Campaign's name", - "type": "object", - "description": "Campaign's name.", - "properties": { - "name": { - "type": "string", - "example": "Summer Campaign", - "description": "Campaign's name." - } - } - }, - "5_req_create_publication_campaign": { - "title": "Campaign's name or ID", - "type": "string", - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. " - }, - "5_res_create_publication_customer_id": { - "title": "Customer ID", - "type": "object", - "description": "Customer's unique ID assigned by Voucherify.", - "properties": { - "id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID, assigned by Voucherify." - } - } - }, - "5_res_create_publication_customer_source_id": { - "title": "Customer's Source ID", - "type": "object", - "description": "The merchant’s customer ID.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - } - } - }, - "5_req_create_publication_customer": { - "title": "Source ID or Unique Customer ID", - "type": "string", - "description": "Customer's unique ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`, or the merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "5_obj_publication_object_discount": { - "title": "Discount Voucher", - "type": "object", - "description": "This is an object representing a publication of a discount voucher. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ] - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_obj_publication_object_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "This is an object representing a publication of a loyalty card. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "loyalty_card": { - "type": "object", - "description": "Contains information about the loyalty card being published.", - "properties": { - "points": { - "type": "integer", - "description": "The incremental points to be added to the loyalty card as the initial balance on the card." - }, - "balance": { - "type": "integer", - "description": "The points balance after the incremental points are added to the loyalty card." - } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_obj_publication_object_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "This is an object representing a publication of a gift card. ", - "properties": { - "code": { - "type": "string", - "description": "Voucher code." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the voucher.", - "default": "voucher" - }, - "campaign": { - "type": "string", - "description": "Name of voucher's parent campaign." - }, - "gift": { - "type": "object", - "description": "Contains information about the gift card being published.", - "properties": { - "amount": { - "type": "integer", - "description": "The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "description": "The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "How the credits are applied to the customer's order." - } - } - }, - "is_referral_code": { - "type": "boolean", - "description": "Whether this voucher is a referral code." - } - } - }, - "5_res_list_publications": { - "type": "object", - "description": "Response body schema for listing publications using **GET** `/publications`.", - "title": "List Publications Response Body", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about publications in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "publications", - "description": "Identifies the name of the attribute that contains the array of publications." - }, - "publications": { - "type": "array", - "description": "Contains array of publication objects.", - "items": { - "$ref": "#/components/schemas/5_obj_publication_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of publications." - } + ] + }, + "voucher": { + "description": "Code of voucher being published.", + "type": "string" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication_from_campaign_multiple_vouchers": { + "title": "Vouchers from Campaign", + "type": "object", + "description": "Create a publication of multiple vouchers from a campaign.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "anyOf": [ + { + "$ref": "#/components/schemas/5_res_create_publication_customer_id" + }, + { + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "6_obj_validation_object": { - "title": "Validation Object", - "description": "This is an object representing a validation.", - "x-tags": [ - "VALIDATIONS API" - ], - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - }, - { - "$ref": "#/components/schemas/6_res_validate_promotion_object" - } - ] - }, - "6_req_validate_voucher": { - "title": "Validate Voucher Request Body", - "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_loyalty_card" - } - ] - }, - "6_req_validate_voucher_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } + ] + }, + "voucher": { + "description": "Code of voucher being published.", + "type": "string" + }, + "campaign": { + "type": "object", + "description": "Contains name of source campaign and number of vouchers to be published.", + "properties": { + "name": { + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`." + }, + "count": { + "type": "string", + "description": "Number of vouchers to be published to customer." } - }, - "6_req_rollback_redemption_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption rollback in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "5_req_create_publication": { + "title": "Create Publication Request Body", + "description": "Request body schema for publishing a voucher.", + "oneOf": [ + { + "$ref": "#/components/schemas/5_req_create_publication_standalone_voucher" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_from_campaign" + } + ] + }, + "5_res_create_publication": { + "title": "Create Publication Response Body", + "type": "object", + "description": "Response schema model for publishing a voucher to a specific customer.", + "properties": { + "id": { + "type": "string", + "example": "pub_BbjAXnmm8e0SIm3zG8qvvFCP0KuLywtp", + "description": "Unique publication ID, assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "publication", + "description": "The type of object represented by the JSON. This object stores information about the `publication`." + }, + "created_at": { + "type": "string", + "example": "2022-09-23T09:57:00.434Z", + "description": "Timestamp representing the date and time when the publication was created in ISO 8601 format.", + "format": "date-time" + }, + "customer_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of the customer receiving the publication." + }, + "tracking_id": { + "type": "string", + "description": "Customer's `source_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + }, + "channel": { + "type": "string", + "description": "How the publication was originated. It can be your own custom channel or an example value provided here.", + "enum": [ + "voucherify-website", + "Dashboard", + "Automation", + "API", + "Braze", + "Reward", + "SMS", + "Email", + "Activecampaign", + "Webhook", + "Intercom", + "Mailchimp", + "Shopify" + ] + }, + "source_id": { + "type": "string", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service. " + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Status of the publication attempt." + }, + "customer": { + "description": "Contains information about the customer to whom the publication was directed.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique customer ID, assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's name." + }, + "email": { + "type": "string", + "description": "Customer's email." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "object": { + "type": "string", + "default": "customer", + "description": "The type of object represented by the JSON. This object stores information about the `customer`." } - }, - "6_req_validate_voucher_customer_id_string": { + } + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "vouchers_id": { + "type": "array", + "description": "Contains the unique internal voucher ID that was assigned by Voucherify.", + "items": { "type": "string", - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "6_req_validate_voucher_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer that validates a voucher. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } - } - }, - "6_req_rollback_redemption_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer that redeemed a resource. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } + "example": "[ v_Bw3qWZWv47yb1Onra8F2LlFI1enLakfA ]" + } + } + } + }, + "5_req_create_publication_campaign_id": { + "title": "Campaign ID", + "type": "object", + "description": "Campaign's unique ID assigned by Voucherify.", + "properties": { + "id": { + "type": "string", + "example": "camp_7AZCZeF1VvD6EHC5anAMtvcK", + "description": "Unique campaign ID, assigned by Voucherify." + } + } + }, + "5_req_create_publication_campaign_name": { + "title": "Campaign's name", + "type": "object", + "description": "Campaign's name.", + "properties": { + "name": { + "type": "string", + "example": "Summer Campaign", + "description": "Campaign's name." + } + } + }, + "5_req_create_publication_campaign": { + "title": "Campaign's name or ID", + "type": "string", + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. " + }, + "5_res_create_publication_customer_id": { + "title": "Customer ID", + "type": "object", + "description": "Customer's unique ID assigned by Voucherify.", + "properties": { + "id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID, assigned by Voucherify." + } + } + }, + "5_res_create_publication_customer_source_id": { + "title": "Customer's Source ID", + "type": "object", + "description": "The merchant’s customer ID.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + } + } + }, + "5_req_create_publication_customer": { + "title": "Source ID or Unique Customer ID", + "type": "string", + "description": "Customer's unique ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`, or the merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "5_obj_publication_object_discount": { + "title": "Discount Voucher", + "type": "object", + "description": "This is an object representing a publication of a discount voucher. ", + "properties": { + "code": { + "type": "string", + "description": "Voucher code." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "6_req_validate_voucher_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." - } + ] + }, + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." + } + } + }, + "5_obj_publication_object_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "This is an object representing a publication of a loyalty card. ", + "properties": { + "code": { + "type": "string", + "description": "Voucher code." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." + }, + "loyalty_card": { + "type": "object", + "description": "Contains information about the loyalty card being published.", + "properties": { + "points": { + "type": "integer", + "description": "The incremental points to be added to the loyalty card as the initial balance on the card." + }, + "balance": { + "type": "integer", + "description": "The points balance after the incremental points are added to the loyalty card." } - }, - "6_req_validate_voucher_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption of this request." - } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." + } + } + }, + "5_obj_publication_object_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "This is an object representing a publication of a gift card. ", + "properties": { + "code": { + "type": "string", + "description": "Voucher code." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the voucher.", + "default": "voucher" + }, + "campaign": { + "type": "string", + "description": "Name of voucher's parent campaign." + }, + "gift": { + "type": "object", + "description": "Contains information about the gift card being published.", + "properties": { + "amount": { + "type": "integer", + "description": "The incremental amount to be added as the initial balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "balance": { + "type": "integer", + "description": "The credit balance on the gift card after the initial incremental amount is added to the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "How the credits are applied to the customer's order." } - }, - "6_req_rollback_redemption_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption rollback of this request." - }, - "status": { - "type": "string", - "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", - "enum": [ - "CREATED", - "PAID", - "FULFILLED" - ] - } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Whether this voucher is a referral code." + } + } + }, + "5_res_list_publications": { + "type": "object", + "description": "Response body schema for listing publications using **GET** `/publications`.", + "title": "List Publications Response Body", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about publications in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "publications", + "description": "Identifies the name of the attribute that contains the array of publications." + }, + "publications": { + "type": "array", + "description": "Contains array of publication objects.", + "items": { + "$ref": "#/components/schemas/5_obj_publication_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of publications." + } + } + }, + "6_obj_validation_object": { + "title": "Validation Object", + "description": "This is an object representing a validation.", + "x-tags": [ + "VALIDATIONS API" + ], + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + }, + { + "$ref": "#/components/schemas/6_res_validate_promotion_object" + } + ] + }, + "6_req_validate_voucher": { + "title": "Validate Voucher Request Body", + "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_loyalty_card" + } + ] + }, + "6_req_validate_voucher_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } + } + }, + "6_req_rollback_redemption_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption rollback in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } + } + }, + "6_req_validate_voucher_customer_id_string": { + "type": "string", + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "6_req_validate_voucher_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer that validates a voucher. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } + } + }, + "6_req_rollback_redemption_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer that redeemed a resource. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } + } + }, + "6_req_validate_voucher_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." + } + } + }, + "6_req_validate_voucher_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption of this request." + } + } + }, + "6_req_rollback_redemption_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption rollback of this request." + }, + "status": { + "type": "string", + "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", + "enum": [ + "CREATED", + "PAID", + "FULFILLED" + ] + } + } + }, + "6_req_rollback_redemption_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption rollback of this request." + }, + "status": { + "type": "string", + "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", + "enum": [ + "CREATED", + "PAID", + "FULFILLED" + ] + } + } + }, + "6_req_validate_voucher_discount_code": { + "title": "Discount Code", + "type": "object", + "description": "Request schema model for validating a discount code voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_discount_code" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "6_req_rollback_redemption_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption rollback of this request." - }, - "status": { - "type": "string", - "description": "After a redemption rollback, Voucherify will default the order status to `CANCELED`. You can set the order status to one of the other options: `CREATED`, `PAID`, `FULFILLED`.", - "enum": [ - "CREATED", - "PAID", - "FULFILLED" - ] - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" } - }, - "6_req_validate_voucher_discount_code": { - "title": "Discount Code", - "type": "object", - "description": "Request schema model for validating a discount code voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_discount_code" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_req_validate_voucher_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Request schema model for validating a gift card voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_gift_card" + }, + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } - }, - "6_req_validate_voucher_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Request schema model for validating a gift card voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_gift_card" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "6_req_validate_voucher_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Request schema model for validating a loyalty card voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" } - }, - "6_req_validate_voucher_unpublished_discount_code": { - "title": "Unpublished Discount Code", - "type": "object", - "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "type": "string" - } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_req_validate_voucher_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Request schema model for validating a loyalty card voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." } - }, - "6_req_session_lock_discount_code": { - "title": "Discount Code Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "6_req_session_lock_gift_card": { - "title": "Gift Card Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_req_validate_voucher_unpublished_discount_code": { + "title": "Unpublished Discount Code", + "type": "object", + "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "properties": { + "session": { + "type": "string" + } + } + }, + "6_req_session_lock_discount_code": { + "title": "Discount Code Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1.", + "enum": [ + "LOCK" + ] + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_req_session_lock_gift_card": { + "title": "Gift Card Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", + "enum": [ + "LOCK" + ] + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_req_session_lock_loyalty_card": { + "title": "Loyalty Card Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", + "enum": [ + "LOCK" + ] + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_res_session_lock_discount_voucher": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. ", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_res_session_lock_gift_card": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_res_session_lock_loyalty_card": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "6_res_validate_voucher_false": { + "type": "object", + "title": "Not Valid", + "description": "Response schema for a voucher that is not valid.", + "examples": [ + { + "valid": false, + "reason": "voucher is disabled", + "error": { + "message": "Voucher has been disabled and is not active anymore." }, - "6_req_session_lock_loyalty_card": { - "title": "Loyalty Card Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "code": "WFf5XAUc", + "metadata": {} + }, + { + "valid": false, + "reason": "Customer must be a holder of a loyalty card.", + "error": { + "message": "You are not the right person." }, - "6_res_session_lock_discount_voucher": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. ", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "code": "3TCjkel8", + "metadata": {} + }, + { + "valid": false, + "reason": "loyalty card points exceeded", + "error": { + "message": "You need more loyalty points to be able to redeem a reward." }, - "6_res_session_lock_gift_card": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1 and the redemption **gift credits** specified within the request.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } + "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", + "code": "pfeDMTsj", + "metadata": {} + }, + { + "valid": false, + "reason": "order does not match validation rules", + "error": { + "code": 400, + "key": "order_rules_violated", + "message": "order does not match validation rules", + "details": "Loyalty Card cannot be redeemed because of violated validation rules: val_RU9fm8GiQaRT", + "request_id": "v-0bcbde194f1305ad88" + }, + "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", + "code": "pfeDMTsj", + "metadata": {} + } + ], + "properties": { + "valid": { + "type": "boolean", + "default": false, + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "reason": { + "type": "string", + "description": "System generated cause for the voucher being invalid in the context of the provided parameters." + }, + "error": { + "type": "object", + "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", + "properties": { + "message": { + "type": "string", + "description": "Customized error message." } - }, - "6_res_session_lock_loyalty_card": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1 and the redemption **loyalty points** specified within the request.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } + } + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "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." + } + } + }, + "6_res_validate_voucher_discount_amount": { + "title": "Amount Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Defines the type of voucher." + }, + "effect": { + "type": "string", + "description": "Defines how the discount is applied to the customer's order.", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" + ] + }, + "amount_off": { + "type": "integer", + "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. " + } + } + }, + "6_res_validate_voucher_discount_percent": { + "title": "Percent Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Defines the type of voucher." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "percent_off": { + "type": "integer", + "description": "The percent discount that the customer will receive." + }, + "amount_limit": { + "type": "integer", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount was calculated using a formula." + } + } + }, + "6_res_validate_voucher_discount_fixed": { + "title": "Fixed Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value. A fixed discounts sets a fixed total on cart or item(s) and then calculates the discount to apply.", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Type of discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order. \n \n| **Effect** | **Definition** |\n|---|---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. |\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is calculated during the redemption and it's a difference between the initial item price and the fixed amount. |" + }, + "fixed_amount": { + "type": "integer", + "description": "Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value." + } + } + }, + "6_res_validate_voucher_discount_unit": { + "title": "Unit Discount, single item", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "oneOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku" + } + ] + }, + "6_res_validate_voucher_discount_unit_product": { + "title": "Unit Discount, Product", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { + "type": "string", + "enum": [ + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "prod_0a9f9ab4ab019a42d5", + "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." + }, + "product": { + "type": "object", + "description": "Contains information about the product.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID, assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product's source ID." + }, + "name": { + "type": "string", + "description": "Product name." } - }, - "6_res_validate_voucher_false": { - "type": "object", - "title": "Not Valid", - "description": "Response schema for a voucher that is not valid.", - "examples": [ + } + } + } + }, + "6_res_validate_voucher_discount_unit_sku": { + "title": "Unit Discount, SKU", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { + "type": "string", + "enum": [ + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." + }, + "sku": { + "type": "object", + "description": "Contains information about the SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "Unique SKU ID, assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product variant's source ID." + }, + "sku": { + "type": "string", + "description": "Product varient's name." + } + } + }, + "product": { + "type": "object", + "description": "Contains information about the parent product.", + "properties": { + "id": { + "type": "string", + "description": "Unique parent product ID, assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "Source ID of parent product." + }, + "name": { + "type": "string", + "description": "Name of parent product." + } + } + } + } + }, + "6_res_validate_voucher_discount_unit_multiple": { + "title": "Unit Discount, multiple items", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { + "type": "string", + "default": "ADD_MANY_ITEMS", + "description": "Defines how the discount is applied to the customer's order." + }, + "units": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku_multiple" + } + ] + } + } + }, + "6_res_validate_voucher_discount_unit_product_multiple": { + "title": "Product Item", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "effect": { + "type": "string", + "enum": [ + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "prod_0a9f9ab4ab019a42d5", + "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." + }, + "product": { + "type": "object", + "description": "Contains information about the product.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID, assigned by Voucherify.", + "example": "prod_0a9f9ab4ab019a42d5" + }, + "source_id": { + "type": "string", + "description": "Product's source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + } + } + }, + "6_res_validate_voucher_discount_unit_sku_multiple": { + "title": "SKU Item", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "effect": { + "type": "string", + "enum": [ + "ADD_MISSING_ITEMS", + "ADD_NEW_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount." + }, + "unit_type": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." + }, + "sku": { + "type": "object", + "description": "Contains information about the SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0bae3b28f610fd0da1", + "description": "Unique SKU ID, assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product variant's source ID." + }, + "sku": { + "type": "string", + "description": "Product varient's name." + } + } + }, + "product": { + "type": "object", + "description": "Contains information about the parent product.", + "properties": { + "id": { + "type": "string", + "description": "Unique parent product ID, assigned by Voucherify.", + "example": "prod_0b7d7dfb05cbe5c616" + }, + "source_id": { + "type": "string", + "description": "Source ID of parent product." + }, + "name": { + "type": "string", + "description": "Name of parent product." + } + } + } + } + }, + "6_res_validate_voucher_discount_shipping": { + "title": "Shipping Discount", + "type": "object", + "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Discount type." + }, + "effect": { + "type": "string", + "description": "Defines how the unit is added to the customer's order.", + "default": "ADD_MISSING_ITEMS" + }, + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount.", + "default": 1 + }, + "unit_type": { + "type": "string", + "description": "The shipping \"product\" deemed as free.", + "default": "prod_5h1pp1ng" + }, + "product": { + "type": "object", + "description": "Contains information about the shipping \"product\".", + "properties": { + "id": { + "type": "string", + "description": "Unique shipping \"product\" ID, assigned by Voucherify.", + "default": "prod_5h1pp1ng" + }, + "source_id": { + "type": "string", + "description": "\"Product's\" source ID.", + "default": "5h1pp1ng" + }, + "name": { + "type": "string", + "description": "\"Product\" name.", + "default": "Shipping" + } + } + } + } + }, + "6_res_validate_voucher": { + "title": "Valid", + "description": "Response schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" + } + ] + }, + "6_res_validate_voucher_discount_code": { + "type": "object", + "title": "Valid - Discount Code", + "description": "Response schema model for validating a discount code using **POST** `/vouchers/{code}/validate`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "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." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." + }, + "session": { + "$ref": "#/components/schemas/6_res_session_lock_discount_voucher" + } + } + }, + "6_res_validate_voucher_gift_card": { + "type": "object", + "title": "Valid - Gift Card", + "description": "Response schema model for validating a gift card using **POST** `/vouchers/{code}/validate`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "gift": { + "type": "object", + "description": "Contains current gift card balance information.", + "properties": { + "amount": { + "type": "integer", + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "balance": { + "type": "integer", + "description": "Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the credits are applied to the customer's order." + } + } + }, + "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." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." + }, + "session": { + "$ref": "#/components/schemas/6_res_session_lock_gift_card" + } + } + }, + "6_res_validate_voucher_loyalty_card": { + "type": "object", + "title": "Valid - Loyalty Card", + "description": "Response schema model for validating a loyalty card using **POST** `/vouchers/{code}/validate`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" + }, + "code": { + "type": "string", + "description": "Voucher code." + }, + "loyalty": { + "type": "object", + "description": "Contains the cost of reward in points.", + "properties": { + "points_cost": { + "type": "integer", + "description": "Number of points that wlil be deducted from loyaty card for the associated reward." + } + } + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that is being validated.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify.", + "example": "rew_Crmu3hu2FKZWZIML59AeAs1n" + }, + "assignment_id": { + "type": "string", + "example": "rewa_xZr6Ks0j5AHeMRVdELmpI9sc", + "description": "Unique reward assignment ID assigned by Voucherify." + }, + "points": { + "type": "integer", + "description": "Number of points applied to the reward." + } + } + }, + "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." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-04T00:00:00.000Z", + "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-10-31T00:00:00.000Z", + "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", + "description": "Voucher's parent campaign's unique ID." + }, + "session": { + "$ref": "#/components/schemas/6_res_session_lock_loyalty_card" + } + } + }, + "6_res_applicable_to_object": { + "title": "Included Items", + "type": "object", + "description": "Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.", + "properties": { + "data": { + "type": "array", + "description": "Contains array of items to which the discount can apply.", + "items": { + "anyOf": [ { - "valid": false, - "reason": "voucher is disabled", - "error": { - "message": "Voucher has been disabled and is not active anymore." - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "code": "WFf5XAUc", - "metadata": {} + "$ref": "#/components/schemas/6_res_product_collection" }, { - "valid": false, - "reason": "Customer must be a holder of a loyalty card.", - "error": { - "message": "You are not the right person." - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "code": "3TCjkel8", - "metadata": {} + "$ref": "#/components/schemas/6_res_product_collection_unit" }, { - "valid": false, - "reason": "loyalty card points exceeded", - "error": { - "message": "You need more loyalty points to be able to redeem a reward." - }, - "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", - "code": "pfeDMTsj", - "metadata": {} + "$ref": "#/components/schemas/6_res_product_collection_fixed_amount" }, { - "valid": false, - "reason": "order does not match validation rules", - "error": { - "code": 400, - "key": "order_rules_violated", - "message": "order does not match validation rules", - "details": "Loyalty Card cannot be redeemed because of violated validation rules: val_RU9fm8GiQaRT", - "request_id": "v-0bcbde194f1305ad88" - }, - "tracking_id": "track_QjgJ4Z5Gv10OpRCXZM8cMIOPCB1PNuli", - "code": "pfeDMTsj", - "metadata": {} - } - ], - "properties": { - "valid": { - "type": "boolean", - "default": false, - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "reason": { - "type": "string", - "description": "System generated cause for the voucher being invalid in the context of the provided parameters." - }, - "error": { - "type": "object", - "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", - "properties": { - "message": { - "type": "string", - "description": "Customized error message." - } - } + "$ref": "#/components/schemas/6_res_product" }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." + { + "$ref": "#/components/schemas/6_res_product_unit" }, - "code": { - "type": "string", - "description": "Voucher code." + { + "$ref": "#/components/schemas/6_res_product_fixed_amount" }, - "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." - } - } - }, - "6_res_validate_voucher_discount_amount": { - "title": "Amount Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Defines the type of voucher." + { + "$ref": "#/components/schemas/6_res_sku" }, - "effect": { - "type": "string", - "description": "Defines how the discount is applied to the customer's order.", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ] + { + "$ref": "#/components/schemas/6_res_sku_unit" }, - "amount_off": { - "type": "integer", - "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. " + { + "$ref": "#/components/schemas/6_res_sku_unit_fixed_amount" } - } - }, - "6_res_validate_voucher_discount_percent": { - "title": "Percent Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "PERCENT", - "description": "Defines the type of voucher." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "percent_off": { - "type": "integer", - "description": "The percent discount that the customer will receive." - }, - "amount_limit": { - "type": "integer", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount was calculated using a formula." - } - } - }, - "6_res_validate_voucher_discount_fixed": { - "title": "Fixed Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value. A fixed discounts sets a fixed total on cart or item(s) and then calculates the discount to apply.", - "properties": { - "type": { - "type": "string", - "default": "FIXED", - "description": "Type of discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order. \n \n| **Effect** | **Definition** |\n|---|---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. |\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is calculated during the redemption and it's a difference between the initial item price and the fixed amount. |" + ] + } + }, + "total": { + "type": "integer", + "description": "Total number of objects defining included products, SKUs, or product collections." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of included objects." + }, + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary." + } + } + }, + "6_res_inapplicable_to_object": { + "title": "Excluded Items", + "type": "object", + "description": "Contains list of items that **do not** qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These **CANNOT** be discounted.", + "properties": { + "data": { + "description": "Contains array of items to which the discount cannot apply.", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_product_collection_excluded" }, - "fixed_amount": { - "type": "integer", - "description": "Set a fixed valued for an order total or price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000. In case of the fixed amount being calculated by the formula, i.e. the `fixed_amount_formula` parameter is present in the fixed amount definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed value." - } - } - }, - "6_res_validate_voucher_discount_unit": { - "title": "Unit Discount, single item", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "oneOf": [ { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product" + "$ref": "#/components/schemas/6_res_product_excluded" }, { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku" + "$ref": "#/components/schemas/6_res_sku_excluded" } ] - }, - "6_res_validate_voucher_discount_unit_product": { - "title": "Unit Discount, Product", + } + }, + "total": { + "type": "integer", + "description": "Total number of objects defining excluded products, SKUs, or product collections." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of excluded objects." + }, + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary." + } + } + }, + "6_res_product_collection": { + "title": "Product Collection", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product_collection_unit": { + "title": "Product Collection for Unit Discount", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted per order line item." + }, + "aggregated_quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + } + } + }, + "6_res_product_collection_fixed_amount": { + "title": "Product Collection for Fixed Amount Discount", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "price": { + "type": "integer", + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + }, + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "\"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product_collection_excluded": { + "title": "Product Collection", + "type": "object", + "description": "Contains definition for a product collection.", + "properties": { + "object": { + "type": "string", + "default": "products_collection", + "description": "This object stores information about the product collection." + }, + "id": { + "type": "string", + "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "description": "Unique product collection ID assigned by Voucherify." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_sku": { + "title": "SKU", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_sku_unit": { + "title": "SKU for Unit Discount", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted per order line item." + }, + "aggregated_quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + } + } + }, + "6_res_sku_unit_fixed_amount": { + "title": "SKU for Amount Discount", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "product_id": { + "type": "string", + "description": "Parent product's unique ID assigned by Voucherify." + }, + "product_source_id": { + "type": "string", + "description": "Parent product's source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "price": { + "type": "integer", + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + }, + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_sku_excluded": { + "title": "SKU", + "type": "object", + "description": "Contains definition for a product variant.", + "properties": { + "object": { + "type": "string", + "default": "sku", + "description": "This object stores information about the product variant." + }, + "id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify.", + "example": "sku_0b7d7dfb090be5c619" + }, + "source_id": { + "type": "string", + "description": "The source ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product": { + "title": "Product", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This object stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product_unit": { + "title": "Product for Unit Discount", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This object stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted per order line item." + }, + "aggregated_quantity_limit": { + "type": "integer", + "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + } + } + }, + "6_res_product_fixed_amount": { + "title": "Product for Fixed Amount Discount", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This object stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "price": { + "type": "integer", + "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + }, + "price_formula": { + "type": "string", + "description": "Formula used to calculate the discounted price of an item.", + "example": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_res_product_excluded": { + "title": "Product", + "type": "object", + "description": "Contains definition for a product.", + "properties": { + "object": { + "type": "string", + "default": "product", + "description": "This product stores information about the product." + }, + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0bae2dc5a090fd0184" + }, + "source_id": { + "type": "string", + "description": "The product ID from your inventory system." + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Defines how the discount is applied to the customer's order." + } + } + }, + "6_obj_order_object": { + "title": "Order object", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "oneOf": [ + { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" + }, + { + "$ref": "#/components/schemas/6_obj_order_object_apply_to_items" + } + ] + }, + "6_obj_order_object_apply_to_order": { + "type": "object", + "title": "Order object - Effect: Apply to order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "status": { + "type": "string", + "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the order-level discount applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "This field sums up all order-level discounts applied to the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", "properties": { - "type": { + "object": { "type": "string", - "default": "UNIT", - "description": "Discount type." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "effect": { + "product_id": { "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "unit_off": { + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { "type": "integer", - "description": "Number of units to be granted a full value discount." + "description": "Quantity of the item in the cart." }, - "unit_type": { - "type": "string", - "example": "prod_0a9f9ab4ab019a42d5", - "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" }, "product": { "type": "object", - "description": "Contains information about the product.", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "description": "Unique product ID, assigned by Voucherify." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "Product's source ID." + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, "name": { "type": "string", + "example": "Brewing System", "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - } - } - }, - "6_res_validate_voucher_discount_unit_sku": { - "title": "Unit Discount, SKU", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." }, "sku": { "type": "object", - "description": "Contains information about the SKU.", + "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "Unique SKU ID, assigned by Voucherify." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "Product variant's source ID." + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, "sku": { "type": "string", - "description": "Product varient's name." - } - } - }, - "product": { - "type": "object", - "description": "Contains information about the parent product.", - "properties": { - "id": { - "type": "string", - "description": "Unique parent product ID, assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "Source ID of parent product." + "description": "SKU name." }, - "name": { - "type": "string", - "description": "Name of parent product." + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } } } - }, - "6_res_validate_voucher_discount_unit_multiple": { - "title": "Unit Discount, multiple items", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." - }, - "effect": { - "type": "string", - "default": "ADD_MANY_ITEMS", - "description": "Defines how the discount is applied to the customer's order." - }, - "units": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_product_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_sku_multiple" - } - ] - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "6_res_validate_voucher_discount_unit_product_multiple": { - "title": "Product Item", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." - }, - "unit_type": { - "type": "string", - "example": "prod_0a9f9ab4ab019a42d5", - "description": "The product deemed as free, chosen from product inventory (e.g. time, items)." - }, - "product": { - "type": "object", - "description": "Contains information about the product.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID, assigned by Voucherify.", - "example": "prod_0a9f9ab4ab019a42d5" - }, - "source_id": { - "type": "string", - "description": "Product's source ID." - }, - "name": { - "type": "string", - "description": "Product name." - } - } - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." } - }, - "6_res_validate_voucher_discount_unit_sku_multiple": { - "title": "SKU Item", + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "6_obj_order_object_apply_to_items": { + "type": "object", + "title": "Order object - Effect: Apply to items", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + }, + "status": { + "type": "string", + "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Product-specifc discounts applied to all the items." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Product-specific discounts applied in the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", "properties": { - "effect": { + "object": { "type": "string", - "enum": [ - "ADD_MISSING_ITEMS", - "ADD_NEW_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount." + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "unit_type": { + "sku_id": { "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "The product variant deemed as free, chosen from product inventory (e.g. time, items)." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "sku": { - "type": "object", - "description": "Contains information about the SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_0bae3b28f610fd0da1", - "description": "Unique SKU ID, assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product variant's source ID." - }, - "sku": { - "type": "string", - "description": "Product varient's name." - } - } + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "product": { - "type": "object", - "description": "Contains information about the parent product.", - "properties": { - "id": { - "type": "string", - "description": "Unique parent product ID, assigned by Voucherify.", - "example": "prod_0b7d7dfb05cbe5c616" - }, - "source_id": { - "type": "string", - "description": "Source ID of parent product." - }, - "name": { - "type": "string", - "description": "Name of parent product." - } - } - } - } - }, - "6_res_validate_voucher_discount_shipping": { - "title": "Shipping Discount", - "type": "object", - "description": "This is an object representing the discount that the customer would receive in the context of the provided request body parameters. If the discount is calculated based on a formula, this object will return either the discount calculated based on the formula or the fallback value.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Discount type." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "effect": { - "type": "string", - "description": "Defines how the unit is added to the customer's order.", - "default": "ADD_MISSING_ITEMS" + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." }, - "unit_off": { + "applied_discount_amount": { "type": "integer", - "description": "Number of units to be granted a full value discount.", - "default": 1 + "description": "The item-level discount applied to the item." }, - "unit_type": { - "type": "string", - "description": "The shipping \"product\" deemed as free.", - "default": "prod_5h1pp1ng" + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" }, "product": { "type": "object", - "description": "Contains information about the shipping \"product\".", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "description": "Unique shipping \"product\" ID, assigned by Voucherify.", - "default": "prod_5h1pp1ng" + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "\"Product's\" source ID.", - "default": "5h1pp1ng" + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, "name": { "type": "string", - "description": "\"Product\" name.", - "default": "Shipping" - } - } - } - } - }, - "6_res_validate_voucher": { - "title": "Valid", - "description": "Response schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" - } - ] - }, - "6_res_validate_voucher_discount_code": { - "type": "object", - "title": "Valid - Discount Code", - "description": "Response schema model for validating a discount code using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_discount_voucher" - } - } - }, - "6_res_validate_voucher_gift_card": { - "type": "object", - "title": "Valid - Gift Card", - "description": "Response schema model for validating a gift card using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "gift": { - "type": "object", - "description": "Contains current gift card balance information.", - "properties": { - "amount": { - "type": "integer", - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "description": "Available funds. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + "example": "Brewing System", + "description": "Product name." }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the credits are applied to the customer's order." - } - } - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_gift_card" - } - } - }, - "6_res_validate_voucher_loyalty_card": { - "type": "object", - "title": "Valid - Loyalty Card", - "description": "Response schema model for validating a loyalty card using **POST** `/vouchers/{code}/validate`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the voucher is valid within the context of the parameters provided in the request body." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" - }, - "code": { - "type": "string", - "description": "Voucher code." - }, - "loyalty": { - "type": "object", - "description": "Contains the cost of reward in points.", - "properties": { - "points_cost": { + "price": { "type": "integer", - "description": "Number of points that wlil be deducted from loyaty card for the associated reward." + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "reward": { + "sku": { "type": "object", - "description": "Contains information about the reward that is being validated.", + "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "description": "Unique reward ID assigned by Voucherify.", - "example": "rew_Crmu3hu2FKZWZIML59AeAs1n" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "assignment_id": { + "source_id": { "type": "string", - "example": "rewa_xZr6Ks0j5AHeMRVdELmpI9sc", - "description": "Unique reward assignment ID assigned by Voucherify." + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - "points": { + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { "type": "integer", - "description": "Number of points applied to the reward." + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "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." - }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-04T00:00:00.000Z", - "description": "Activation timestamp defines when the voucher starts to be active in ISO 8601 format. Voucher is _inactive_ before this date." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-10-31T00:00:00.000Z", - "description": "Expiration timestamp defines when the voucher expires in ISO 8601 format. Voucher is _inactive_ after this date." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "example": "camp_W8DJVd8J0btqXT6FBwn7BSkC", - "description": "Voucher's parent campaign's unique ID." - }, - "session": { - "$ref": "#/components/schemas/6_res_session_lock_loyalty_card" - } - } - }, - "6_res_applicable_to_object": { - "title": "Included Items", - "type": "object", - "description": "Contains list of items that qualify in the scope of the discount. These are definitions of included products, SKUs, and product collections. These can be discounted.", - "properties": { - "data": { - "type": "array", - "description": "Contains array of items to which the discount can apply.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_product_collection" - }, - { - "$ref": "#/components/schemas/6_res_product_collection_unit" - }, - { - "$ref": "#/components/schemas/6_res_product_collection_fixed_amount" - }, - { - "$ref": "#/components/schemas/6_res_product" - }, - { - "$ref": "#/components/schemas/6_res_product_unit" - }, - { - "$ref": "#/components/schemas/6_res_product_fixed_amount" - }, - { - "$ref": "#/components/schemas/6_res_sku" - }, - { - "$ref": "#/components/schemas/6_res_sku_unit" - }, - { - "$ref": "#/components/schemas/6_res_sku_unit_fixed_amount" - } - ] - } - }, - "total": { - "type": "integer", - "description": "Total number of objects defining included products, SKUs, or product collections." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of included objects." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about included products, SKUs, or product collections in a dictionary." } } - }, - "6_res_inapplicable_to_object": { - "title": "Excluded Items", - "type": "object", - "description": "Contains list of items that **do not** qualify in the scope of the discount. These are definitions of excluded products, SKUs, and product collections. These **CANNOT** be discounted.", - "properties": { - "data": { - "description": "Contains array of items to which the discount cannot apply.", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_product_collection_excluded" - }, - { - "$ref": "#/components/schemas/6_res_product_excluded" - }, - { - "$ref": "#/components/schemas/6_res_sku_excluded" - } - ] - } - }, - "total": { - "type": "integer", - "description": "Total number of objects defining excluded products, SKUs, or product collections." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of excluded objects." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about excluded products, SKUs, or product collections in a dictionary." - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "6_res_product_collection": { - "title": "Product Collection", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." } - }, - "6_res_product_collection_unit": { - "title": "Product Collection for Unit Discount", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." - }, - "aggregated_quantity_limit": { - "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." - } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "6_query_validate_voucher_client_side_orders_order_item": { + "type": "object", + "title": "Order Item", + "description": "This object represents an order line item.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "related_object": { + "type": "string", + "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." + }, + "product_id": { + "type": "string", + "description": "A unique product ID assigned by Voucherify.", + "example": "prod_0a7e62db1fca8322a2" + }, + "sku_id": { + "type": "string", + "description": "A unique SKU ID assigned by Voucherify.", + "example": "sku_0a41e31c7b41c28358" + }, + "quantity": { + "type": "string", + "description": "The quantity of the particular item in the cart." + }, + "price": { + "type": "string", + "description": "The unit price of the item." + }, + "amount": { + "type": "string", + "description": "The total amount of the order item (`price` * `quantity`)." + } + } + }, + "6_req_validate_promotion": { + "title": "Validate Promotion Request Body", + "type": "object", + "description": "Request schema model for validating a promotion using **POST** `/promotions/validation`.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "6_res_product_collection_fixed_amount": { - "title": "Product Collection for Fixed Amount Discount", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "price": { - "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." - }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "\"IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" } - }, - "6_res_product_collection_excluded": { - "title": "Product Collection", - "type": "object", - "description": "Contains definition for a product collection.", - "properties": { - "object": { - "type": "string", - "default": "products_collection", - "description": "This object stores information about the product collection." - }, - "id": { - "type": "string", - "example": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "description": "Unique product collection ID assigned by Voucherify." - }, - "strict": { - "type": "boolean" - }, - "effect": { + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { "type": "string", "enum": [ - "APPLY_TO_EVERY" + "category" ], - "description": "Defines how the discount is applied to the customer's order." + "example": "category" } } - }, - "6_res_sku": { - "title": "SKU", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "product_id": { - "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." - }, - "product_source_id": { - "type": "string", - "description": "Parent product's source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } + } + } + } + }, + "6_res_validate_promotion": { + "title": "Validate Promotion Response Body", + "type": "object", + "description": "Response schema model for validating a promotion using **POST** `/promotions/validation`.", + "properties": { + "valid": { + "type": "boolean", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "promotions": { + "type": "array", + "description": "Contains an array of promotion tier objects.", + "items": { + "$ref": "#/components/schemas/6_res_validate_promotion_object" + } + } + } + }, + "6_res_validate_promotion_object": { + "title": "Validate Promotion", + "type": "object", + "description": "Validate Promotion", + "properties": { + "valid": { + "type": "string", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "id": { + "type": "string", + "example": "promo_4TqHr24boFISDrcOHSlfAxwm", + "description": "Unique promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 45% off items" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" } - }, - "6_res_sku_unit": { - "title": "SKU for Unit Discount", + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + }, + "campaign": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "description": "Unique promotion tier ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "example": "2022-11-01T00:00:00.000Z", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z", + "format": "date-time" + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by the campaign object. This object stores information about the campaign." + } + } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "discount_amount": { + "type": "integer", + "description": "The calculated discount amount based on the discount type and effect." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The effective discount amount that would be applied to the order." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + }, + "category_id": { + "type": "string", + "description": "Promotion tier category ID.", + "example": "cat_0c9da30e7116ba6bba" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object", + "description": "Details about the category assigned to the promotion tier." + } + } + }, + "6_req_validate_promotion_tier": { + "title": "Validate Promotion Tier Request Body", + "type": "object", + "description": "Request schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "6_res_validate_promotion_tier": { + "title": "Validate Promotion Tier Response Body", + "description": "Response schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_true" + }, + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_false" + } + ] + }, + "6_res_validate_promotion_tier_true": { + "title": "Promotion Tier Valid", + "type": "object", + "description": "Response schema model for valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "properties": { + "valid": { + "type": "string", + "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "order": { + "$ref": "#/components/schemas/6_obj_order_object" + }, + "id": { + "type": "string", + "example": "promo_4TqHr24boFISDrcOHSlfAxwm", + "description": "Unique promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 45% off items" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + }, + "campaign": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "description": "Unique promotion tier ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "example": "2022-11-01T00:00:00.000Z", + "format": "date-time" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z", + "format": "date-time" + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by the campaign object. This object stores information about the campaign." + } + } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "discount_amount": { + "type": "integer", + "description": "The calculated discount amount based on the discount type and effect." + }, + "applied_discount_amount": { + "type": "integer", + "description": "The effective discount amount that would be applied to the order." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "object": { + "type": "string", + "default": "promotion_tier", + "description": "The type of object represented by JSON. This object stores information about the promotion tier." + } + } + }, + "6_res_validate_promotion_tier_false": { + "type": "object", + "description": "Response schema model for a non-valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", + "title": "Promotion Tier Not Valid", + "properties": { + "valid": { + "type": "boolean", + "description": "Response schema for a voucher that is not valid." + }, + "reason": { + "type": "string", + "description": "System generated cause for the voucher being invalid in the context of the provided parameters." + }, + "error": { + "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_promotion_tier_false_custom_message" + }, + { + "$ref": "#/components/schemas/e_error_no_translation" + } + ] + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID." + }, + "id": { + "type": "string", + "example": "promo_ByIIAHC1Mz9ouJsitzAWsush", + "description": "Promotion tier ID." + }, + "name": { + "type": "string", + "description": "Custom promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website.", + "example": "Get 25% off" + }, + "discount": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" + } + ], + "description": "Contains information about the discount to be applied to the order." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "format": "date-time", + "example": "2022-11-02T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "format": "date-time", + "example": "2022-11-04T00:00:00.000Z" + }, + "campaign": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID." + }, + "start_date": { + "type": "string", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", + "format": "date-time", + "example": "2022-11-01T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", + "example": "2022-11-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "object": { + "type": "string", + "description": "The type of object represented by the campaign object. This object stores information about the campaign.", + "default": "campaign" + } + } + }, + "hierarchy": { + "type": "integer", + "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the promotion tier.", + "default": "promotion_tier" + } + } + }, + "6_res_validate_promotion_tier_false_custom_message": { + "type": "object", + "description": "Custom Error Message", + "title": "Custom Message", + "properties": { + "message": { + "type": "string", + "description": "Customized error message." + } + } + }, + "19_req_session_lock": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", + "properties": { + "type": { + "type": "string", + "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** and **loyalty points** specified within the request.", + "enum": [ + "LOCK" + ] + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "19_res_session_lock": { + "title": "Session Lock", + "type": "object", + "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", + "properties": { + "type": { + "type": "string", + "description": "This session locks the redemption **quantity** by 1.", + "default": "LOCK" + }, + "key": { + "type": "string", + "description": "The session unique ID assigned by Voucherify or your own unique session ID.", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "ttl_unit": { + "type": "string", + "description": "Defines the type of unit in which the session time is counted.", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "ttl": { + "type": "integer", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + } + } + }, + "19_obj_order_object_rollback_stacked": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { "type": "object", - "description": "Contains definition for a product variant.", "properties": { "object": { "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, "product_id": { "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "product_source_id": { + "sku_id": { "type": "string", - "description": "Parent product's source ID from your inventory system." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "strict": { - "type": "boolean" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "quantity_limit": { + "price": { "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "aggregated_quantity_limit": { + "subtotal_amount": { "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." + "description": "Final order item amount after the removing an item-level discount." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } } } - }, - "6_res_sku_unit_fixed_amount": { - "title": "SKU for Amount Discount", + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption and redemption rollback.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption rollback of incentives.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "rollback_id": { + "type": "string", + "description": "Unique ID of the redemption rollback.", + "example": "rr_0c63c84eb78ee0a6c0" + }, + "rollback_date": { + "type": "string", + "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", + "example": "2023-01-31T14:18:37.150Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the redemption is a `redemption` because this rollback is in the context of a stacked redemption.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the parent redemption.", + "example": "r_0ba186c4824e4881e1" + }, + "stacked": { + "type": "array", + "description": "Lists the stacked redemption IDs in the initial redemption request.", + "items": { + "type": "string" + } + }, + "rollback_stacked": { + "type": "array", + "description": "Lists the rollback redemption IDs of the particular child redemptions.", + "items": { + "type": "string" + } + } + } + } + } + } + } + }, + "19_obj_order_object_rollback_stacked_per_redemption_apply_to_order": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { "type": "object", - "description": "Contains definition for a product variant.", "properties": { "object": { "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, "product_id": { "type": "string", - "description": "Parent product's unique ID assigned by Voucherify." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "product_source_id": { + "sku_id": { "type": "string", - "description": "Parent product's source ID from your inventory system." - }, - "strict": { - "type": "boolean" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "price": { + "quantity": { "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." + "description": "Quantity of the item in the cart." }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.2;6)" + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_sku_excluded": { - "title": "SKU", - "type": "object", - "description": "Contains definition for a product variant.", - "properties": { - "object": { - "type": "string", - "default": "sku", - "description": "This object stores information about the product variant." - }, - "id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify.", - "example": "sku_0b7d7dfb090be5c619" - }, - "source_id": { - "type": "string", - "description": "The source ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Defines how the discount is applied to the customer's order." - } - } - }, - "6_res_product": { - "title": "Product", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "6_res_product_unit": { - "title": "Product for Unit Discount", + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "19_obj_order_object_rollback_stacked_per_redemption_apply_to_items": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back for a stacked redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order.`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { "type": "object", - "description": "Contains definition for a product.", "properties": { "object": { "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "source_id": { + "product_id": { "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "effect": { + "sku_id": { "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "quantity_limit": { + "quantity": { "type": "integer", - "description": "The maximum number of units allowed to be discounted per order line item." + "description": "Quantity of the item in the cart." }, - "aggregated_quantity_limit": { + "amount": { "type": "integer", - "description": "The maximum number of units allowed to be discounted combined across all matched order line items." - } - } - }, - "6_res_product_fixed_amount": { - "title": "Product for Fixed Amount Discount", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This object stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." - }, - "strict": { - "type": "boolean" + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, "price": { "type": "integer", - "description": "New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the `price_formula` parameter is present in the fixed price definition, this value becomes the **fallback value**. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price." - }, - "price_formula": { - "type": "string", - "description": "Formula used to calculate the discounted price of an item.", - "example": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)" + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "effect": { + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "19_req_redeemables_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Redeem a gift card.", + "properties": { + "id": { + "type": "string", + "description": "Unique gift card code." + }, + "object": { + "type": "string", + "description": "Type of object, i.e. `voucher`.", + "default": "voucher" + }, + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfill the order. The value of credits cannot be higher than the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + }, + "required": [ + "object", + "id" + ] + }, + "19_req_redeemables_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Redeem a loyalty card.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty card code." + }, + "object": { + "type": "string", + "description": "Type of object, i.e. `voucher`.", + "default": "voucher" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", + "example": "rew_EPx1hCTpqzF0HW1z9NKckZH4" + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order using a **pay with points** reward. The number of points cannot be higher than the current balance on the loyalty card." + } + } + } + }, + "required": [ + "object", + "id", + "reward" + ] + }, + "19_req_redeemables_discount_referral_promotion_tier_promotion_stack": { + "title": "Discount code, referral code, promotion tier, promotion stack", + "type": "object", + "description": "Redeem a discount code, referral code, promotion tier, or promotion stack.", + "properties": { + "object": { + "type": "string", + "description": "Redeemable object type.", + "enum": [ + "voucher", + "promotion_tier", + "promotion_stack" + ], + "default": "voucher" + }, + "id": { + "type": "string", + "description": "Redeemable code or unique ID such as: \n- discount code, referral code: `DiscountCode100`, `v_6ZPI2BLMtpc6zz8pQVjQgxJH3D4ac3ZT` \n- promotion tier: `promo_Mwy9XpA0TLctSGriM5kum0qp` \n- promotion stack: `stack_KxSD0GahLUg9ULB6TseGfUHJ` " + } + }, + "required": [ + "object", + "id" + ] + }, + "19_req_redemptions": { + "title": "Redeem Stackable Discounts Request Body", + "type": "object", + "description": "This data model represents the request body for redeeming multiple incentives.", + "properties": { + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", + "items": { "type": "string", "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Defines how the discount is applied to the customer's order." + "order", + "redemption", + "redeemable", + "category" + ] } } - }, - "6_res_product_excluded": { - "title": "Product", - "type": "object", - "description": "Contains definition for a product.", - "properties": { - "object": { - "type": "string", - "default": "product", - "description": "This product stores information about the product." - }, - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0bae2dc5a090fd0184" - }, - "source_id": { - "type": "string", - "description": "The product ID from your inventory system." + } + }, + "redeemables": { + "type": "array", + "minItems": 1, + "maxItems": 5, + "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" }, - "strict": { - "type": "boolean" + { + "$ref": "#/components/schemas/19_req_redeemables_gift_card" }, - "effect": { + { + "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" + } + ] + } + }, + "session": { + "$ref": "#/components/schemas/19_req_session_lock" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." + } + }, + "required": [ + "redeemables" + ] + }, + "19_req_validations": { + "title": "Validate Stackable Discounts Request Body", + "type": "object", + "description": "This data model represents the request body for the `/validations` endpoint.", + "properties": { + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata not included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "items": { "type": "string", "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Defines how the discount is applied to the customer's order." + "order", + "redemption", + "redeemable", + "category" + ] } } - }, - "6_obj_order_object": { - "title": "Order object", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "oneOf": [ + } + }, + "redeemables": { + "type": "array", + "minItems": 1, + "maxItems": 5, + "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" + }, { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_order" + "$ref": "#/components/schemas/19_req_redeemables_gift_card" }, { - "$ref": "#/components/schemas/6_obj_order_object_apply_to_items" + "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" } ] - }, - "6_obj_order_object_apply_to_order": { + } + }, + "session": { + "$ref": "#/components/schemas/19_req_session_lock" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." + } + }, + "required": [ + "redeemables" + ] + }, + "19_res_validations": { + "title": "Validate Stackable Discounts Response Body", + "description": "Response body schema for POST `/validations`.", + "oneOf": [ + { + "$ref": "#/components/schemas/19_res_validations-true" + }, + { + "$ref": "#/components/schemas/19_res_validations-false" + } + ] + }, + "19_res_validations-false": { + "type": "object", + "title": "False", + "description": "Response body schema for POST `/validations`.", + "properties": { + "valid": { + "type": "boolean", + "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", + "default": false + }, + "redeemables": { + "type": "array", + "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", + "items": { "type": "object", - "title": "Order object - Effect: Apply to order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "created_at": { + "status": { "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + "enum": [ + "APPLICABLE", + "INAPPLICABLE", + "SKIPPED" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules. `SKIPPED` indicates that the validation stopped once it identified at least one unapplicable redeemable and did not continue to validate the given redeemable." }, - "updated_at": { + "id": { "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." + "description": "Redeemable ID, i.e. the voucher code." }, - "status": { + "object": { "type": "string", - "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", + "description": "Redeemable's object type.", "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" + "voucher", + "promotion_tier", + "promotion_stack" ] }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the order-level discount applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "This field sums up all order-level discounts applied to the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { + "result": { "type": "object", - "description": "Object containing information about the customer that is making the purchase.", + "description": "Provides details for an inapplicable redeemable.", "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." + "error": { + "$ref": "#/components/schemas/e_error" } } }, - "referrer": { + "metadata": { "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" } } - }, - "6_obj_order_object_apply_to_items": { - "type": "object", - "title": "Order object - Effect: Apply to items", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "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. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format. This parameter is returned only if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body." - }, - "status": { - "type": "string", - "description": "Order status. This parameter is returned if you use the order ID parameter of an already created and synced order in the Voucherify application, i.e by sending the `order.id` parameter in the request body or if you send the request body parameter when defining an order in the request body. This parameter can be passed but it's not required for validation at all. It's used in the redemption process. Normally after the redemption is done, the order is automatically to a `PAID` status. To avoid such default behaviour, the user can pass any of the other status options and it will be set the order status after the redemption instead of the default `PAID`.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Product-specifc discounts applied to all the items." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Product-specific discounts applied in the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } + } + }, + "tracking_id": { + "type": "string", + "example": "track_VAVo1/z+G2GI2LPw==", + "description": "Hashed customer source ID." + } + } + }, + "19_res_validations_redeemables_discount_voucher": { + "type": "object", + "description": "Response schema model for validating a discount code.", + "title": "Discount Voucher", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the voucher code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_validation_res_per_redeemable" + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_voucher_code" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + }, + "19_res_validations_redeemables_gift_card": { + "type": "object", + "description": "Response schema model for validating a gift card.", + "title": "Gift Card", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the gift card code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_gift_card" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + }, + "19_res_validations_redeemables_loyalty_card": { + "type": "object", + "description": "Response schema model for validating a loyalty card.", + "title": "Loyalty Card", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the loyalty card code." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "voucher" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_loyalty_card" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + }, + "19_res_validations_redeemables_promotion_tier": { + "type": "object", + "description": "Response schema model for validating a promotion tier.", + "title": "Promotion Tier", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the promotion tier ID." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "promotion_tier" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_tier" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + }, + "19_res_validations_redeemables_promotion_stack": { + "type": "object", + "description": "Response schema model for validating a promotion stack.", + "title": "Promotion Stack", + "properties": { + "status": { + "type": "string", + "enum": [ + "APPLICABLE" + ], + "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + }, + "id": { + "type": "string", + "description": "Redeemable ID, i.e. the promotion stack ID." + }, + "object": { + "type": "string", + "description": "Redeemable's object type.", + "enum": [ + "promotion_stack" + ] + }, + "applicable_to": { + "$ref": "#/components/schemas/6_res_applicable_to_object" + }, + "inapplicable_to": { + "$ref": "#/components/schemas/6_res_inapplicable_to_object" + }, + "result": { + "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", + "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_stack" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + } + } + }, + "19_res_validations-true": { + "type": "object", + "title": "True", + "description": "Response body schema for POST `/validations`.", + "properties": { + "valid": { + "type": "boolean", + "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", + "default": true + }, + "redeemables": { + "type": "array", + "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_res_validations_redeemables_discount_voucher" }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } + { + "$ref": "#/components/schemas/19_res_validations_redeemables_gift_card" }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + { + "$ref": "#/components/schemas/19_res_validations_redeemables_loyalty_card" }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." + { + "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_tier" }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." + { + "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_stack" } + ] + } + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_validation_res" + }, + "tracking_id": { + "type": "string", + "example": "track_VAVo1/z+G2GI2LPw==", + "description": "Hashed customer source ID." + }, + "session": { + "$ref": "#/components/schemas/19_res_session_lock" + } + } + }, + "19_obj_validations-true_result_voucher_code": { + "type": "object", + "title": "Coupon Code", + "description": "This is a `result` object representing the results for a coupon code.", + "properties": { + "discount": { + "description": "Discount details about the type of discount to be applied for the redeemable.", + "oneOf": [ + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount_dynamic" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage_dynamic" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_order" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_items" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/19_obj_voucher_object_discount_shipping" } - }, - "6_query_validate_voucher_client_side_orders_order_item": { + ] + } + } + }, + "19_obj_voucher_object_discount_amount": { + "title": "Static Amount", + "type": "object", + "description": "Amount discount type based on a static value.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Applies an amount discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "amount_off": { + "type": "integer", + "example": 100, + "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", + "enum": [ + false + ] + } + } + }, + "19_obj_voucher_object_discount_amount_dynamic": { + "title": "Dynamic Amount", + "type": "object", + "description": "Amount discount type based on a formula.", + "properties": { + "type": { + "type": "string", + "default": "AMOUNT", + "description": "Applies an amount discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS", + "APPLY_TO_ITEMS_PROPORTIONALLY", + "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", + "APPLY_TO_ITEMS_BY_QUANTITY" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", + "enum": [ + true + ] + } + } + }, + "19_obj_voucher_object_discount_percentage": { + "title": "Percentage", + "type": "object", + "description": "Percentage discount type applied to an order (static or dynamic) or a percentage discount type applied to items (static).", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Applies a percentage discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "percent_off": { + "type": "integer", + "description": "Percent taken off the subtotal amount. In case of the percent being calculated by the formula and applied to the order level, i.e. the `is_dynamic` parameter is `true`, this value becomes a dynamically calculated value that varies based on the formula.", + "minimum": 0, + "maximum": 100 + }, + "amount_limit": { + "type": "string", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", + "enum": [ + false, + true + ] + } + } + }, + "19_obj_voucher_object_discount_percentage_dynamic": { + "title": "Dynamic Percentage for Items", + "type": "object", + "description": "Percentage discount type applied to items and based on a formula (dynamic).", + "properties": { + "type": { + "type": "string", + "default": "PERCENT", + "description": "Applies a percentage discount." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the discount is applied to the customer's order." + }, + "amount_limit": { + "type": "string", + "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", + "enum": [ + true + ] + } + } + }, + "19_obj_voucher_object_discount_fixed_order": { + "title": "Fixed Order Amount", + "description": "Fixed discount type for an order.", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Sets a fixed total on the cart and then calculates the discount to apply." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER" + ], + "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |" + }, + "fixed_amount": { + "type": "integer", + "description": "Set a fixed valued for an order total. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.", + "example": 1000 + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the fixed amount is based on a formula that dynamically calculates the fixed amount.", + "enum": [ + false, + true + ] + } + } + }, + "19_obj_voucher_object_discount_fixed_items": { + "title": "New Prices for Items", + "description": "Fixed discount type for item(s).", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "FIXED", + "description": "Sets a new item price and then calculates the discount to apply." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ITEMS" + ], + "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |" + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag defaults to false because each item price could be defined separately and either based on a formula that dynamically calculates the discount or based on a fixed set price.", + "enum": [ + false + ] + } + } + }, + "19_obj_voucher_object_discount_unit_one": { + "title": "Unit, single item", + "type": "object", + "description": "Single item type.", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Applies a full value discount to item(s)." + }, + "effect": { + "type": "string", + "enum": [ + "ADD_NEW_ITEMS", + "ADD_MISSING_ITEMS" + ], + "default": "ADD_MISSING_ITEMS", + "description": "Defines how the unit is added to the customer's order." + }, + "unit_off": { + "type": "number", + "description": "Number of units to be granted a full value discount. ", + "example": 1, + "format": "float" + }, + "unit_type": { + "type": "string", + "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `sku_0a3efc90375d1217e2` or `prod_s3C0nDpr0DuC7`.", + "example": "prod_f1r5Tpr0DuC7" + }, + "sku": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0a3efc90375d1217e2", + "description": "Unique SKU ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "SKU source ID." + }, + "sku": { + "type": "string", + "description": "SKU name." + } + } + }, + "product": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "prod_0bc3bd76a61082e6b3", + "description": "Unique (parent) product ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product source ID." + }, + "name": { + "type": "string", + "description": "Product name." + } + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of items is based on a formula.", + "enum": [ + false, + true + ] + } + } + }, + "19_obj_voucher_object_discount_unit_multiple": { + "title": "Unit, multiple items", + "type": "object", + "description": "Multiple item types.", + "properties": { + "type": { + "type": "string", + "description": "Applies a full value discount to item(s).", + "default": "UNIT" + }, + "effect": { + "type": "string", + "default": "ADD_MANY_ITEMS", + "description": "Defines the effect for adding multiple item types." + }, + "units": { + "type": "array", + "description": "Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.", + "items": { "type": "object", - "title": "Order Item", - "description": "This object represents an order line item.", + "description": "Object defining a unit discount.", "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "related_object": { - "type": "string", - "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." - }, - "product_id": { - "type": "string", - "description": "A unique product ID assigned by Voucherify.", - "example": "prod_0a7e62db1fca8322a2" - }, - "sku_id": { - "type": "string", - "description": "A unique SKU ID assigned by Voucherify.", - "example": "sku_0a41e31c7b41c28358" - }, - "quantity": { + "effect": { "type": "string", - "description": "The quantity of the particular item in the cart." + "enum": [ + "ADD_NEW_ITEMS", + "ADD_MISSING_ITEMS" + ], + "description": "Defines how the unit is added to the customer's order." }, - "price": { - "type": "string", - "description": "The unit price of the item." + "unit_off": { + "type": "integer", + "description": "Number of units to be granted a full value discount. In case of the unit being calculated by a formula, this value is the result of the dynamic calculation.", + "example": 1 }, - "amount": { + "unit_type": { "type": "string", - "description": "The total amount of the order item (`price` * `quantity`)." - } - } - }, - "6_req_validate_promotion": { - "title": "Validate Promotion Request Body", - "type": "object", - "description": "Request schema model for validating a promotion using **POST** `/promotions/validation`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." + "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `prod_0bc3bd76a61082e6b3` or `sku_0a3efc90701d121820`.", + "example": "prod_f1r5Tpr0DuC7" }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + "sku": { + "type": "object", + "description": "Defines the product details of the product or the parent product in case of an SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_0a3efc90375d1217e2", + "description": "Unique SKU ID assigned by Voucherify." }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + "source_id": { + "type": "string", + "description": "SKU source ID." }, - { - "$ref": "#/components/schemas/10_req_create_order" + "sku": { + "type": "string", + "description": "SKU name." } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } }, - "options": { + "product": { "type": "object", - "description": "Configure parameters returned in the response.", + "description": "Defines the product details of the product or the parent product in case of an SKU.", "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { - "type": "string", - "enum": [ - "category" - ], - "example": "category" - } + "id": { + "type": "string", + "example": "prod_0bc3bd76a61082e6b3", + "description": "Unique (parent) product ID assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "Product source ID." + }, + "name": { + "type": "string", + "description": "Product name." } } } } - }, - "6_res_validate_promotion": { - "title": "Validate Promotion Response Body", - "type": "object", - "description": "Response schema model for validating a promotion using **POST** `/promotions/validation`.", - "properties": { - "valid": { - "type": "boolean", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "promotions": { - "type": "array", - "description": "Contains an array of promotion tier objects.", - "items": { - "$ref": "#/components/schemas/6_res_validate_promotion_object" - } - } + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of items is based on a formula." + } + } + }, + "19_obj_voucher_object_discount_shipping": { + "title": "Shipping", + "description": "Shipping discount type.", + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "UNIT", + "description": "Applies a full value discount to item(s)." + }, + "effect": { + "type": "string", + "description": "Defines how the unit is added to the customer's order.", + "default": "ADD_MISSING_ITEMS" + }, + "unit_off": { + "type": "number", + "format": "float", + "description": "Subtracts 1 shipping item from the subtotal.", + "default": 1 + }, + "unit_type": { + "type": "string", + "description": "The shipping product deemed as free.", + "default": "prod_5h1pp1ng" + }, + "product": { + "type": "object", + "description": "Defines the product details of the shipping product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h1pp1ng", + "description": "Unique product ID assigned by Voucherify, i.e. `prod_5h1pp1ng`.", + "default": "prod_5h1pp1ng" + }, + "source_id": { + "type": "string", + "description": "Product source ID.", + "default": "5h1pp1ng", + "example": "5h1pp1ng" + }, + "name": { + "type": "string", + "description": "Product name.", + "example": "Shipping", + "default": "Shipping" } - }, - "6_res_validate_promotion_object": { - "title": "Validate Promotion", + } + }, + "is_dynamic": { + "type": "boolean", + "description": "Flag indicating whether the number of shipping items is based on a formula.", + "default": false, + "enum": [ + false + ] + } + } + }, + "19_obj_validations-true_result_gift_card": { + "type": "object", + "title": "Gift Card", + "description": "This is a `result` object representing the results for a gift card.", + "properties": { + "gift": { + "description": "Stores the amount of gift card credits to be applied in the redemption.", + "type": "object", + "properties": { + "credits": { + "type": "integer", + "description": "Total number of gift card credits to be applied in the redemption expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } + } + } + } + }, + "19_obj_validations-true_result_loyalty_card": { + "type": "object", + "title": "Loyalty Card", + "description": "This is a `result` object representing the results for a loyalty card.", + "properties": { + "loyalty_card": { + "description": "Stores the amount of loyalty card points to be applied in the redemption.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Total number of loyalty points to be applied in the redemption." + } + } + } + } + }, + "19_obj_validations-true_result_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is a `result` object representing the results for a promotion tier.", + "properties": { + "discount": { + "description": "Discount details about the type of discount to be applied for the redeemable.", + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" + } + ] + } + } + }, + "19_obj_validations-true_result_promotion_stack": { + "type": "object", + "title": "Promotion Stack", + "description": "This is a `result` object representing the results for a promotion stack.", + "properties": { + "loyalty_card": { + "description": "Stores the amount of loyalty card points to be applied in the redemption.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Total number of loyalty points to be applied in the redemption." + } + } + } + } + }, + "19_obj_order_object_validation_res": { + "type": "object", + "title": "Order", + "description": "Contains the combined effect of all redeemables taken into account on the order object properties.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items showing the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "Validate Promotion", "properties": { - "valid": { - "type": "string", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { + "object": { "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "id": { + "product_id": { "type": "string", - "example": "promo_4TqHr24boFISDrcOHSlfAxwm", - "description": "Unique promotion tier ID." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "name": { + "sku_id": { "type": "string", - "description": "Custom promotion tier name." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 45% off items" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" }, - "campaign": { + "product": { "type": "object", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "description": "Unique promotion tier ID." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "start_date": { + "source_id": { "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "example": "2022-11-01T00:00:00.000Z", - "format": "date-time" + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - "expiration_date": { + "name": { "type": "string", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z", - "format": "date-time" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "example": "Brewing System", + "description": "Product name." }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by the campaign object. This object stores information about the campaign." + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "discount_amount": { - "type": "integer", - "description": "The calculated discount amount based on the discount type and effect." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The effective discount amount that would be applied to the order." - }, - "metadata": { + "sku": { "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - }, - "category_id": { - "type": "string", - "description": "Promotion tier category ID.", - "example": "cat_0c9da30e7116ba6bba" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object", - "description": "Details about the category assigned to the promotion tier." - } - } - }, - "6_req_validate_promotion_tier": { - "title": "Validate Promotion Tier Request Body", - "type": "object", - "description": "Request schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + "sku": { + "type": "string", + "description": "SKU name." }, - { - "$ref": "#/components/schemas/10_req_create_order" + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } } } - }, - "6_res_validate_promotion_tier": { - "title": "Validate Promotion Tier Response Body", - "description": "Response schema model for validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_true" - }, - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_false" - } - ] - }, - "6_res_validate_promotion_tier_true": { - "title": "Promotion Tier Valid", + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer_id": { + "type": "null" + }, + "referrer_id": { + "type": "null" + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "19_obj_order_object_validation_res_per_redeemable": { + "type": "object", + "title": "Order", + "description": "Contains the effect of each redeemable on the order and specific cart items. The amounts are consecutively built on the previous redeemable's effects, such that for each redeemable, the amounts are further reduced by the redeemable. The sequence in the request body is important because that will be the sequence the redeemables are applied one on top of the other.", + "properties": { + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items showing the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "Response schema model for valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", "properties": { - "valid": { - "type": "string", - "description": "Indicates whether the promotion is valid within the context of the parameters provided in the request body and filters in the query parameters." - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "tracking_id": { + "object": { "type": "string", - "description": "Hashed customer source ID." - }, - "order": { - "$ref": "#/components/schemas/6_obj_order_object" + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "id": { + "product_id": { "type": "string", - "example": "promo_4TqHr24boFISDrcOHSlfAxwm", - "description": "Unique promotion tier ID." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "name": { + "sku_id": { "type": "string", - "description": "Custom promotion tier name." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 45% off items" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "start_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date." + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date." + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" }, - "campaign": { + "product": { "type": "object", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "example": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "description": "Unique promotion tier ID." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "start_date": { + "source_id": { "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "example": "2022-11-01T00:00:00.000Z", - "format": "date-time" + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - "expiration_date": { + "name": { "type": "string", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z", - "format": "date-time" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "example": "Brewing System", + "description": "Product name." }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by the campaign object. This object stores information about the campaign." + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "discount_amount": { - "type": "integer", - "description": "The calculated discount amount based on the discount type and effect." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The effective discount amount that would be applied to the order." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "default": "promotion_tier", - "description": "The type of object represented by JSON. This object stores information about the promotion tier." - } - } - }, - "6_res_validate_promotion_tier_false": { - "type": "object", - "description": "Response schema model for a non-valid promotion tier when validating a promotion using **POST** `/promotions/tiers/{tierId}/validation`.", - "title": "Promotion Tier Not Valid", - "properties": { - "valid": { - "type": "boolean", - "description": "Response schema for a voucher that is not valid." - }, - "reason": { - "type": "string", - "description": "System generated cause for the voucher being invalid in the context of the provided parameters." - }, - "error": { - "description": "Detailed failure cause for the invalid voucher if the reason has a translation defined in the Dashboard → Project Settings → Error Messages.", - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_promotion_tier_false_custom_message" - }, - { - "$ref": "#/components/schemas/e_error_no_translation" - } - ] - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID." - }, - "id": { - "type": "string", - "example": "promo_ByIIAHC1Mz9ouJsitzAWsush", - "description": "Promotion tier ID." - }, - "name": { - "type": "string", - "description": "Custom promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website.", - "example": "Get 25% off" - }, - "discount": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_amount" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_percent" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_fixed" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_shipping" - } - ], - "description": "Contains information about the discount to be applied to the order." - }, - "start_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "format": "date-time", - "example": "2022-11-02T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "description": "Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "format": "date-time", - "example": "2022-11-04T00:00:00.000Z" - }, - "campaign": { + "sku": { "type": "object", + "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "description": "Unique promotion tier ID." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "start_date": { + "source_id": { "type": "string", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive* before this date.", - "format": "date-time", - "example": "2022-11-01T00:00:00.000Z" + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - "expiration_date": { + "sku": { "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign expires in ISO 8601 format. Promotion tier is *inactive* after this date.", - "example": "2022-11-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag indicating whether the campaign is active or not active. A campaign can be disabled even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + "description": "SKU name." }, - "object": { - "type": "string", - "description": "The type of object represented by the campaign object. This object stores information about the campaign.", - "default": "campaign" + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "hierarchy": { - "type": "integer", - "description": "The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that you can attach to a promotion tier object. It can be useful for storing additional information about the promotion tier in a structured format." - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the promotion tier.", - "default": "promotion_tier" - } - } - }, - "6_res_validate_promotion_tier_false_custom_message": { - "type": "object", - "description": "Custom Error Message", - "title": "Custom Message", - "properties": { - "message": { - "type": "string", - "description": "Customized error message." } } - }, - "19_req_session_lock": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and the redemption **gift credits** and **loyalty points** specified within the request.", - "enum": [ - "LOCK" - ] + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer_id": { + "type": "null" + }, + "referrer_id": { + "type": "null" + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "19_res_redemptions_parentRedemptionId_rollbacks": { + "type": "object", + "properties": { + "rollbacks": { + "type": "array", + "description": "Contains the rollback redemption objects of the particular incentives.", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_discount_voucher_stacked" }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_loyalty_card_stacked" }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_gift_card_stacked" }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." + { + "$ref": "#/components/schemas/19_obj_redemption_rollback_object_promotion_tier_stacked" } - } - }, - "19_res_session_lock": { - "title": "Session Lock", - "type": "object", - "description": "Schema model for `session` lock object. The session object contains information about the session key that was used to establish a session between multiple parallel validation and redemption requests.", - "properties": { - "type": { - "type": "string", - "description": "This session locks the redemption **quantity** by 1.", - "default": "LOCK" - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "19_obj_order_object_rollback_stacked": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", + ] + } + }, + "parent_rollback": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "rr_0c675efbc2039b83b3", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_QszL0PS1NekVjQaHGxrbpPHu", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "description": "Hashed customer source ID.", + "example": "track_fxEMFisanb4sbl4Z4yCn" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2023-02-03T09:12:22.536Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption and redemption rollback.", - "properties": { - "redemption_ID": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption rollback of incentives.", "properties": { - "date": { + "object": { "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "rollback_id": { + "product_id": { "type": "string", - "description": "Unique ID of the redemption rollback.", - "example": "rr_0c63c84eb78ee0a6c0" + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "rollback_date": { + "sku_id": { "type": "string", - "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", - "example": "2023-01-31T14:18:37.150Z", - "format": "date-time" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "related_object_type": { - "type": "string", - "description": "The source of the redemption is a `redemption` because this rollback is in the context of a stacked redemption.", - "enum": [ - "redemption" - ] + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the parent redemption.", - "example": "r_0ba186c4824e4881e1" + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "stacked": { - "type": "array", - "description": "Lists the stacked redemption IDs in the initial redemption request.", - "items": { - "type": "string" + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } } }, - "rollback_stacked": { - "type": "array", - "description": "Lists the rollback redemption IDs of the particular child redemptions.", - "items": { - "type": "string" + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } } } } } - } - } - } - }, - "19_obj_order_object_rollback_stacked_per_redemption_apply_to_order": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "metadata": { "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." } - } - }, - "19_obj_order_object_rollback_stacked_per_redemption_apply_to_items": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back for a stacked redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order.`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." - } - } + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." } + }, + "result": { + "type": "string", + "description": "Redemption rollback result", + "enum": [ + "SUCCESS" + ] + }, + "redemption": { + "type": "string", + "example": "r_0c656311b5878a2031", + "description": "Unique redemption ID of the initial redemption." } - }, - "19_req_redeemables_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Redeem a gift card.", - "properties": { - "id": { - "type": "string", - "description": "Unique gift card code." - }, - "object": { - "type": "string", - "description": "Type of object, i.e. `voucher`.", - "default": "voucher" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfill the order. The value of credits cannot be higher than the current balance on the gift card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } + } + }, + "order": { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked" + } + }, + "description": "Response body schema for POST `/redemptions/{parentRedemptionID}/rollbacks`.", + "title": "Rollback Stackable Redemptions Response Body" + }, + "19_obj_redemption_rollback_object_discount_voucher_stacked": { + "type": "object", + "title": "Rollback Discount Voucher", + "description": "This is an object representing a redemption rollback for a discount voucher.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eba630bc4979e70", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" }, - "required": [ - "object", - "id" - ] - }, - "19_req_redeemables_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Redeem a loyalty card.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty card code." - }, - "object": { - "type": "string", - "description": "Type of object, i.e. `voucher`.", - "default": "voucher" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", - "example": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order using a **pay with points** reward. The number of points cannot be higher than the current balance on the loyalty card." - } - } - } + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" }, - "required": [ - "object", - "id", - "reward" - ] - }, - "19_req_redeemables_discount_referral_promotion_tier_promotion_stack": { - "title": "Discount code, referral code, promotion tier, promotion stack", - "type": "object", - "description": "Redeem a discount code, referral code, promotion tier, or promotion stack.", - "properties": { - "object": { - "type": "string", - "description": "Redeemable object type.", - "enum": [ - "voucher", - "promotion_tier", - "promotion_stack" - ], - "default": "voucher" - }, - "id": { - "type": "string", - "description": "Redeemable code or unique ID such as: \n- discount code, referral code: `DiscountCode100`, `v_6ZPI2BLMtpc6zz8pQVjQgxJH3D4ac3ZT` \n- promotion tier: `promo_Mwy9XpA0TLctSGriM5kum0qp` \n- promotion stack: `stack_KxSD0GahLUg9ULB6TseGfUHJ` " - } + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." }, - "required": [ - "object", - "id" - ] - }, - "19_req_redemptions": { - "title": "Redeem Stackable Discounts Request Body", - "type": "object", - "description": "This data model represents the request body for redeeming multiple incentives.", - "properties": { - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", - "items": { - "type": "string", - "enum": [ - "order", - "redemption", - "redeemable", - "category" - ] - } - } - } - }, - "redeemables": { - "type": "array", - "minItems": 1, - "maxItems": 5, - "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" - }, - { - "$ref": "#/components/schemas/19_req_redeemables_gift_card" - }, - { - "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" - } - ] - } - }, - "session": { - "$ref": "#/components/schemas/19_req_session_lock" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." - } + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." }, - "required": [ - "redeemables" - ] - }, - "19_req_validations": { - "title": "Validate Stackable Discounts Request Body", - "type": "object", - "description": "This data model represents the request body for the `/validations` endpoint.", - "properties": { - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata not included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "items": { - "type": "string", - "enum": [ - "order", - "redemption", - "redeemable", - "category" - ] - } - } - } - }, - "redeemables": { - "type": "array", - "minItems": 1, - "maxItems": 5, - "description": "An array of redeemables. You can combine `voucher`(s) and `promotion_tier`(s). Alternatively, send one unique`promotion_stack` in the array.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_req_redeemables_discount_referral_promotion_tier_promotion_stack" - }, - { - "$ref": "#/components/schemas/19_req_redeemables_gift_card" - }, - { - "$ref": "#/components/schemas/19_req_redeemables_loyalty_card" - } - ] + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "discount": { + "oneOf": [ + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" + }, + { + "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" } - }, - "session": { - "$ref": "#/components/schemas/19_req_session_lock" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can attach to a redemption object. It can be useful for storing additional information about the redemption in a structured format." - } + ] }, - "required": [ - "redeemables" - ] - }, - "19_res_validations": { - "title": "Validate Stackable Discounts Response Body", - "description": "Response body schema for POST `/validations`.", - "oneOf": [ - { - "$ref": "#/components/schemas/19_res_validations-true" - }, - { - "$ref": "#/components/schemas/19_res_validations-false" + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "DISCOUNT_VOUCHER" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + } + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + } + } + }, + "19_obj_redemption_rollback_object_loyalty_card_stacked": { + "type": "object", + "title": "Rollback Loyalty Card Voucher", + "description": "This is an object representing a redemption rollback for a loyalty card.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eaf4060133bf784", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "reward": { + "description": "Defines the reward that was initially redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption after the redemption rollback." + } } - ] - }, - "19_res_validations-false": { - "type": "object", - "title": "False", - "description": "Response body schema for POST `/validations`.", - "properties": { - "valid": { - "type": "boolean", - "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", - "default": false - }, - "redeemables": { - "type": "array", - "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", - "items": { - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE", - "INAPPLICABLE", - "SKIPPED" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules. `SKIPPED` indicates that the validation stopped once it identified at least one unapplicable redeemable and did not continue to validate the given redeemable." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the voucher code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher", - "promotion_tier", - "promotion_stack" - ] - }, - "result": { - "type": "object", - "description": "Provides details for an inapplicable redeemable.", - "properties": { - "error": { - "$ref": "#/components/schemas/e_error" - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } + }, + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "LOYALTY_CARD" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "holder_id": { + "type": "string", + "description": "Unique customer ID of the loyalty card owner.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + } + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + } + } + }, + "19_obj_redemption_rollback_object_gift_card_stacked": { + "type": "object", + "title": "Rollback Gift Card", + "description": "This is an object representing a gift card redemption rollback.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "gift": { + "type": "object", + "description": "Contains the balance of the gift card after credits are added back to the gift card for the redemption rollback.", + "properties": { + "amount": { + "type": "integer", + "example": 10000, + "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "balance": { + "type": "integer", + "example": 500, + "description": "Available funds after the redemption rollback credits back the amount used up during the initial redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_ORDER", + "APPLY_TO_ITEMS" + ], + "description": "Defines how the credits are applied to the customer's order." } - }, - "tracking_id": { - "type": "string", - "example": "track_VAVo1/z+G2GI2LPw==", - "description": "Hashed customer source ID." } + }, + "type": { + "type": "string", + "description": "Indicates the voucher type.", + "enum": [ + "GIFT_VOUCHER" + ] + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." } - }, - "19_res_validations_redeemables_discount_voucher": { - "type": "object", - "description": "Response schema model for validating a discount code.", - "title": "Discount Voucher", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the voucher code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_validation_res_per_redeemable" - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_voucher_code" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0c5bf3323008a35032" + } + } + }, + "19_obj_redemption_rollback_object_promotion_tier_stacked": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption rollback", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" + }, + { + "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" + } + ] + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "name": { + "type": "string", + "description": "Promotion tier name." + }, + "banner": { + "type": "string", + "description": "Text to be displayed to your customers on your website." + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." + } } } - }, - "19_res_validations_redeemables_gift_card": { - "type": "object", - "description": "Response schema model for validating a gift card.", - "title": "Gift Card", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the gift card code." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" + } + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of initial redemption." + } + } + }, + "19_res_redemptions_POST": { + "type": "object", + "title": "Stackable Redemptions Response Body", + "description": "Response body schema for POST `/redemptions`.", + "properties": { + "redemptions": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended_stacked" }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_gift_card" + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended_stacked" }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended_stacked" }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended_stacked" + } + ] + } + }, + "parent_redemption": { + "type": "object", + "title": "Stacked Redemption", + "description": "This is an object representing a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + }, + "customer": { + "type": "object", + "description": "Defines the customer making the stacked redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." + }, + "voucher": { + "type": "null" } - }, - "19_res_validations_redeemables_loyalty_card": { + } + }, + "order": { + "description": "Contains the order details associated with the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + } + } + }, + "7_obj_order_object_rollback": { + "title": "Order object", + "description": "This is an object representing an order that was rolled back.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CANCELED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after undoing all the discounts through the rollback redemption." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order.", + "items": { "type": "object", - "description": "Response schema model for validating a loyalty card.", - "title": "Loyalty Card", "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the loyalty card code." - }, "object": { "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "voucher" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_loyalty_card" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_promotion_tier": { - "type": "object", - "description": "Response schema model for validating a promotion tier.", - "title": "Promotion Tier", - "properties": { - "status": { + "product_id": { "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "id": { + "sku_id": { "type": "string", - "description": "Redeemable ID, i.e. the promotion tier ID." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "promotion_tier" - ] + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_tier" + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the removing an item-level discount." }, - "metadata": { + "product": { "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations_redeemables_promotion_stack": { - "type": "object", - "description": "Response schema model for validating a promotion stack.", - "title": "Promotion Stack", - "properties": { - "status": { - "type": "string", - "enum": [ - "APPLICABLE" - ], - "description": "Indicates whether the redeemable can be applied or not applied based on the validation rules." - }, - "id": { - "type": "string", - "description": "Redeemable ID, i.e. the promotion stack ID." - }, - "object": { - "type": "string", - "description": "Redeemable's object type.", - "enum": [ - "promotion_stack" - ] - }, - "applicable_to": { - "$ref": "#/components/schemas/6_res_applicable_to_object" - }, - "inapplicable_to": { - "$ref": "#/components/schemas/6_res_inapplicable_to_object" - }, - "result": { - "description": "Specifies the redeemable's end effect on the order. This object is unique to each type of redeemable.", - "$ref": "#/components/schemas/19_obj_validations-true_result_promotion_stack" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redeemable." - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - } - } - }, - "19_res_validations-true": { - "type": "object", - "title": "True", - "description": "Response body schema for POST `/validations`.", - "properties": { - "valid": { - "type": "boolean", - "description": "The result of the validation. It takes all of the redeemables into account and returns a `false` if at least one redeemable is inapplicable. Returns `true` if all redeemables are applicable.", - "default": true - }, - "redeemables": { - "type": "array", - "description": "Lists validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"`.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_res_validations_redeemables_discount_voucher" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_gift_card" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_loyalty_card" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_tier" - }, - { - "$ref": "#/components/schemas/19_res_validations_redeemables_promotion_stack" - } - ] - } - }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_validation_res" - }, - "tracking_id": { - "type": "string", - "example": "track_VAVo1/z+G2GI2LPw==", - "description": "Hashed customer source ID." - }, - "session": { - "$ref": "#/components/schemas/19_res_session_lock" - } - } - }, - "19_obj_validations-true_result_voucher_code": { - "type": "object", - "title": "Coupon Code", - "description": "This is a `result` object representing the results for a coupon code.", - "properties": { - "discount": { - "description": "Discount details about the type of discount to be applied for the redeemable.", - "oneOf": [ - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_amount_dynamic" - }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage" + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_percentage_dynamic" + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_order" + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_fixed_items" + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_one" + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_unit_multiple" + "sku": { + "type": "string", + "description": "SKU name." }, - { - "$ref": "#/components/schemas/19_obj_voucher_object_discount_shipping" + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } - ] + } } } - }, - "19_obj_voucher_object_discount_amount": { - "title": "Static Amount", - "type": "object", - "description": "Amount discount type based on a static value.", - "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Applies an amount discount." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ], - "description": "Defines how the discount is applied to the customer's order." - }, - "amount_off": { - "type": "integer", - "example": 100, - "description": "Amount taken off the subtotal of a price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000." - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", - "enum": [ - false - ] + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption and redemption rollback.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "rollback_id": { + "type": "string", + "description": "Unique ID of the redemption rollback.", + "example": "rr_0c63c84eb78ee0a6c0" + }, + "rollback_date": { + "type": "string", + "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", + "example": "2023-01-31T14:18:37.150Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "enum": [ + "voucher", + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the related object that defines the incentive." + }, + "related_object_parent_id": { + "type": "string", + "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign." + } } } - }, - "19_obj_voucher_object_discount_amount_dynamic": { - "title": "Dynamic Amount", + } + } + } + }, + "7_obj_order_object": { + "title": "Order object", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "oneOf": [ + { + "$ref": "#/components/schemas/7_obj_order_object_apply_to_order" + }, + { + "$ref": "#/components/schemas/7_obj_order_object_apply_to_items" + } + ] + }, + "7_obj_order_object_apply_to_order": { + "type": "object", + "title": "Order object - Effect: Apply to order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify." + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the order-level discount applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "This field sums up all order-level and all product-specific discounts applied in a particular request." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "Amount discount type based on a formula.", "properties": { - "type": { - "type": "string", - "default": "AMOUNT", - "description": "Applies an amount discount." - }, - "effect": { + "object": { "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS", - "APPLY_TO_ITEMS_PROPORTIONALLY", - "APPLY_TO_ITEMS_PROPORTIONALLY_BY_QUANTITY", - "APPLY_TO_ITEMS_BY_QUANTITY" - ], - "description": "Defines how the discount is applied to the customer's order." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount amount is based on a formula that dynamically calculates the discount.", - "enum": [ - true - ] - } - } - }, - "19_obj_voucher_object_discount_percentage": { - "title": "Percentage", - "type": "object", - "description": "Percentage discount type applied to an order (static or dynamic) or a percentage discount type applied to items (static).", - "properties": { - "type": { + "product_id": { "type": "string", - "default": "PERCENT", - "description": "Applies a percentage discount." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "effect": { + "sku_id": { "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "percent_off": { + "quantity": { "type": "integer", - "description": "Percent taken off the subtotal amount. In case of the percent being calculated by the formula and applied to the order level, i.e. the `is_dynamic` parameter is `true`, this value becomes a dynamically calculated value that varies based on the formula.", - "minimum": 0, - "maximum": 100 + "description": "Quantity of the item in the cart." }, - "amount_limit": { - "type": "string", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", - "enum": [ - false, - true - ] - } - } - }, - "19_obj_voucher_object_discount_percentage_dynamic": { - "title": "Dynamic Percentage for Items", - "type": "object", - "description": "Percentage discount type applied to items and based on a formula (dynamic).", - "properties": { - "type": { - "type": "string", - "default": "PERCENT", - "description": "Applies a percentage discount." + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the discount is applied to the customer's order." + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" }, - "amount_limit": { - "type": "string", - "description": "Upper limit allowed to be applied as a discount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600." + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the discount percentage is based on a formula that dynamically calculates the discount.", - "enum": [ - true - ] + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } } } - }, - "19_obj_voucher_object_discount_fixed_order": { - "title": "Fixed Order Amount", - "description": "Fixed discount type for an order.", + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." + } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption.", + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" + } + } + }, + "7_obj_order_object_apply_to_items": { + "type": "object", + "title": "Order object - Effect: Apply to items", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. " + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied." + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", "properties": { - "type": { + "object": { "type": "string", - "default": "FIXED", - "description": "Sets a fixed total on the cart and then calculates the discount to apply." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "effect": { + "product_id": { "type": "string", - "enum": [ - "APPLY_TO_ORDER" - ], - "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ORDER** | Sets the order total amount to the value of the fixed amount. The discount value is calculated dynamically during the redemption as it's a difference between the total amount of the customer's order and the fixed amount. For example, if the fixed amount is set to equal $10 and the order amount equals $25, then the calculated discount will be $15. |" - }, - "fixed_amount": { - "type": "integer", - "description": "Set a fixed valued for an order total. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 discount is written as 1000.", - "example": 1000 + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the fixed amount is based on a formula that dynamically calculates the fixed amount.", - "enum": [ - false, - true - ] - } - } - }, - "19_obj_voucher_object_discount_fixed_items": { - "title": "New Prices for Items", - "description": "Fixed discount type for item(s).", - "type": "object", - "properties": { - "type": { + "sku_id": { "type": "string", - "default": "FIXED", - "description": "Sets a new item price and then calculates the discount to apply." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ITEMS" - ], - "description": "\n| **Effect** | **Definition** |\n|:---|:---|\n| **APPLY_TO_ITEMS** | Sets a new price on items. The total discount amount is dynamically calculated during the redemption and it's a difference between the initial item price and the fixed amount. During the redemption, prices for items will change only if the new price is lower than the original price. If the new product price you set is different from the product price in a collection, then the new product price will be passed during the redemption. If a prodct is in more than one collection, the price is always changed to the lowest price. The new price for products with several SKUs will force the price change for SKUs if their original price is higher than the new price. |" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "is_dynamic": { - "type": "boolean", - "description": "Flag defaults to false because each item price could be defined separately and either based on a formula that dynamically calculates the discount or based on a fixed set price.", - "enum": [ - false - ] - } - } - }, - "19_obj_voucher_object_discount_unit_one": { - "title": "Unit, single item", - "type": "object", - "description": "Single item type.", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Applies a full value discount to item(s)." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "effect": { - "type": "string", - "enum": [ - "ADD_NEW_ITEMS", - "ADD_MISSING_ITEMS" - ], - "default": "ADD_MISSING_ITEMS", - "description": "Defines how the unit is added to the customer's order." + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." }, - "unit_off": { - "type": "number", - "description": "Number of units to be granted a full value discount. ", - "example": 1, - "format": "float" + "applied_discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." }, - "unit_type": { - "type": "string", - "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `sku_0a3efc90375d1217e2` or `prod_s3C0nDpr0DuC7`.", - "example": "prod_f1r5Tpr0DuC7" + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "sku": { + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "example": "sku_0a3efc90375d1217e2", - "description": "Unique SKU ID assigned by Voucherify." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "SKU source ID." + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - "sku": { + "name": { "type": "string", - "description": "SKU name." + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "product": { + "sku": { "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", + "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "example": "prod_0bc3bd76a61082e6b3", - "description": "Unique (parent) product ID assigned by Voucherify." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "Product source ID." + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - "name": { + "sku": { "type": "string", - "description": "Product name." + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of items is based on a formula.", - "enum": [ - false, - true - ] } } - }, - "19_obj_voucher_object_discount_unit_multiple": { - "title": "Unit, multiple items", - "type": "object", - "description": "Multiple item types.", - "properties": { - "type": { - "type": "string", - "description": "Applies a full value discount to item(s).", - "default": "UNIT" - }, - "effect": { - "type": "string", - "default": "ADD_MANY_ITEMS", - "description": "Defines the effect for adding multiple item types." - }, - "units": { - "type": "array", - "description": "Array of objects defining items to be offered for free. Each item type can have a different discount effect assigned.", - "items": { - "type": "object", - "description": "Object defining a unit discount.", - "properties": { - "effect": { - "type": "string", - "enum": [ - "ADD_NEW_ITEMS", - "ADD_MISSING_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order." - }, - "unit_off": { - "type": "integer", - "description": "Number of units to be granted a full value discount. In case of the unit being calculated by a formula, this value is the result of the dynamic calculation.", - "example": 1 - }, - "unit_type": { - "type": "string", - "description": "The product or SKU deemed as free, chosen from the product inventory (e.g. time, items), i.e. `prod_0bc3bd76a61082e6b3` or `sku_0a3efc90701d121820`.", - "example": "prod_f1r5Tpr0DuC7" - }, - "sku": { - "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_0a3efc90375d1217e2", - "description": "Unique SKU ID assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "SKU source ID." - }, - "sku": { - "type": "string", - "description": "SKU name." - } - } - }, - "product": { - "type": "object", - "description": "Defines the product details of the product or the parent product in case of an SKU.", - "properties": { - "id": { - "type": "string", - "example": "prod_0bc3bd76a61082e6b3", - "description": "Unique (parent) product ID assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "Product source ID." - }, - "name": { - "type": "string", - "description": "Product name." - } - } - } - } - } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of items is based on a formula." - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "19_obj_voucher_object_discount_shipping": { - "title": "Shipping", - "description": "Shipping discount type.", + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." + } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption.", + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" + } + } + }, + "7_obj_order_object_stacked_redemptions": { + "type": "object", + "title": "Order", + "description": "This is an object representing an order with calculated discounts applied using the voucher code.", + "properties": { + "id": { + "type": "string", + "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", + "description": "Unique order ID, assigned by Voucherify. " + }, + "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." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:40:48.705Z", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-06T11:47:20.760Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "applied_discount_amount": { + "type": "integer", + "description": "This field shows the sum of all order-level discounts applied." + }, + "items_applied_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied.\n`sum(items, i => i.applied_discount_amount)`" + }, + "total_applied_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order.\n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", "properties": { - "type": { + "object": { "type": "string", - "default": "UNIT", - "description": "Applies a full value discount to item(s)." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "effect": { + "product_id": { "type": "string", - "description": "Defines how the unit is added to the customer's order.", - "default": "ADD_MISSING_ITEMS" - }, - "unit_off": { - "type": "number", - "format": "float", - "description": "Subtracts 1 shipping item from the subtotal.", - "default": 1 + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "unit_type": { + "sku_id": { "type": "string", - "description": "The shipping product deemed as free.", - "default": "prod_5h1pp1ng" - }, - "product": { - "type": "object", - "description": "Defines the product details of the shipping product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h1pp1ng", - "description": "Unique product ID assigned by Voucherify, i.e. `prod_5h1pp1ng`.", - "default": "prod_5h1pp1ng" - }, - "source_id": { - "type": "string", - "description": "Product source ID.", - "default": "5h1pp1ng", - "example": "5h1pp1ng" - }, - "name": { - "type": "string", - "description": "Product name.", - "example": "Shipping", - "default": "Shipping" - } - } - }, - "is_dynamic": { - "type": "boolean", - "description": "Flag indicating whether the number of shipping items is based on a formula.", - "default": false, - "enum": [ - false - ] - } - } - }, - "19_obj_validations-true_result_gift_card": { - "type": "object", - "title": "Gift Card", - "description": "This is a `result` object representing the results for a gift card.", - "properties": { - "gift": { - "description": "Stores the amount of gift card credits to be applied in the redemption.", - "type": "object", - "properties": { - "credits": { - "type": "integer", - "description": "Total number of gift card credits to be applied in the redemption expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } - } - }, - "19_obj_validations-true_result_loyalty_card": { - "type": "object", - "title": "Loyalty Card", - "description": "This is a `result` object representing the results for a loyalty card.", - "properties": { - "loyalty_card": { - "description": "Stores the amount of loyalty card points to be applied in the redemption.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Total number of loyalty points to be applied in the redemption." - } - } - } - } - }, - "19_obj_validations-true_result_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is a `result` object representing the results for a promotion tier.", - "properties": { - "discount": { - "description": "Discount details about the type of discount to be applied for the redeemable.", - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ] - } - } - }, - "19_obj_validations-true_result_promotion_stack": { - "type": "object", - "title": "Promotion Stack", - "description": "This is a `result` object representing the results for a promotion stack.", - "properties": { - "loyalty_card": { - "description": "Stores the amount of loyalty card points to be applied in the redemption.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Total number of loyalty points to be applied in the redemption." - } - } - } - } - }, - "19_obj_order_object_validation_res": { - "type": "object", - "title": "Order", - "description": "Contains the combined effect of all redeemables taken into account on the order object properties.", - "properties": { - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "total_applied_discount_amount": { + "quantity": { "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items showing the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer_id": { - "type": "null" - }, - "referrer_id": { - "type": "null" + "description": "Quantity of the item in the cart." }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_obj_order_object_validation_res_per_redeemable": { - "type": "object", - "title": "Order", - "description": "Contains the effect of each redeemable on the order and specific cart items. The amounts are consecutively built on the previous redeemable's effects, such that for each redeemable, the amounts are further reduced by the redeemable. The sequence in the request body is important because that will be the sequence the redeemables are applied one on top of the other.", - "properties": { "amount": { "type": "integer", - "description": "Order amount before applying any discount." + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, "discount_amount": { "type": "integer", - "description": "Sum of all order-level discounts applied to the order. \n`sum(redeemables.order.applied_discount_amount)`" - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + "description": "The item-level discount applied to the item." }, "applied_discount_amount": { "type": "integer", - "description": "Sum of all order-level discounts applied in a particular request. \n`sum(redeemables.order.applied_discount_amount)`" + "description": "The item-level discount applied to the item." }, - "items_applied_discount_amount": { + "price": { "type": "integer", - "description": "Sum of all product-specific discounts applied in a particular request. \n`sum(items, i => i.applied_discount_amount)`" + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "total_applied_discount_amount": { + "subtotal_amount": { "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied in a particular request. \n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items showing the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`applied_discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer_id": { - "type": "null" - }, - "referrer_id": { - "type": "null" - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "19_res_redemptions_parentRedemptionId_rollbacks": { - "type": "object", - "properties": { - "rollbacks": { - "type": "array", - "description": "Contains the rollback redemption objects of the particular incentives.", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_discount_voucher_stacked" - }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_loyalty_card_stacked" - }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_gift_card_stacked" - }, - { - "$ref": "#/components/schemas/19_obj_redemption_rollback_object_promotion_tier_stacked" - } - ] - } + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" }, - "parent_rollback": { + "product": { "type": "object", + "description": "This object stores more information about the related product.", "properties": { "id": { "type": "string", - "example": "rr_0c675efbc2039b83b3", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_QszL0PS1NekVjQaHGxrbpPHu", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "description": "Hashed customer source ID.", - "example": "track_fxEMFisanb4sbl4Z4yCn" + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "date": { + "source_id": { "type": "string", - "format": "date-time", - "example": "2023-02-03T09:12:22.536Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - "result": { + "name": { "type": "string", - "description": "Redemption rollback result", - "enum": [ - "SUCCESS" - ] + "example": "Brewing System", + "description": "Product name." }, - "redemption": { - "type": "string", - "example": "r_0c656311b5878a2031", - "description": "Unique redemption ID of the initial redemption." + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "order": { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked" - } - }, - "description": "Response body schema for POST `/redemptions/{parentRedemptionID}/rollbacks`.", - "title": "Rollback Stackable Redemptions Response Body" - }, - "19_obj_redemption_rollback_object_discount_voucher_stacked": { - "type": "object", - "title": "Rollback Discount Voucher", - "description": "This is an object representing a redemption rollback for a discount voucher.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eba630bc4979e70", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "customer": { + "sku": { "type": "object", - "description": "Defines the customer that is related to the redemption.", + "description": "This object stores more information about the related SKU.", "properties": { "id": { "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, "source_id": { "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "discount": { - "oneOf": [ - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_amount" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_percentage" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_fixed" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_one" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_unit_multiple" - }, - { - "$ref": "#/components/schemas/1_obj_voucher_object_discount_shipping" - } - ] - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "DISCOUNT_VOUCHER" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - } - } - }, - "19_obj_redemption_rollback_object_loyalty_card_stacked": { - "type": "object", - "title": "Rollback Loyalty Card Voucher", - "description": "This is an object representing a redemption rollback for a loyalty card.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eaf4060133bf784", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "reward": { - "description": "Defines the reward that was initially redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption after the redemption rollback." - } - } - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "LOYALTY_CARD" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { + "sku": { "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." + "description": "SKU name." }, - "holder_id": { - "type": "string", - "description": "Unique customer ID of the loyalty card owner.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." } } - }, - "19_obj_redemption_rollback_object_gift_card_stacked": { - "type": "object", - "title": "Rollback Gift Card", - "description": "This is an object representing a gift card redemption rollback.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "gift": { - "type": "object", - "description": "Contains the balance of the gift card after credits are added back to the gift card for the redemption rollback.", - "properties": { - "amount": { - "type": "integer", - "example": 10000, - "description": "Total gift card income over the lifetime of the card. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "balance": { - "type": "integer", - "example": 500, - "description": "Available funds after the redemption rollback credits back the amount used up during the initial redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_ORDER", - "APPLY_TO_ITEMS" - ], - "description": "Defines how the credits are applied to the customer's order." - } - } - }, - "type": { - "type": "string", - "description": "Indicates the voucher type.", - "enum": [ - "GIFT_VOUCHER" - ] - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "is_referral_code": { - "type": "boolean", - "description": "Flag indicating whether this voucher is a referral code." - } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0c5bf3323008a35032" - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "19_obj_redemption_rollback_object_promotion_tier_stacked": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption rollback", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_order" - }, - { - "$ref": "#/components/schemas/19_obj_order_object_rollback_stacked_per_redemption_apply_to_items" - } - ] - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "name": { - "type": "string", - "description": "Promotion tier name." - }, - "banner": { - "type": "string", - "description": "Text to be displayed to your customers on your website." - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of initial redemption." - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `referrer` object." } - }, - "19_res_redemptions_POST": { - "type": "object", - "title": "Stackable Redemptions Response Body", - "description": "Response body schema for POST `/redemptions`.", - "properties": { - "redemptions": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended_stacked" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended_stacked" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended_stacked" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended_stacked" - } - ] - } - }, - "parent_redemption": { - "type": "object", - "title": "Stacked Redemption", - "description": "This is an object representing a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - }, - "customer": { - "type": "object", - "description": "Defines the customer making the stacked redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." - }, - "voucher": { - "type": "null" - } - } - }, - "order": { - "description": "Contains the order details associated with the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "description": "Lists details related to the redemption", + "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" + } + } + }, + "7_obj_redemption_object": { + "title": "Redemption Object", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such an operation a [redemption rollback](ref:rollback-redemption).", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_stackable_discounts" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_fail" + } + ] + }, + "7_obj_redemption_object_voucher": { + "title": "Redemption Object", + "description": "This is an object representing an attempted or successful voucher redemption.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" + } + ] + }, + "7_obj_redemption_object_voucher_extended": { + "title": "Redemption Object", + "description": "This is an object representing an attempted or successful voucher redemption.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended" + } + ] + }, + "7_obj_redemption_object_discount_voucher_extended": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_order_object_rollback": { - "title": "Order object", - "description": "This is an object representing an order that was rolled back.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CANCELED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after undoing all the discounts through the rollback redemption." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the removing an item-level discount." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption and redemption rollback.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "rollback_id": { - "type": "string", - "description": "Unique ID of the redemption rollback.", - "example": "rr_0c63c84eb78ee0a6c0" - }, - "rollback_date": { - "type": "string", - "description": "Timestamp representing the date and tiem when the redemption rollback was created in ISO 8601 format.", - "example": "2023-01-31T14:18:37.150Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "enum": [ - "voucher", - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the related object that defines the incentive." - }, - "related_object_parent_id": { - "type": "string", - "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign." - } - } - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_order_object": { - "title": "Order object", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "oneOf": [ - { - "$ref": "#/components/schemas/7_obj_order_object_apply_to_order" - }, - { - "$ref": "#/components/schemas/7_obj_order_object_apply_to_items" - } - ] - }, - "7_obj_order_object_apply_to_order": { - "type": "object", - "title": "Order object - Effect: Apply to order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify." - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the order-level discount applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "This field sums up all order-level and all product-specific discounts applied in a particular request." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption.", - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + } + } + }, + "7_obj_redemption_object_discount_voucher_extended_stacked": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_order_object_apply_to_items": { - "type": "object", - "title": "Order object - Effect: Apply to items", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. " - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied." - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption.", - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_order_object_stacked_redemptions": { - "type": "object", - "title": "Order", - "description": "This is an object representing an order with calculated discounts applied using the voucher code.", - "properties": { - "id": { - "type": "string", - "example": "ord_OLWs41pBk7VFn6ZTyX9U6keh", - "description": "Unique order ID, assigned by Voucherify. " - }, - "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." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:40:48.705Z", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-06T11:47:20.760Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format." - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "applied_discount_amount": { - "type": "integer", - "description": "This field shows the sum of all order-level discounts applied." - }, - "items_applied_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied.\n`sum(items, i => i.applied_discount_amount)`" - }, - "total_applied_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order.\n`total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "applied_discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are att to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `referrer` object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "description": "Lists details related to the redemption", - "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + } + } + }, + "7_obj_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_object": { - "title": "Redemption Object", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such an operation a [redemption rollback](ref:rollback-redemption).", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_stackable_discounts" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_fail" - } - ] - }, - "7_obj_redemption_object_voucher": { - "title": "Redemption Object", - "description": "This is an object representing an attempted or successful voucher redemption.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - } - ] - }, - "7_obj_redemption_object_voucher_extended": { - "title": "Redemption Object", - "description": "This is an object representing an attempted or successful voucher redemption.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_discount_voucher_extended" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_gift_card_extended" - } - ] - }, - "7_obj_redemption_object_discount_voucher_extended": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_object_discount_voucher_extended_stacked": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" } - }, - "7_obj_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } - } - } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." } - }, - "7_obj_redemption_object_loyalty_card_extended_stacked": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } - } - } + } + } + } + }, + "7_obj_redemption_object_loyalty_card_extended_stacked": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_object_gift_card_extended": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_object_gift_card_extended_stacked": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" } - }, - "7_obj_rollback_redemption_object_truncated": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier_fail" - } - ] - }, - "7_obj_rollback_redemption_object_extended": { - "title": "Rollback Redemption Object", - "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_discount_voucher_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_loyalty_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_gift_card_extended" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_promotion_tier_extended" - } - ] - }, - "7_obj_rollback_redemption_object_discount_voucher_extended": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique rollback redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." } - }, - "7_obj_rollback_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a loyalty card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being returned to the loyalty card for the reward redemption rollback." - } - } - } + } + } + } + }, + "7_obj_redemption_object_gift_card_extended": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_rollback_redemption_object_gift_card_extended": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount credited back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "gift": { - "type": "object", - "description": "Contains the amount being added back to the gift card for the redemption rollback.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount added back on the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_rollback_redemption_object_promotion_tier_extended": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier rollback redemption.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0b56726b09cfb73e84" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the rollback redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." } - }, - "7_obj_redemption_object_discount_voucher": { - "type": "object", - "title": "Discount Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } + } + } + } + }, + "7_obj_redemption_object_gift_card_extended_stacked": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_rollback_object_discount_voucher": { - "type": "object", - "title": "Rollback Discount Voucher", - "description": "This is an object representing a redemption rollback for a discount voucher.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eba630bc4979e70", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_rollback_object_loyalty_card": { - "type": "object", - "title": "Rollback Loyalty Card Voucher", - "description": "This is an object representing a redemption rollback for a loyalty card.", - "properties": { - "id": { - "type": "string", - "example": "rr_0c5eaf4060133bf784", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being returned to the loyalty card." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the original redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "reward": { - "description": "Defines the reward that was initially redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being added back to the loyalty card for the reward redemption rollback." - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." } - }, - "7_obj_redemption_object_loyalty_card": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } - } - } + } + } + } + }, + "7_obj_rollback_redemption_object_truncated": { + "title": "Rollback Redemption Object", + "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_discount_voucher" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_loyalty_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_gift_card" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_voucher_fail" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_rollback_object_promotion_tier_fail" + } + ] + }, + "7_obj_rollback_redemption_object_extended": { + "title": "Rollback Redemption Object", + "description": "This is an object representing an attempted or successful voucher or promotion tier rollback.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_discount_voucher_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_loyalty_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_gift_card_extended" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_promotion_tier_extended" + } + ] + }, + "7_obj_rollback_redemption_object_discount_voucher_extended": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique rollback redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_object_loyalty_card_pay_with_points": { - "type": "object", - "description": "Defines the pay with points reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "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`.", - "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." - } - } - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "COIN" - ] - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" }, - "title": "Pay with Points Reward" - }, - "7_obj_redemption_object_loyalty_card_material_product": { - "type": "object", - "description": "Defines the product material reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "product": { - "description": "Details of the product redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_product_object_truncated" - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a material reward.", - "properties": { - "product": { - "type": "object", - "description": "Defines the product redeemed as a reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assignedy by Voucherify of the product.", - "example": "prod_0b2c2ddf35150b83bb" - }, - "sku_id": { - "type": "null" - } - } - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "MATERIAL" - ] - } + "name": { + "type": "string", + "description": "Customer's first and last name." }, - "title": "Product Material Reward" - }, - "7_obj_redemption_object_loyalty_card_material_sku": { - "type": "object", - "description": "Defines the SKU material reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "product": { - "description": "Details of the SKU's parent product redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_product_object_truncated" - }, - "sku": { - "description": "Details of the SKU redeemed as a reward.", - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a material reward.", - "properties": { - "product": { - "type": "object", - "description": "Defines the SKU redeemed as a reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assignedy by Voucherify of the SKU's parent." - }, - "sku_id": { - "type": "string", - "description": "Unique SKU ID assigned by Voucherify of the SKU redeemed as a reward." - } - } - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "MATERIAL" - ] - } + "email": { + "type": "string", + "description": "Customer's email address." }, - "title": "SKU Material Reward" - }, - "7_obj_redemption_object_loyalty_card_digital": { - "type": "object", - "description": "Defines the digital reward redeemed for the particular loyalty card.", - "properties": { - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "assignment_id": { - "type": "string", - "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "description": "Unique reward assginment ID assigned by Voucherify." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Voucher object." - }, - "id": { - "type": "string", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "description": "Unique reward ID assigned by Voucherify." - }, - "object": { - "type": "string", - "default": "reward", - "description": "Type of object represented is `reward`." - }, - "name": { - "type": "string", - "description": "Reward name." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was created." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the reward was updated." - }, - "parameters": { - "type": "object", - "description": "These are parameters representing a digital reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.", - "properties": { - "campaign": { - "description": "Defines the source of the digital reward.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_discount_voucher" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_gift_card_credits" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_loyalty_card_points" - } - ] - } - } - }, - "type": { - "type": "string", - "description": "Reward type", - "enum": [ - "CAMPAIGN" - ] - } + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." }, - "title": "Digital Reward" - }, - "7_obj_redemption_object_loyalty_card_digital_discount_voucher": { - "type": "object", - "title": "Discount Voucher", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "DISCOUNT_COUPONS" - ] - } - } - }, - "7_obj_redemption_object_loyalty_card_digital_gift_card_credits": { - "type": "object", - "title": "Gift Card", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "balance": { - "type": "integer", - "description": "The amount credited to the gift card as a reward expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "GIFT_VOUCHERS" - ] - } + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_object_loyalty_card_digital_loyalty_card_points": { - "type": "object", - "title": "Loyalty Card", - "description": "Contains information about the source of the digital reward.", - "properties": { - "id": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", - "description": "Unique parent campaign ID of reward." - }, - "balance": { - "type": "integer", - "description": "The number of loyalty points that is added to the loyalty card as a reward." - }, - "type": { - "type": "string", - "description": "Campaign type.", - "enum": [ - "LOYALTY_PROGRAM" - ] - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + } + } + }, + "7_obj_rollback_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a loyalty card rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_rollback_object_gift_card": { - "type": "object", - "title": "Rollback Gift Card", - "description": "This is an object representing a gift card redemption rollback.", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the initial redemption.", - "example": "r_0c5bf3323008a35032" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "gift": { - "type": "object", - "description": "Contains the amount being adde back to the gift card for the redemption rollback", - "properties": { - "amount": { - "type": "integer", - "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_object_gift_card": { - "type": "object", - "title": "Gift Card", - "description": "This is an object representing a gift card redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the gift card.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "type": "object", - "description": "Defines the details of the voucher being redeemed.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - }, - "gift": { - "type": "object", - "description": "Contains the amount being subtracted from the gift card for the redemption.", - "properties": { - "amount": { - "type": "integer", - "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" } - }, - "7_obj_redemption_object_voucher_fail": { - "type": "object", - "title": "Failed Voucher Redemption", - "description": "This is an object representing a failed redemption for a voucher.", - "properties": { - "id": { - "type": "string", - "example": "rf_0bbaccc96e0830ff9e", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "voucher": { - "type": "object", - "description": "Defines the voucher details.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being returned to the loyalty card for the reward redemption rollback." } - }, - "7_obj_redemption_object_promotion_tier_fail": { - "type": "object", - "title": "Failed Promotion Tier Redemption", - "description": "This is an object representing a failed redemption for a promotion tier.", - "properties": { - "id": { - "type": "string", - "example": "rf_0bbaccc96e0830ff9e", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the promotion.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details about the promotion tier and it's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } + } + } + } + }, + "7_obj_rollback_redemption_object_gift_card_extended": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount credited back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_object_fail": { - "type": "object", - "title": "Failed Redemption", - "description": "This is an object representing a failed redemption when a resource to be redeemed cannot be found.", - "properties": { - "id": { - "type": "string", - "example": "rf_0c4c7baf58c243af6b", - "description": "Unique failed redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "null", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "null", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "not_found", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "null" - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| redemption | Related redemption. |\n", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "rf_0c5bde8dfc0156f0e3" - }, - "voucher": { - "type": "null" - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_rollback_object_voucher_fail": { - "type": "object", - "title": "Failed Voucher Redemption Rollback", - "description": "This is an object representing a failed redemption rollback for a voucher.", - "properties": { - "id": { - "type": "string", - "example": "rrf_0c63990fed133bfb88", - "description": "Unique failed redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "failure_code": { - "type": "string", - "example": "already_rolled_back", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "voucher": { - "type": "object", - "description": "Defines the voucher details.", - "properties": { - "id": { - "type": "string", - "description": "Unique voucher ID assigned by Voucherify.", - "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - }, - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "campaign": { - "type": "string", - "description": "Voucher's parent campaign name." - }, - "campaign_id": { - "type": "string", - "description": "Unique campaign ID assigned by Voucherify.", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - } - } - } - } - }, - "7_obj_redemption_rollback_object_promotion_tier_fail": { - "type": "object", - "title": "Failed Promotion Tier Redemption Rollback", - "description": "This is an object representing a failed redemption rollback for a promotion tier.", - "properties": { - "id": { - "type": "string", - "example": "rrf_0c5eb3bd884497ed05", - "description": "Unique failed redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "The unique redemption ID of the initial redemption.", - "example": "r_0c5d6689b35320059a" - }, - "reason": { - "type": "string", - "description": "The reason for the redemption rollback." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "failure_code": { - "type": "string", - "example": "customer_rules_violated", - "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." - }, - "failure_message": { - "type": "string", - "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." - }, - "order": { - "type": "null" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the promotion.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.\n", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details about the promotion tier and it's parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "gift": { + "type": "object", + "description": "Contains the amount being added back to the gift card for the redemption rollback.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount added back on the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." } - }, - "7_obj_redemption_rollback_object_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption rollback", - "properties": { - "id": { - "type": "string", - "example": "rr_0bc92f81a6801f9bca", - "description": "Unique redemption rollback ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", - "default": "redemption_rollback" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of initial redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption rollback result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption rollback.", - "$ref": "#/components/schemas/7_obj_order_object_rollback" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption rollback was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } + } + } + } + }, + "7_obj_rollback_redemption_object_promotion_tier_extended": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier rollback redemption.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0b56726b09cfb73e84" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the rollback redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_obj_redemption_object_promotion_tier": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "type": "object", - "description": "Contains details of the promotion tier and the parent campaign.", - "properties": { - "id": { - "type": "string", - "description": "Unique promotion tier ID assigned by Voucherify.", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "campaign": { - "type": "object", - "description": "Promotion tier's parent campaign.", - "properties": { - "id": { - "type": "string", - "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." - } - } - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_obj_redemption_object_promotion_tier_extended": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "description": "Contains details of the promotion tier and the parent campaign.", - "$ref": "#/components/schemas/3_obj_promotion_tier_object" } } - }, - "7_obj_redemption_object_promotion_tier_extended_stacked": { - "type": "object", - "title": "Promotion Tier", - "description": "This is an object representing a promotion tier redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "redemption": { - "type": "string", - "description": "Unique redemption ID of the parent redemption.", - "example": "r_0c656311b5878a2031" - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer that is related to the redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." - }, - "voucher": { - "type": "null" - }, - "promotion_tier": { - "description": "Contains details of the promotion tier and the parent campaign.", - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - } - } - }, - "7_obj_redemption_object_stackable_discounts": { - "type": "object", - "title": "Stacked Redemption", - "description": "This is an object representing a stacked redemption.", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" - }, - "channel": { - "type": "object", - "description": "Defines the details of the channel through which the redemption was issued.", - "properties": { - "channel_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." - }, - "channel_type": { - "type": "string", - "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", - "enum": [ - "USER", - "API" - ] - } - } - }, - "customer": { - "type": "object", - "description": "Defines the customer making the stacked redemption.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object.", - "enum": [ - "redemption" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." - }, - "voucher": { - "type": "null" - } + } + } + } + }, + "7_obj_redemption_object_discount_voucher": { + "type": "object", + "title": "Discount Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_res_get_redemption": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" - } - ], - "title": "Get Redemption Response Body", - "description": "Response body schema for **GET** `/redemptions/{redemptionId}" - }, - "7_res_list_redemptions": { - "title": "List Redemptions Response Body", - "type": "object", - "description": "Response body schema for **GET** `/redemptions`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "redemptions", - "description": "Identifies the name of the attribute that contains the array of redemption objects." - }, - "redemptions": { - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object" - }, - { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" - } - ] - }, - "total": { - "type": "integer", - "description": "Total number of redemptions." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_filter_conditions_string": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } - }, - "7_res_get_vouchers_redemptions": { - "type": "object", - "title": "Get Voucher's Redemptions Response Body", - "description": "Response body schema for **GET** `/vouchers/{code}/redemption`.", - "properties": { - "quantity": { - "type": "integer", - "description": "The maximum number of times a voucher can be redeemed." - }, - "redeemed_quantity": { - "type": "integer", - "description": "The number of times the voucher was redeemed successfully." - }, - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/PROMO-CODE2/redemptions?page=1&limit=10", - "description": "URL " - }, - "data_ref": { - "type": "string", - "default": "redemption_entries", - "description": "Identifies the name of the attribute that contains the array of `redemption_entries`." - }, - "total": { - "type": "integer", - "description": "Total number of redemption objects." - }, - "redemption_entries": { - "type": "array", - "description": "Contains the array of successful and failed redemption objects.", - "items": { - "$ref": "#/components/schemas/7_obj_redemption_object_voucher" - } - } + } + } + } + }, + "7_obj_redemption_rollback_object_discount_voucher": { + "type": "object", + "title": "Rollback Discount Voucher", + "description": "This is an object representing a redemption rollback for a discount voucher.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eba630bc4979e70", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_req_redeem_voucher": { - "title": "Redeem Voucher Request Body", - "description": "Request body schema for redeeming a voucher using **POST** `/vouchers/{code}/redemption`.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_req_redeem_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/7_req_redeem_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/7_req_redeem_voucher_loyalty_card" - } - ] - }, - "7_res_redeem_voucher": { - "title": "Redeem Voucher Response Body", - "$ref": "#/components/schemas/7_obj_redemption_object_voucher_extended", - "description": "Response body schema for **POST** `/vouchers/{code}/redemption`." - }, - "7_req_redeem_promotion_tier": { - "title": "Redeem Promotion Tier", - "type": "object", - "description": "Redeem a promotion tier.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against promotion tiers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_req_redeem_voucher_discount_code": { - "title": "Discount Code", - "type": "object", - "description": "Redeem a discount code.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_discount_code" - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { - "type": "string", - "enum": [ - "category" - ], - "example": "category" - } - } - } - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } - }, - "7_req_redeem_voucher_gift_card": { - "title": "Gift Card", - "type": "object", - "description": "Redeem a gift card.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_gift_card" - }, - "gift": { - "type": "object", - "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", - "properties": { - "credits": { - "type": "integer", - "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { - "type": "string", - "enum": [ - "category" - ], - "example": "category" - } - } - } - } + } + } + } + }, + "7_obj_redemption_rollback_object_loyalty_card": { + "type": "object", + "title": "Rollback Loyalty Card Voucher", + "description": "This is an object representing a redemption rollback for a loyalty card.", + "properties": { + "id": { + "type": "string", + "example": "rr_0c5eaf4060133bf784", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being returned to the loyalty card." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the original redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "7_req_redeem_voucher_loyalty_card": { - "title": "Loyalty Card", - "type": "object", - "description": "Redeem a loyalty card.", - "properties": { - "session": { - "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" - }, - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." - } - } - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" - }, - { - "$ref": "#/components/schemas/10_req_create_order" - } - ], - "description": "Order information." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", - "items": { - "type": "string", - "enum": [ - "category" - ], - "example": "category" - } - } - } - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "7_req_rollback_redemption": { - "title": "Rollback Redemption Request Body", - "type": "object", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_rollback_redemption_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_rollback_redemption_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_rollback_redemption_order_id" - }, - { - "$ref": "#/components/schemas/6_req_rollback_redemption_order_source_id" - } - ], - "description": "Send order information to ensure the correct order is being undone." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to update **redemption** metadata." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" }, - "description": "Request body schema for **POST** `/redemptions/{redemptionId}/rollback`." - }, - "7_res_rollback_redemption": { - "title": "Rollback Redemption Response Body", - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended", - "description": "Response body schema for **POST** `/redemptions/{redemptionId}/rollback`." - }, - "8_obj_loyalty_campaign_object": { - "title": "Loyalty Campaign Object", - "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", - "x-tags": [ - "LOYALTIES API" - ], - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Loyalty campaign name." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + }, + "reward": { + "description": "Defines the reward that was initially redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being added back to the loyalty card for the reward redemption rollback.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being added back to the loyalty card for the reward redemption rollback." + } + } + } + } + }, + "7_obj_redemption_object_loyalty_card": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher and promotion tier lifecycle. A customer can redeem a voucher or promotion tier once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } + } + } + } + }, + "7_obj_redemption_object_loyalty_card_pay_with_points": { + "type": "object", + "description": "Defines the pay with points reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "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`.", + "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." } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." } } - }, - "8_obj_loyalty_campaign_object_no_extended_categories": { - "title": "Loyalty Campaign Object", - "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Loyalty campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "COIN" + ] + } + }, + "title": "Pay with Points Reward" + }, + "7_obj_redemption_object_loyalty_card_material_product": { + "type": "object", + "description": "Defines the product material reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "product": { + "description": "Details of the product redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a material reward.", + "properties": { + "product": { + "type": "object", + "description": "Defines the product redeemed as a reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assignedy by Voucherify of the product.", + "example": "prod_0b2c2ddf35150b83bb" + }, + "sku_id": { + "type": "null" } - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "object": { - "type": "string", - "default": "campaign", - "description": "The type of object represented by JSON. This object stores information about the campaign." } } - }, - "8_obj_loyalty_card_object": { - "title": "Loyalty Card Object", - "type": "object", - "description": "This is an object representing a loyalty card.", - "examples": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - } - ], - "properties": { - "id": { - "type": "string", - "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", - "description": "Assigned by the Voucherify API, identifies the voucher." - }, - "code": { - "type": "string", - "example": "WVPblOYX", - "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." - }, - "campaign": { - "type": "string", - "example": "Loyalty Card Campaign", - "description": "A unique campaign name, identifies the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." - }, - "category_id": { - "type": "string", - "description": "Unique category ID assigned by Voucherify.", - "example": "cat_0bb343dee3cdb5ec0c" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ], - "description": "Defines the type of voucher. " - }, - "discount": { - "default": null, - "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", - "type": "null" - }, - "gift": { - "type": "null", - "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." - }, - "loyalty_card": { - "type": "object", - "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption." - }, - "next_expiration_date": { - "type": "string", - "format": "date", - "example": "2023-05-30", - "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", - "example": "2021-12-01T00:00:00.000Z", - "format": "date-time", - "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " - }, - "expiration_date": { - "type": "string", - "example": "2021-12-31T00:00:00.000Z", - "format": "date-time", - "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." - }, - "validity_timeframe": { - "type": "object", - "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": { - "duration": { - "type": "string", - "example": "PT1H", - "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." - }, - "interval": { - "type": "string", - "example": "P2D", - "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", - "enum": [ - [ - 0 - ], - [ - 1 - ], - [ - 2 - ], - [ - 3 - ], - [ - 4 - ], - [ - 5 - ], - [ - 6 - ] - ], - "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" - } - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "additional_info": { - "type": "string", - "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." - }, - "created_at": { - "type": "string", - "example": "2021-12-22T10:13:06.487Z", - "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2021-12-22T10:14:45.316Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." - }, - "holder_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of voucher owner." - }, - "redemption": { - "type": "object", - "description": "Stores a summary of redemptions that have been applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - }, - "redeemed_quantity": { - "type": "integer", - "example": 1, - "description": "How many times a voucher has already been redeemed." - }, - "redeemed_points": { - "type": "integer", - "example": 100000, - "description": "Total loyalty points redeemed." - }, - "object": { - "type": "string", - "default": "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", - "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", - "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" - } - } - }, - "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", - "properties": { - "object": { - "type": "string", - "default": "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", - "example": 0, - "description": "Publication events counter." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", - "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `voucher`.", - "default": "voucher" - } + } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "MATERIAL" + ] + } + }, + "title": "Product Material Reward" + }, + "7_obj_redemption_object_loyalty_card_material_sku": { + "type": "object", + "description": "Defines the SKU material reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" }, - "x-tags": [ - "LOYALTIES API" - ] - }, - "8_obj_loyalty_reward_object": { - "title": "Loyalty Reward Object", - "type": "object", - "description": "This is an object representing a loyalty reward.", - "x-tags": [ - "LOYALTIES API" - ], - "properties": { - "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "assignment": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - }, - "object": { - "type": "string", - "default": "loyalty_reward", - "description": "The type of object represented by JSON. This object stores information about the loyalty reward object." - } + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "8_obj_loyalty_points_bucket": { - "type": "object", - "title": "Loyalty Points Bucket Object", - "description": "This is an object representing a loyalty points bucket.", - "properties": { - "id": { - "type": "string", - "example": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", - "description": "Unique loyalty points bucket ID." - }, - "voucher_id": { - "type": "string", - "example": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "description": "Unique parent loyalty card ID." - }, - "campaign_id": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "description": "Unique parent campaign ID." - }, - "bucket": { - "type": "object", - "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." - } + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "product": { + "description": "Details of the SKU's parent product redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "sku": { + "description": "Details of the SKU redeemed as a reward.", + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a material reward.", + "properties": { + "product": { + "type": "object", + "description": "Defines the SKU redeemed as a reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assignedy by Voucherify of the SKU's parent." + }, + "sku_id": { + "type": "string", + "description": "Unique SKU ID assigned by Voucherify of the SKU redeemed as a reward." } - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE" - ], - "description": "Loyalty points bucket point status." - }, - "expires_at": { - "type": "string", - "example": "2022-11-30", - "format": "date", - "description": "Date when the number of points defined in the `bucket` object are due to expire." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-21T13:49:54.949Z", - "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-08-30T08:34:45.989Z", - "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", - "default": "loyalty_points_bucket", - "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." } } - }, - "8_obj_loyalty_tier_reward_object": { - "title": "Loyalty Tier Reward Object", - "type": "object", - "description": "This is an object representing a loyalty tier reward.", - "x-tags": [ - "LOYALTIES API" - ], - "properties": { - "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "assignment": { - "$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." - } + } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "MATERIAL" + ] + } + }, + "title": "SKU Material Reward" + }, + "7_obj_redemption_object_loyalty_card_digital": { + "type": "object", + "description": "Defines the digital reward redeemed for the particular loyalty card.", + "properties": { + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "8_obj_loyalty_card_object_non_expanded_categories": { - "title": "Loyalty Card Object", - "type": "object", - "description": "This is an object representing a loyalty card.", - "examples": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + } + }, + "assignment_id": { + "type": "string", + "example": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "description": "Unique reward assginment ID assigned by Voucherify." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Voucher object." + }, + "id": { + "type": "string", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "description": "Unique reward ID assigned by Voucherify." + }, + "object": { + "type": "string", + "default": "reward", + "description": "Type of object represented is `reward`." + }, + "name": { + "type": "string", + "description": "Reward name." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was created." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the reward was updated." + }, + "parameters": { + "type": "object", + "description": "These are parameters representing a digital reward. These can be in the form of discount coupons, gift card credits, or loyalty point credits.", + "properties": { + "campaign": { + "description": "Defines the source of the digital reward.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_discount_voucher" }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_gift_card_credits" }, - "object": "voucher" - } - ], - "properties": { - "id": { - "type": "string", - "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", - "description": "Assigned by the Voucherify API, identifies the voucher." - }, - "code": { - "type": "string", - "example": "WVPblOYX", - "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." - }, - "campaign": { - "type": "string", - "example": "Loyalty Card Campaign", - "description": "A unique campaign name, identifies the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." - }, - "category": { - "type": "string", - "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." - }, - "category_id": { - "type": "string", - "description": "Unique category ID assigned by Voucherify.", - "example": "cat_0bb343dee3cdb5ec0c" - }, - "categories": { - "type": "array", - "description": "Contains details about the category.", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ], - "description": "Defines the type of voucher. " - }, - "discount": { - "default": null, - "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", - "type": "null" - }, - "gift": { - "type": "null", - "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." - }, - "loyalty_card": { - "type": "object", - "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", - "properties": { - "points": { - "type": "integer", - "example": 7000, - "description": "Total points incurred over lifespan of loyalty card." - }, - "balance": { - "type": "integer", - "example": 6970, - "description": "Points available for reward redemption." - }, - "next_expiration_date": { - "type": "string", - "format": "date", - "example": "2023-05-30", - "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", - "example": "2021-12-01T00:00:00.000Z", - "format": "date-time", - "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " - }, - "expiration_date": { - "type": "string", - "example": "2021-12-31T00:00:00.000Z", - "format": "date-time", - "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." - }, - "validity_timeframe": { - "type": "object", - "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": { - "duration": { - "type": "string", - "example": "PT1H", - "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." - }, - "interval": { - "type": "string", - "example": "P2D", - "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", - "enum": [ - [ - 0 - ], - [ - 1 - ], - [ - 2 - ], - [ - 3 - ], - [ - 4 - ], - [ - 5 - ], - [ - 6 - ] - ], - "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" - } - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" - }, - "additional_info": { - "type": "string", - "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." - }, - "created_at": { - "type": "string", - "example": "2021-12-22T10:13:06.487Z", - "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2021-12-22T10:14:45.316Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." - }, - "holder_id": { - "type": "string", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "description": "Unique customer ID of voucher owner." - }, - "redemption": { - "type": "object", - "description": "Stores a summary of redemptions that have been applied to the voucher.", - "properties": { - "quantity": { - "type": "integer", - "description": "How many times a voucher can be redeemed. A `null` value means unlimited." - }, - "redeemed_quantity": { - "type": "integer", - "example": 1, - "description": "How many times a voucher has already been redeemed." - }, - "redeemed_points": { - "type": "integer", - "example": 100000, - "description": "Total loyalty points redeemed." - }, - "object": { - "type": "string", - "default": "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", - "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", - "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" - } - } - }, - "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", - "properties": { - "object": { - "type": "string", - "default": "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", - "example": 0, - "description": "Publication events counter." - }, - "url": { - "type": "string", - "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", - "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" - } + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital_loyalty_card_points" } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `voucher`.", - "default": "voucher" - } + ] } - }, - "8_res_get_loyalty_card_transactions": { - "title": "Get Loyalty Card Transactions Response Body", - "type": "object", - "description": "List of loyalty card transactions", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of transaction objects." - }, - "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/1_obj_loyalty_card_transaction_object" - } - }, - "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." - } + } + }, + "type": { + "type": "string", + "description": "Reward type", + "enum": [ + "CAMPAIGN" + ] + } + }, + "title": "Digital Reward" + }, + "7_obj_redemption_object_loyalty_card_digital_discount_voucher": { + "type": "object", + "title": "Discount Voucher", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "DISCOUNT_COUPONS" + ] + } + } + }, + "7_obj_redemption_object_loyalty_card_digital_gift_card_credits": { + "type": "object", + "title": "Gift Card", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "balance": { + "type": "integer", + "description": "The amount credited to the gift card as a reward expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "GIFT_VOUCHERS" + ] + } + } + }, + "7_obj_redemption_object_loyalty_card_digital_loyalty_card_points": { + "type": "object", + "title": "Loyalty Card", + "description": "Contains information about the source of the digital reward.", + "properties": { + "id": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C", + "description": "Unique parent campaign ID of reward." + }, + "balance": { + "type": "integer", + "description": "The number of loyalty points that is added to the loyalty card as a reward." + }, + "type": { + "type": "string", + "description": "Campaign type.", + "enum": [ + "LOYALTY_PROGRAM" + ] + } + } + }, + "7_obj_redemption_rollback_object_gift_card": { + "type": "object", + "title": "Rollback Gift Card", + "description": "This is an object representing a gift card redemption rollback.", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the initial redemption.", + "example": "r_0c5bf3323008a35032" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "1_obj_loyalty_card_transaction_object": { - "title": "Loyalty Card Transaction Object", - "description": "Loyalty card transaction object", - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_redemption" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual_custom_event" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_refund" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_addition" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_removal" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_expiration" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_out" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_in" - } - ] - }, - "1_obj_loyalty_card_transaction_object_redemption": { - "title": "Redemption", - "description": "When loyalty points are used to pay for an order.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a redemption, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "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`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REDEMPTION", - "enum": [ - "POINTS_REDEMPTION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points prior to the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "1_obj_loyalty_card_transaction_object_accrual": { - "title": "Accrual", - "description": "When points are earned on the card through an earning rule.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "event": { - "type": "object", - "description": "Contains information about the event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.order.paid" - } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } - }, - "1_obj_loyalty_card_transaction_object_accrual_custom_event": { - "title": "Accrual for Custom Event", - "description": "When points are earned on the card through an earning rule based on a custom event.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "event": { - "type": "object", - "description": "Contains information about the customer event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.custom_event" - } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } - } - } - } - }, - "custom_event": { - "type": "object", - "description": "Contains information about the custom event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "event_0cc916d8374bfe8bc2" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" - } - } - }, - "event_schema": { - "type": "object", - "description": "Contains information about the custom event metadata schema.", - "properties": { - "id": { - "type": "string", - "description": "Unique metadata schema ID.", - "example": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "gift": { + "type": "object", + "description": "Contains the amount being adde back to the gift card for the redemption rollback", + "properties": { + "amount": { + "type": "integer", + "description": "The amount added back to the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." } - }, - "1_obj_loyalty_card_transaction_object_refund": { - "title": "Refund", - "description": "When points are credited back to a card through a redemption rollback.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points refund, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a points refund, this value is `null`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points refund, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REFUND", - "enum": [ - "POINTS_REFUND" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID.", - "example": "rr_0c9b0967244a862a33" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + } + } + }, + "7_obj_redemption_object_gift_card": { + "type": "object", + "title": "Gift Card", + "description": "This is an object representing a gift card redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "1_obj_loyalty_card_transaction_object_addition": { - "title": "Addition", - "description": "When points are added to a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ADDITION", - "enum": [ - "POINTS_ADDITION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the gift card.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "1_obj_loyalty_card_transaction_object_removal": { - "title": "Removal", - "description": "When points are removed from a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REMOVAL", - "enum": [ - "POINTS_REMOVAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "type": "object", + "description": "Defines the details of the voucher being redeemed.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" } - }, - "1_obj_loyalty_card_transaction_object_expiration": { - "title": "Expiration", - "description": "When points expire.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points expiration, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points expiration, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_EXPIRATION", - "enum": [ - "POINTS_EXPIRATION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points removed during 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } + } + }, + "gift": { + "type": "object", + "description": "Contains the amount being subtracted from the gift card for the redemption.", + "properties": { + "amount": { + "type": "integer", + "description": "The amount subtracted from the gift card expressed as the smallest currency unit (that is, 100 cents for $1.00)." + } + } + } + } + }, + "7_obj_redemption_object_voucher_fail": { + "type": "object", + "title": "Failed Voucher Redemption", + "description": "This is an object representing a failed redemption for a voucher.", + "properties": { + "id": { + "type": "string", + "example": "rf_0bbaccc96e0830ff9e", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "voucher": { + "type": "object", + "description": "Defines the voucher details.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + } + } + }, + "7_obj_redemption_object_promotion_tier_fail": { + "type": "object", + "title": "Failed Promotion Tier Redemption", + "description": "This is an object representing a failed redemption for a promotion tier.", + "properties": { + "id": { + "type": "string", + "example": "rf_0bbaccc96e0830ff9e", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the promotion.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details about the promotion tier and it's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } - }, - "1_obj_loyalty_card_transaction_object_transfer_out": { - "title": "Transfer Out", - "description": "When points are transferred from one loyalty card to another.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_OUT", - "enum": [ - "POINTS_TRANSFER_OUT" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "destination_voucher": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the destination voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the destination voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. This does not mean that the transferred points were added to this bucket. It only shows the next set of points due to expire. The transferred points are added to the last expiring bucket, i.e. to the bucket of points that are to expire the furthest in the future.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the next expiration date." - } - } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the receiving card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + } + } + }, + "7_obj_redemption_object_fail": { + "type": "object", + "title": "Failed Redemption", + "description": "This is an object representing a failed redemption when a resource to be redeemed cannot be found.", + "properties": { + "id": { + "type": "string", + "example": "rf_0c4c7baf58c243af6b", + "description": "Unique failed redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "null", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "null", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "not_found", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "1_obj_loyalty_card_transaction_object_transfer_in": { - "title": "Transfer In", - "description": "When points are transferred in from another loyalty card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a ponits transfer, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_IN", - "enum": [ - "POINTS_TRANSFER_IN" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "source_voucher": { - "type": "object", - "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the source voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the source voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "holder_id": { - "type": "string", - "description": "Unqiue customer ID of the loyalty card holder, this is the ID that was assigned by the Voucherify API.", - "example": "cust_xqA7DGj5eYPHg6PHVKwYRWiA" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the source loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after 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." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. The points from the source loyalty card are taken from the expiration bucket(s) that are the first coming up to expire, starting from the first expiration bucket to expire in time. This parameter shows the next expiration date after the points were taken out of the loyalty card.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the expiration date." - } - } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the source card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } + } + }, + "customer": { + "type": "null" + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| redemption | Related redemption. |\n", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "rf_0c5bde8dfc0156f0e3" + }, + "voucher": { + "type": "null" + } + } + }, + "7_obj_redemption_rollback_object_voucher_fail": { + "type": "object", + "title": "Failed Voucher Redemption Rollback", + "description": "This is an object representing a failed redemption rollback for a voucher.", + "properties": { + "id": { + "type": "string", + "example": "rrf_0c63990fed133bfb88", + "description": "Unique failed redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "failure_code": { + "type": "string", + "example": "already_rolled_back", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "8_req_create_loyalty_card_transactions_export": { - "type": "object", - "title": "Create Loyalty Card Transactions Export Request Body", - "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", - "description": "Contains the parameters that define the data to be exported." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "8_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n\n| **Related Object** | **Definition** |\n| :--- | :--- |\n| voucher | Either a discount voucher, gift card, or loyalty card. |\n", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "voucher": { + "type": "object", + "description": "Defines the voucher details.", + "properties": { + "id": { + "type": "string", + "description": "Unique voucher ID assigned by Voucherify.", + "example": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + }, + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "campaign": { + "type": "string", + "description": "Voucher's parent campaign name." + }, + "campaign_id": { + "type": "string", + "description": "Unique campaign ID assigned by Voucherify.", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + } + } + } + } + }, + "7_obj_redemption_rollback_object_promotion_tier_fail": { + "type": "object", + "title": "Failed Promotion Tier Redemption Rollback", + "description": "This is an object representing a failed redemption rollback for a promotion tier.", + "properties": { + "id": { + "type": "string", + "example": "rrf_0c5eb3bd884497ed05", + "description": "Unique failed redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "The unique redemption ID of the initial redemption.", + "example": "r_0c5d6689b35320059a" + }, + "reason": { + "type": "string", + "description": "The reason for the redemption rollback." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "failure_code": { + "type": "string", + "example": "customer_rules_violated", + "description": "If the result is `FAILURE`, this parameter will provide a generic reason as to why the redemption failed." + }, + "failure_message": { + "type": "string", + "description": "If the result is `FAILURE`, this parameter will provide a more expanded reason as to why the redemption failed." + }, + "order": { + "type": "null" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the promotion.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.\n", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details about the promotion tier and it's parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." } } } - }, - "8_obj_export_transactions_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [loyalty card transactions](ref:list-loyalty-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "default": "API" - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "default": "voucher_transactions" - }, - "parameters": { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - }, - "result": { - "type": "object", - "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](ref:download-export) method." - } + } + } + } + }, + "7_obj_redemption_rollback_object_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption rollback", + "properties": { + "id": { + "type": "string", + "example": "rr_0bc92f81a6801f9bca", + "description": "Unique redemption rollback ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption_rollback`.", + "default": "redemption_rollback" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption rollback occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of initial redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption rollback result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption rollback.", + "$ref": "#/components/schemas/7_obj_order_object_rollback" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption rollback was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption rollback. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption rollback. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" } } - }, - "8_obj_loyalty_tier_object": { - "type": "object", - "title": "Loyalty Tier Object", - "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "properties": { - "id": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": "object", - "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", - "example": "2022-11-10T12:20:52.755Z", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-25T10:59:43.231Z", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "earning_rules": { - "type": "object", - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", - "properties": { - "unique_earning_rule_ID": { - "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." - } - } - } - } - }, - "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." - } - } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." - } + } + } + } + }, + "7_obj_redemption_object_promotion_tier": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption if this particular redemption was issued through a stacked redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "8_obj_loyalty_tier_object_member": { - "type": "object", - "title": "Loyalty Tier Object", - "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "properties": { - "id": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": "object", - "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", - "example": "2022-11-10T12:20:52.755Z", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-25T10:59:43.231Z", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "earning_rules": { - "type": "object", - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", - "properties": { - "unique_earning_rule_ID": { - "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." - } - } - } - } - }, - "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": "Contains information about when the expiration tier will expire.", - "properties": { - "customer_id": { - "type": "string", - "example": "cust_qBwHpagDOFu71Z3F22UzR80X", - "description": "Unique customer ID whose point expiration dates are defined in this object." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "tier_id": { - "type": "string", - "example": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "description": "Unique loyalty tier ID." - }, - "start_date": { - "type": "string", - "example": "2022-11-10", - "description": "Exact start date of the loyalty tier for the given customer." - }, - "expiration_date": { - "type": "string", - "example": "2023-02-28", - "description": "Exact expiration date of the loyalty tier for the given customer." - }, - "created_at": { - "type": "string", - "example": "2022-11-09T11:26:26.719Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-11-10T08:54:47.200Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "type": "object", + "description": "Contains details of the promotion tier and the parent campaign.", + "properties": { + "id": { + "type": "string", + "description": "Unique promotion tier ID assigned by Voucherify.", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "campaign": { + "type": "object", + "description": "Promotion tier's parent campaign.", + "properties": { + "id": { + "type": "string", + "example": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "description": "Unique ID assigned by Voucherify of the promotion tier's parent campaign." } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." } } - }, - "8_obj_mapping_multiply": { - "type": "object", - "title": "Multiply Points", - "description": "Points are multiplied by a multiplier.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "MULTIPLY" - ] - }, - "multiplier": { - "type": "integer", - "description": "Multiplication factor used to multiply the points to obtain the mapped points." - } + } + } + } + }, + "7_obj_redemption_object_promotion_tier_extended": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "8_obj_mapping_fixed": { - "type": "object", - "title": "Fixed Points", - "description": "Points are fixed.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "CUSTOM" - ] - }, - "points": { - "type": "integer", - "description": "Fixed number of points to be applied." - } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" } - }, - "8_obj_earning_rule_object": { - "description": "This is an object representing an earning rule.", - "title": "Earning Rule Object", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - }, - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - }, - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" - } - ] - }, - "8_obj_earning_rule_object_no_validation_rule": { - "description": "This is an object representing an earning rule.", - "title": "Earning Rule Object", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - }, - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - }, - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier_no_validation_rule" - } - ] - }, - "8_obj_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "description": "Contains details of the promotion tier and the parent campaign.", + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + } + }, + "7_obj_redemption_object_promotion_tier_extended_stacked": { + "type": "object", + "title": "Promotion Tier", + "description": "This is an object representing a promotion tier redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "redemption": { + "type": "string", + "description": "Unique redemption ID of the parent redemption.", + "example": "r_0c656311b5878a2031" + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] } - }, - "8_req_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { + } + }, + "customer": { + "type": "object", + "description": "Defines the customer that is related to the redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. promo_NzjTc3ZXTe7md5SziK3uYtei for a promotion tier." + }, + "voucher": { + "type": "null" + }, + "promotion_tier": { + "description": "Contains details of the promotion tier and the parent campaign.", + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + } + } + }, + "7_obj_redemption_object_stackable_discounts": { + "type": "object", + "title": "Stacked Redemption", + "description": "This is an object representing a stacked redemption.", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the `redemption`.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object_stacked_redemptions" + }, + "channel": { + "type": "object", + "description": "Defines the details of the channel through which the redemption was issued.", + "properties": { + "channel_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "description": "Unique channel ID of the user performing the redemption. This is either a user ID from a user using the Voucherify Dashboard or an X-APP-Id of a user using the API." + }, + "channel_type": { + "type": "string", + "description": "The source of the channel for the redemption. A `USER` corresponds to the Voucherify Dashboard and an `API` corresponds to the API.", + "enum": [ + "USER", + "API" + ] + } + } + }, + "customer": { + "type": "object", + "description": "Defines the customer making the stacked redemption.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object.", + "enum": [ + "redemption" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. r_0c5d07222e08a34ace for a redemption." + }, + "voucher": { + "type": "null" + } + } + }, + "7_res_get_redemption": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" + } + ], + "title": "Get Redemption Response Body", + "description": "Response body schema for **GET** `/redemptions/{redemptionId}" + }, + "7_res_list_redemptions": { + "title": "List Redemptions Response Body", + "type": "object", + "description": "Response body schema for **GET** `/redemptions`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "redemptions", + "description": "Identifies the name of the attribute that contains the array of redemption objects." + }, + "redemptions": { + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object" + }, + { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_truncated" + } + ] + }, + "total": { + "type": "integer", + "description": "Total number of redemptions." + } + } + }, + "7_filter_conditions_string": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + } + } + }, + "7_res_get_vouchers_redemptions": { + "type": "object", + "title": "Get Voucher's Redemptions Response Body", + "description": "Response body schema for **GET** `/vouchers/{code}/redemption`.", + "properties": { + "quantity": { + "type": "integer", + "description": "The maximum number of times a voucher can be redeemed." + }, + "redeemed_quantity": { + "type": "integer", + "description": "The number of times the voucher was redeemed successfully." + }, + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about redemptions in a dictionary." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/PROMO-CODE2/redemptions?page=1&limit=10", + "description": "URL " + }, + "data_ref": { + "type": "string", + "default": "redemption_entries", + "description": "Identifies the name of the attribute that contains the array of `redemption_entries`." + }, + "total": { + "type": "integer", + "description": "Total number of redemption objects." + }, + "redemption_entries": { + "type": "array", + "description": "Contains the array of successful and failed redemption objects.", + "items": { + "$ref": "#/components/schemas/7_obj_redemption_object_voucher" + } + } + } + }, + "7_req_redeem_voucher": { + "title": "Redeem Voucher Request Body", + "description": "Request body schema for redeeming a voucher using **POST** `/vouchers/{code}/redemption`.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_req_redeem_voucher_discount_code" + }, + { + "$ref": "#/components/schemas/7_req_redeem_voucher_gift_card" + }, + { + "$ref": "#/components/schemas/7_req_redeem_voucher_loyalty_card" + } + ] + }, + "7_res_redeem_voucher": { + "title": "Redeem Voucher Response Body", + "$ref": "#/components/schemas/7_obj_redemption_object_voucher_extended", + "description": "Response body schema for **POST** `/vouchers/{code}/redemption`." + }, + "7_req_redeem_promotion_tier": { + "title": "Redeem Promotion Tier", + "type": "object", + "description": "Redeem a promotion tier.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against promotion tiers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "7_req_redeem_voucher_discount_code": { + "title": "Discount Code", + "type": "object", + "description": "Redeem a discount code.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_discount_code" + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { "type": "string", "enum": [ - "order.paid" + "category" ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + "example": "category" } } - }, - "8_req_update_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { + } + } + } + }, + "7_req_redeem_voucher_gift_card": { + "title": "Gift Card", + "type": "object", + "description": "Redeem a gift card.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_gift_card" + }, + "gift": { + "type": "object", + "description": "Contains information on the number of gift card credits that the customer wants to apply to the order.", + "properties": { + "credits": { + "type": "integer", + "description": "The number of credits that the user wants to use from the gift card to fulfil the order. The value of credits cannot be higher than the current balance on the gift card. If the user gives more points than he has on the gift card, the application will return an error code in response. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + "enum": [ + "category" + ], + "example": "category" } } - }, - "8_obj_earning_rule_object_order_paid_no_validation_rule": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 + } + } + } + }, + "7_req_redeem_voucher_loyalty_card": { + "title": "Loyalty Card", + "type": "object", + "description": "Redeem a loyalty card.", + "properties": { + "session": { + "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" + }, + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward." + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card. If the user gives more points than he/she has on the loyalty card, the application will return an error code in response." + } + } + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. Add `category` as a string in the array to include a `categories` object in the response.", + "items": { + "type": "string", + "enum": [ + "category" ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + "example": "category" } } - }, - "8_obj_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + } + } + }, + "7_req_rollback_redemption": { + "title": "Rollback Redemption Request Body", + "type": "object", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_rollback_redemption_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_rollback_redemption_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "8_req_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_rollback_redemption_order_id" + }, + { + "$ref": "#/components/schemas/6_req_rollback_redemption_order_source_id" } - }, - "8_req_update_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + ], + "description": "Send order information to ensure the correct order is being undone." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to update **redemption** metadata." + } + }, + "description": "Request body schema for **POST** `/redemptions/{redemptionId}/rollback`." + }, + "7_res_rollback_redemption": { + "title": "Rollback Redemption Response Body", + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended", + "description": "Response body schema for **POST** `/redemptions/{redemptionId}/rollback`." + }, + "8_obj_loyalty_campaign_object": { + "title": "Loyalty Campaign Object", + "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", + "x-tags": [ + "LOYALTIES API" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Loyalty campaign name." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } - }, - "8_obj_earning_rule_object_entered_segment_no_validation_rule": { - "description": "This is an object representing an earning rule for entering a customer segment.", - "type": "object", - "title": "Earning Rule Object for Entered Segment", - "examples": [ - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" } - }, - "8_obj_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + ] + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + } + } + }, + "8_obj_loyalty_campaign_object_no_extended_categories": { + "title": "Loyalty Campaign Object", + "description": "This is an object representing a loyalty campaign. \n\nThe loyalty campaign object contains details about the loyalty campaign. You can use dedicated endpoints to list loyalty campaigns, list loyalty card holders, member activities, active rewards, earning rules, loyalty tiers for given loyalty campaign.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" + }, + "name": { + "type": "string", + "description": "Loyalty campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM" + ], + "description": "Type of campaign." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "voucher": { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" + ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" + ] + }, + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/2_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "object": { + "type": "string", + "default": "campaign", + "description": "The type of object represented by JSON. This object stores information about the campaign." + } + } + }, + "8_obj_loyalty_card_object": { + "title": "Loyalty Card Object", + "type": "object", + "description": "This is an object representing a loyalty card.", + "examples": [ + { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 }, - "8_req_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" } }, - "8_req_update_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + } + ], + "properties": { + "id": { + "type": "string", + "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", + "description": "Assigned by the Voucherify API, identifies the voucher." + }, + "code": { + "type": "string", + "example": "WVPblOYX", + "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + }, + "campaign": { + "type": "string", + "example": "Loyalty Card Campaign", + "description": "A unique campaign name, identifies the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + }, + "category_id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify.", + "example": "cat_0bb343dee3cdb5ec0c" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ], + "description": "Defines the type of voucher. " + }, + "discount": { + "default": null, + "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", + "type": "null" + }, + "gift": { + "type": "null", + "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." + }, + "loyalty_card": { + "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption." + }, + "next_expiration_date": { + "type": "string", + "format": "date", + "example": "2023-05-30", + "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", + "example": "2021-12-01T00:00:00.000Z", + "format": "date-time", + "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " + }, + "expiration_date": { + "type": "string", + "example": "2021-12-31T00:00:00.000Z", + "format": "date-time", + "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." + }, + "validity_timeframe": { + "type": "object", + "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": { + "duration": { + "type": "string", + "example": "PT1H", + "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." + }, + "interval": { + "type": "string", + "example": "P2D", + "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", + "enum": [ + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ], + "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" + } + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "additional_info": { + "type": "string", + "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." }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "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." }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + "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`" + } } } - }, - "8_obj_earning_rule_object_custom_event_no_validation_rule": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "created_at": { + "type": "string", + "example": "2021-12-22T10:13:06.487Z", + "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2021-12-22T10:14:45.316Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." + }, + "holder_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of voucher owner." + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + }, + "redeemed_quantity": { + "type": "integer", + "example": 1, + "description": "How many times a voucher has already been redeemed." + }, + "redeemed_points": { + "type": "integer", + "example": 100000, + "description": "Total loyalty points redeemed." + }, + "object": { + "type": "string", + "default": "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", + "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" } - }, - "8_obj_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + }, + "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", + "properties": { + "object": { + "type": "string", + "default": "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", + "example": 0, + "description": "Publication events counter." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", + "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" } - }, - "8_req_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `voucher`.", + "default": "voucher" + } + }, + "x-tags": [ + "LOYALTIES API" + ] + }, + "8_obj_loyalty_reward_object": { + "title": "Loyalty Reward Object", + "type": "object", + "description": "This is an object representing a loyalty reward.", + "x-tags": [ + "LOYALTIES API" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "assignment": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "object": { + "type": "string", + "default": "loyalty_reward", + "description": "The type of object represented by JSON. This object stores information about the loyalty reward object." + } + } + }, + "8_obj_loyalty_points_bucket": { + "type": "object", + "title": "Loyalty Points Bucket Object", + "description": "This is an object representing a loyalty points bucket.", + "properties": { + "id": { + "type": "string", + "example": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", + "description": "Unique loyalty points bucket ID." + }, + "voucher_id": { + "type": "string", + "example": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "description": "Unique parent loyalty card ID." + }, + "campaign_id": { + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "description": "Unique parent campaign ID." + }, + "bucket": { + "type": "object", + "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." + } + } + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE" + ], + "description": "Loyalty points bucket point status." + }, + "expires_at": { + "type": "string", + "example": "2022-11-30", + "format": "date", + "description": "Date when the number of points defined in the `bucket` object are due to expire." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-11-21T13:49:54.949Z", + "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-08-30T08:34:45.989Z", + "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", + "default": "loyalty_points_bucket", + "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." + } + } + }, + "8_obj_loyalty_tier_reward_object": { + "title": "Loyalty Tier Reward Object", + "type": "object", + "description": "This is an object representing a loyalty tier reward.", + "x-tags": [ + "LOYALTIES API" + ], + "properties": { + "reward": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "assignment": { + "$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." + } + } + }, + "8_obj_loyalty_card_object_non_expanded_categories": { + "title": "Loyalty Card Object", + "type": "object", + "description": "This is an object representing a loyalty card.", + "examples": [ + { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 }, - "8_req_update_earning_rule_object_tier": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" } }, - "8_obj_earning_rule_object_tier_no_validation_rule": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.", - "type": "null" - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_fixed_points": { - "title": "Define Fixed Amount of Points", - "type": "object", - "description": "This is an object representing points calculated based on a fixed value.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points to be added to the loyalty card.", - "example": 100 - }, - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", - "enum": [ - "FIXED" - ] - } - } + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 }, - "8_obj_calculate_points_proportionally_order_paid": { - "title": "Calculate Points Proportionally", - "description": "This is an object representing points calculated proportionally to another property.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_amounts" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_total_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_metadata" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_item_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_subtotal_amount" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_quantity" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" }, - "8_obj_calculate_points_proportionally_order_amounts": { - "title": "Calculate Points Proportionally to Order Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_AMOUNT" - ], - "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" - }, - "order": { - "type": "object", - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } - } - } - } + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" }, - "8_obj_calculate_points_proportionally_order_total_amount": { - "title": "Calculate Points Proportionally to Total Order Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_TOTAL_AMOUNT" - ], - "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" - }, - "order": { - "type": "object", - "properties": { - "total_amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } - } - } + "object": "voucher" + } + ], + "properties": { + "id": { + "type": "string", + "example": "v_mkZN9v7vjYUadXnHrMza8W5c34fE5KiV", + "description": "Assigned by the Voucherify API, identifies the voucher." + }, + "code": { + "type": "string", + "example": "WVPblOYX", + "description": "A code that identifies a voucher. Pattern can use all letters of the English alphabet, Arabic numerals, and special characters." + }, + "campaign": { + "type": "string", + "example": "Loyalty Card Campaign", + "description": "A unique campaign name, identifies the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "description": "Assigned by the Voucherify API, identifies the voucher's parent campaign." + }, + "category": { + "type": "string", + "description": "Tag defining the category that this voucher belongs to. Useful when listing vouchers using the List Vouchers endpoint." + }, + "category_id": { + "type": "string", + "description": "Unique category ID assigned by Voucherify.", + "example": "cat_0bb343dee3cdb5ec0c" + }, + "categories": { + "type": "array", + "description": "Contains details about the category.", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ], + "description": "Defines the type of voucher. " + }, + "discount": { + "default": null, + "description": "Object representing discount parameters. Child attributes are present only if `type` is `DISCOUNT_VOUCHER`. Defaults to `null`.", + "type": "null" + }, + "gift": { + "type": "null", + "description": "Object representing gift parameters. Child attributes are present only if `type` is `GIFT_VOUCHER`. Defaults to `null`." + }, + "loyalty_card": { + "type": "object", + "description": "Object representing loyalty card parameters. Child attributes are present only if `type` is `LOYALTY_CARD`.", + "properties": { + "points": { + "type": "integer", + "example": 7000, + "description": "Total points incurred over lifespan of loyalty card." + }, + "balance": { + "type": "integer", + "example": 6970, + "description": "Points available for reward redemption." + }, + "next_expiration_date": { + "type": "string", + "format": "date", + "example": "2023-05-30", + "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." } - }, - "8_obj_calculate_points_proportionally_order_metadata": { - "title": "Calculate Points Proportionally To an Order Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to an order metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_METADATA" - ], - "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `order.metadata` object)" - }, - "order": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the order metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "number_of_store_visits", - "description": "Order metadata property." - } - } - } - } - } + } + }, + "start_date": { + "type": "string", + "example": "2021-12-01T00:00:00.000Z", + "format": "date-time", + "description": "Activation timestamp defines when the code starts to be active in ISO 8601 format. Voucher is *inactive before* this date. " + }, + "expiration_date": { + "type": "string", + "example": "2021-12-31T00:00:00.000Z", + "format": "date-time", + "description": "Expiration timestamp defines when the code expires in ISO 8601 format. Voucher is *inactive after* this date." + }, + "validity_timeframe": { + "type": "object", + "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": { + "duration": { + "type": "string", + "example": "PT1H", + "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." + }, + "interval": { + "type": "string", + "example": "P2D", + "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." } - }, - "8_obj_calculate_points_proportionally_item_amount": { - "title": "Calculate Points Proportionally to Order Items Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_AMOUNT" - ], - "description": "- `ORDER_ITEMS_AMOUNT`; Pre-discount amount spent on items defined in the `order_items.amount.object` & `.id` (X points for every Y spent on items excluding discounts)" - }, - "order_items": { - "type": "object", - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." - } - } - } + } + }, + "validity_day_of_week": { + "type": "array", + "enum": [ + [ + 0 + ], + [ + 1 + ], + [ + 2 + ], + [ + 3 + ], + [ + 4 + ], + [ + 5 + ], + [ + 6 + ] + ], + "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" + } + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the voucher on or off. You can disable a voucher even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* voucher\n- `false` indicates an *inactive* voucher" + }, + "additional_info": { + "type": "string", + "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`" } } - } - }, - "8_obj_calculate_points_proportionally_items_subtotal_amount": { - "title": "Calculate Points Proportionally to Order Items Subtotal Amount", - "type": "object", - "description": "This is an object representing points calculated proportionally to another property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_SUBTOTAL_AMOUNT" - ], - "description": "- `ORDER_ITEMS_SUBTOTAL_AMOUNT`; Amount spent on items defined in the `order_items.subtotal_amount.object` & `.id` (X points for every Y spent on items including discounts)" - }, - "order_items": { - "type": "object", - "properties": { - "subtotal_amount": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." - } - } - } + }, + "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`" } } } - }, - "8_obj_calculate_points_proportionally_items_quantity": { - "title": "Calculate Points Proportionally to Quantity of Items in the Cart", - "type": "object", - "description": "This is an object representing points calculated proportionally to quantity of items in the cart.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_QUANTITY" - ], - "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in `order_items.quantity.object` & `.id` (X points for every Y items excluding free items)" - }, - "order_items": { - "type": "object", - "properties": { - "quantity": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." - } - } - } - } - } + } + }, + "is_referral_code": { + "type": "boolean", + "description": "Flag indicating whether this voucher is a referral code." + }, + "created_at": { + "type": "string", + "example": "2021-12-22T10:13:06.487Z", + "description": "Timestamp representing the date and time when the voucher was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2021-12-22T10:14:45.316Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the voucher was last updated in ISO 8601 format." + }, + "holder_id": { + "type": "string", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "description": "Unique customer ID of voucher owner." + }, + "redemption": { + "type": "object", + "description": "Stores a summary of redemptions that have been applied to the voucher.", + "properties": { + "quantity": { + "type": "integer", + "description": "How many times a voucher can be redeemed. A `null` value means unlimited." + }, + "redeemed_quantity": { + "type": "integer", + "example": 1, + "description": "How many times a voucher has already been redeemed." + }, + "redeemed_points": { + "type": "integer", + "example": 100000, + "description": "Total loyalty points redeemed." + }, + "object": { + "type": "string", + "default": "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", + "example": "/v1/vouchers/WVPblOYX/redemptions?page=1&limit=10", + "description": "The endpoint where this list of redemptions can be accessed using a GET method. `/v1/vouchers/{voucher_code}/redemptions`" } - }, - "8_obj_calculate_points_proportionally_customer_metadata": { - "title": "Calculate Points Proportionally To a Customer Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to a customer metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "`CUSTOMER_METADATA`: Customer Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `customer.metadata` object)" - }, - "customer": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "customer_life_time_value", - "description": "Customer metadata property." - } - } - } - } - } + } + }, + "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. \n\n\n\n| Required | Optional |\n| -------- | :------: |\n| `type`:`LOYALTY_CARD` | `type`:`DISCOUNT_VOUCHER` | \n| `is_referral_code`:`true` | `type`:`GIFT_VOUCHER` |\n", + "properties": { + "object": { + "type": "string", + "default": "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", + "example": 0, + "description": "Publication events counter." + }, + "url": { + "type": "string", + "example": "/v1/vouchers/WVPblOYX/publications?page=1&limit=10", + "description": "The endpoint where this list of publications can be accessed using a GET method. `/v1/vouchers/{voucher_code}/publications`" } - }, - "8_obj_calculate_points_proportionally_custom_event_metadata": { - "title": "Calculate Points Proportionally To a Custom Event Metadata Property", - "type": "object", - "description": "This is an object representing points calculated proportionally to a custom event metadata property.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", - "enum": [ - "PROPORTIONAL" - ] - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "`CUSTOM_EVENT_METADATA`: Custom Event Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `custom_event.metadata` object)" - }, - "custom_event": { - "type": "object", - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the custom event metadata property to grant points for.", - "example": 100 - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", - "example": 10 - }, - "property": { - "type": "string", - "example": "volume_number", - "description": "Custom event metadata property." - } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `voucher`.", + "default": "voucher" + } + } + }, + "8_res_get_loyalty_card_transactions": { + "title": "Get Loyalty Card Transactions Response Body", + "type": "object", + "description": "List of loyalty card transactions", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of transaction objects." + }, + "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/1_obj_loyalty_card_transaction_object" + } + }, + "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." + } + } + }, + "1_obj_loyalty_card_transaction_object": { + "title": "Loyalty Card Transaction Object", + "description": "Loyalty card transaction object", + "anyOf": [ + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_redemption" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual_custom_event" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_refund" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_addition" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_removal" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_expiration" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_out" + }, + { + "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_in" + } + ] + }, + "1_obj_loyalty_card_transaction_object_redemption": { + "title": "Redemption", + "description": "When loyalty points are used to pay for an order.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a redemption, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "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`." + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REDEMPTION", + "enum": [ + "POINTS_REDEMPTION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points prior to the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } } - } - }, - "8_res_list_loyalty_campaigns": { - "title": "List Loyalty Campaigns Response Body", - "type": "object", - "description": "Response body schema for listing loyalty campaigns using **GET** `/loyalties`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty campaigns in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "campaigns", - "description": "Identifies the name of the attribute that contains the array of loyalty campaign objects." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of loyalty campaign objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object_no_extended_categories" + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty campaign objects." } - } - }, - "8_req_create_loyalty_cards": { - "type": "object", - "title": "Create Loyalty Campaign Request Body", - "description": "Request body schema for creating a loyalty campaign.", - "properties": { - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign (size of campaign)." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "voucher": { - "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" } - } - }, - "8_loyalty_tiers_expiration_balance": { - "title": "Balance", - "type": "object", - "description": "Defines the Balance expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "BALANCE" - ], - "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." - } + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID.", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" + }, + "name": { + "type": "string", + "description": "Reward name.", + "example": "100 = $20" } - }, - "expiration_date": { - "description": "Defines the conditions for the expiration date of a tier.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_balance_drop" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_custom" - } - ] } } - }, - "8_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { - "title": "Balance Drop", - "type": "object", - "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", - "properties": { - "type": { - "type": "string", - "enum": [ - "BALANCE_DROP" - ], - "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." - } - } - }, - "8_loyalty_tiers_expiration_balance_expiration_date_custom": { - "title": "Custom", - "type": "object", - "description": "Defines the custom conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." - }, - "extend": { - "type": "string", - "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." - }, - "rounding": { - "description": "Defines the rounding mechanism for tier expiration.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_default_options" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_custom" + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_accrual": { + "title": "Accrual", + "description": "When points are earned on the card through an earning rule.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points accrual, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ACCRUAL", + "enum": [ + "POINTS_ACCRUAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } } - ] + } } - } - }, - "8_loyalty_tiers_expiration_expiration_date_rounding_default_options": { - "title": "Calendar Periods", - "type": "object", - "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", - "properties": { - "type": { - "type": "string", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ], - "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" + }, + "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." + } } - } - }, - "8_loyalty_tiers_expiration_expiration_date_rounding_custom": { - "title": "Specific Month", - "type": "object", - "description": "Defines the custom rounding mechanism for tier expiration.", - "properties": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "This mechanism describes a custom rounding for the expiration date." - }, - "unit": { - "type": "string", - "description": "Defines the type of unit of time in which the rounding period is counted.", - "enum": [ - "MONTH" - ] - }, - "value": { - "type": "integer", - "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" + }, + "event": { + "type": "object", + "description": "Contains information about the event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "evcus_0c9c21def34e3c05bf" + }, + "type": { + "type": "string", + "description": "Type of event.", + "example": "customer.order.paid" + } } - } - }, - "8_loyalty_tiers_expiration_points_in_period": { - "title": "Points in Period", - "type": "object", - "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", - "properties": { - "qualification_type": { - "type": "string", - "enum": [ - "POINTS_IN_PERIOD" - ], - "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." - }, - "qualification_period": { - "type": "string", - "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
                  January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
                  - January - March
                  - April - June
                  - July - September
                  - October - December |\n| **Calendar Half-year** | Points collected in the half-year
                  - January - June
                  - July - December |\n| **Calendar Year** | Points collected in one calendar year
                  January - December |", - "enum": [ - "MONTH", - "QUARTER", - "HALF_YEAR", - "YEAR" - ] - }, - "start_date": { - "type": "object", - "description": "Defines the conditions for the start date of the tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "IMMEDIATE", - "NEXT_PERIOD" - ], - "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID.", + "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" + }, + "source": { + "type": "object", + "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." + } } } - }, - "expiration_date": { - "type": "object", - "description": "Defines the conditions for the expiration date of a tier.", - "properties": { - "type": { - "type": "string", - "enum": [ - "END_OF_PERIOD", - "END_OF_NEXT_PERIOD" - ], - "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." - }, - "extend": { - "type": "string", - "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." - } - } - } - } - }, - "8_req_update_loyalty_campaign": { - "type": "object", - "title": "Update Loyalty Campaign Request Body", - "description": "Request body schema for updating a loyalty campaign using **PUT** `/loyalties/{campaignId}`.", - "properties": { - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "loyalty_tiers_expiration": { - "type": "object", - "description": "Defines the expiration mechanism for loyalty tiers.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" - }, - { - "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" - } - ] - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", - "example": "cat_0b688929a2476386a7" - }, - "category": { - "type": "string", - "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." - }, - "loyalty_card": { - "description": "Defines the loyalty card details.", - "type": "object", - "properties": { - "points": { - "type": "integer", - "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." - }, - "expiration_rules": { - "type": "object", - "description": "Defines point expiration rules.", - "properties": { - "period_type": { - "type": "string", - "enum": [ - "MONTH" - ], - "description": "The expiration period." - }, - "period_value": { - "type": "integer", - "description": "How many periods should pass before the expiration occurs." - }, - "rounding_type": { - "type": "string", - "enum": [ - "END_OF_MONTH", - "END_OF_QUARTER", - "END_OF_HALF_YEAR", - "END_OF_YEAR", - "PARTICULAR_MONTH" - ], - "description": "Round up expiration till the end of the given period type." - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." } } - }, - "8_req_create_earning_rules": { - "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", - "title": "Create Earning Rule Request Body", - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_earning_rule_object_order_paid" + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_accrual_custom_event": { + "title": "Accrual for Custom Event", + "description": "When points are earned on the card through an earning rule based on a custom event.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points accrual, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ACCRUAL", + "enum": [ + "POINTS_ACCRUAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_entered_segment" + "total": { + "type": "integer", + "description": "The available points after the transaction." }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_custom_event" + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" }, - { - "$ref": "#/components/schemas/8_req_earning_rule_object_tier" - } - ] - } - }, - "8_req_create_earning_rules_copy": { - "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", - "type": "object", - "title": "Create Earning Rule Request Body", - "properties": { - "event": { - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. Read more here. \n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment. Read more here. \n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining custom events. " - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "description": "Fixed. Applicable to events `order.paid`, `customer.segment.entered`, and `custom_event`.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points to be added to the loyalty card.", - "example": 1000 - }, - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", - "default": "FIXED" - } - }, - "required": [ - "points", - "type" - ] - }, - { - "description": "Proportional. Applicable to only `order.paid`.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio", - "default": "PROPORTIONAL" - }, - "order": { - "type": "object", - "description": "Defines proportion for calculating how many points to add to a loyalty card. The ratio is based on the order amount. For `every` dollar spent, the customer will get this many `points`. \n", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the order amount.", - "required": [ - "every", - "points" - ], - "properties": { - "every": { - "type": "integer", - "description": "Order amount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points awarded." - } - } - } - } - } + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, - "required": [ - "type", - "order" - ] - } - ], - "type": "object" - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } } } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day. `start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } + } + }, + "event": { + "type": "object", + "description": "Contains information about the customer event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "evcus_0c9c21def34e3c05bf" }, - "required": [ - "duration", - "interval" - ] - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" + "type": { + "type": "string", + "description": "Type of event.", + "example": "customer.custom_event" } - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API." - } + } + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID.", + "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + "source": { + "type": "object", + "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" - ] + } } }, - "required": [ - "event", - "loyalty" - ] - }, - "8_req_update_earning_rule": { - "description": "Request body schema for updating earning rules using **PUT** `/loyalties/{campaignId}/earning-rules/{earningRuleId}` endpoint.", - "title": "Update Earning Rule Request Body", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_order_paid" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_entered_segment" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_custom_event" - }, - { - "$ref": "#/components/schemas/8_req_update_earning_rule_object_tier" - } - ] - }, - "8_res_list_earning_rules": { - "description": "Response body schema for listing earning rules using **GET** `/loyalties/{campaignId}/earning-rules` endpoint.", - "type": "object", - "title": "List Earning Rules Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "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/8_obj_earning_rule_object" + "custom_event": { + "type": "object", + "description": "Contains information about the custom event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID.", + "example": "event_0cc916d8374bfe8bc2" + }, + "type": { + "type": "string", + "description": "Type of custom event.", + "example": "user_subscribed" } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } - } - }, - "8_req_add_remove_points_balance": { - "title": "Add or Remove Points Balance Request Body", - "type": "object", - "description": "Request schema for adding or removing points from a loyalty card.", - "properties": { - "points": { - "type": "integer", - "description": "Incremental balance to be added to/subtracted from the loyalty card. \n\nTo add points: `100` \nTo subtract points, add a minus: `-100`" - }, - "expiration_type": { - "type": "string", - "default": "PROGRAM_RULES", - "enum": [ - "PROGRAM_RULES", - "NON_EXPIRING", - "CUSTOM_DATE" - ], - "description": "Set the type of expiration for added points. \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", - "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`.", - "example": "2020-05-30" - }, - "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." } - } - }, - "8_res_add_remove_points_balance": { - "description": "Response schema for adding or removing points from a loyalty card.", - "type": "object", - "title": "Add or Remove Loyalty Card Balance Response Body", - "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", - "description": "The balance after adding/removing points." - }, - "type": { - "type": "string", - "description": "The type of voucher being modified.", - "default": "loyalty_card" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `balance`.", - "default": "balance" - }, - "related_object": { - "type": "object", - "description": "Defines the object that is being modified with the values that are returned in the balance object.", - "properties": { - "type": { - "type": "string", - "description": "The object being modified.", - "default": "voucher" - }, - "id": { - "type": "string", - "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - } + }, + "event_schema": { + "type": "object", + "description": "Contains information about the custom event metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID.", + "example": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "type": { + "type": "string", + "description": "Type of custom event.", + "example": "user_subscribed" } } } - }, - "8_req_transfer_loyalty_points": { - "description": "Request body schema for transferring points from a loyalty card.", - "type": "array", - "title": "Transfer Loyalty Points Request Body", - "items": { + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_refund": { + "title": "Refund", + "description": "When points are credited back to a card through a redemption rollback.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points refund, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a points refund, this value is `null`." + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points refund, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REFUND", + "enum": [ + "POINTS_REFUND" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { - "code": { + "type": { "type": "string", - "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source).", - "example": "L-CARD-02hgnq4" + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" }, "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).", - "example": 2 + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." }, - "reason": { + "related_object": { + "type": "object", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" + } + } + } + } + }, + "order": { + "type": "object", + "description": "Contains information about the original order.", + "properties": { + "id": { "type": "string", - "description": "Reason for the transfer." + "description": "Unique order ID.", + "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" }, "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." + "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." } } - } - }, - "8_req_redeem_reward": { - "description": "Request body schema for redeeming a reward.", - "type": "object", - "title": "Redeem Reward Request Body", - "properties": { - "reward": { - "type": "object", - "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward if the reward is a pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", - "example": "rew_eSi4eYJk7o3tOycvweicR2z7" - }, - "points": { - "type": "integer", - "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card." - } + }, + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID.", + "example": "r_0c94ed583fcafc31c1" } - }, - "order": { - "$ref": "#/components/schemas/8_req_order_object_redeem_reward", - "description": "Order object that is **required** when redeeming a pay with points reward." - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." } - } - }, - "8_req_order_object_redeem_reward": { - "type": "object", - "title": "Order object", - "description": "Request body schema for creating an order, **required** when redeeming a pay with points reward.", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" + }, + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID.", + "example": "rr_0c9b0967244a862a33" + } } - } - }, - "8_res_redeem_reward": { - "description": "Response body schema for redeeming a reward.", - "title": "Redeem Reward Response Body", - "$ref": "#/components/schemas/8_obj_redemption_object_loyalty_card_extended" - }, - "8_obj_redemption_object_loyalty_card_extended": { - "type": "object", - "title": "Loyalty Card Voucher", - "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher lifecycle. A customer can redeem a voucher once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", - "properties": { - "id": { - "type": "string", - "example": "r_0bc92f81a6801f9bca", - "description": "Unique redemption ID." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the redemption.", - "default": "redemption" - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-10-03T12:24:58.008Z", - "description": "Timestamp in ISO 8601 format indicating when the redemption occured." - }, - "customer_id": { - "type": "string", - "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "description": "Unique customer ID of the redeeming customer." - }, - "tracking_id": { - "type": "string", - "example": "track_fxEMFiLowFHg==", - "description": "Hashed customer source ID." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." - }, - "amount": { - "type": "integer", - "description": "Number of points being redeemed for a reward." - }, - "result": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ], - "description": "Redemption result." - }, - "order": { - "description": "Defines the details of the order that is related to the redemption.", - "$ref": "#/components/schemas/7_obj_order_object" - }, - "customer": { - "type": "object", - "description": "Defines the customer redeeming the reward.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "source_id": { - "type": "string", - "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." - }, - "object": { - "type": "string", - "description": "Type of object represented is `customer`.", - "default": "customer" - } - } - }, - "related_object_type": { - "type": "string", - "description": "Defines the related object. i.e. `voucher`.", - "enum": [ - "voucher" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object", - "description": "Defines the details of the voucher being redeemed." - }, - "reward": { - "description": "Defines the reward being redeemed.", - "anyOf": [ - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" - }, - { - "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" - } - ] - }, - "loyalty_card": { - "type": "object", - "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", - "properties": { - "points": { - "type": "integer", - "description": "Number of points being subtracted from the loyalty card for the reward redemption." - } + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID.", + "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" + }, + "name": { + "type": "string", + "description": "Reward name.", + "example": "100 = $20" } } } - }, - "8_res_loyalties_campaign_id_tiers_tier_id_earning_rules": { - "type": "object", - "properties": { - "object": { - "type": "string" - }, - "data_ref": { - "type": "string" - }, - "data": { - "type": "array", - "items": { + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_addition": { + "title": "Addition", + "description": "When points are added to a card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_ADDITION", + "enum": [ + "POINTS_ADDITION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "related_object": { "type": "object", + "description": "Defines the resource that is being modified with the values that are returned in the balance object.", "properties": { "id": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "updated_at": { - "type": "null" - }, - "validation_rule_id": { - "type": "null" - }, - "loyalty": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "type": { - "type": "string" - } - } - }, - "event": { - "type": "string" - }, - "source": { - "type": "object", - "properties": { - "banner": { - "type": "string" - }, - "object_id": { - "type": "string" - }, - "object_type": { - "type": "string" - } - } - }, - "active": { - "type": "boolean" - }, - "object": { - "type": "string" - }, - "automation_id": { - "type": "string" + "type": "string", + "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, - "custom_event": { - "type": "object", - "properties": { - "schema_id": { - "type": "string" - } - } + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } - }, - "total": { - "type": "integer" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "title": "List Loyalty Tier Earning Rules" - }, - "8_res_loyalties_campaign_id_tiers_tier_id_rewards": { - "title": "List Loyalty Tier Rewards", - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`." - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id": { - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}`", - "title": "Get Reward Assignment", - "properties": { - "id": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" - }, - "reward_id": { - "type": "string", - "example": "rew_JhjeISE1npQyxRmGV1JYohDP" - }, - "related_object_id": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "related_object_type": { - "type": "string", - "example": "campaign" - }, - "created_at": { - "type": "string", - "example": "2021-12-13T11:58:32.261Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-01-13T11:58:32.261Z", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "reward_assignment" } } - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id_reward": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "parameters": { - "type": "object", - "properties": { - "coin": { - "type": "object", - "properties": { - "exchange_ratio": { - "type": "number" - }, - "points_ratio": { - "type": "integer" - } + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_removal": { + "title": "Removal", + "description": "When points are removed from a card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "voucherify-web-ui", + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_REMOVAL", + "enum": [ + "POINTS_REMOVAL" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being subtracted 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } - }, - "stock": { - "type": "null" - }, - "redeemed": { - "type": "null" - }, - "attributes": { - "type": "object", - "properties": {} - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "null", - "format": "date-time" - }, - "object": { - "type": "string" } - }, - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}/`", - "title": "Get Reward Details" - }, - "8_obj_export_object_points_expiration": { - "title": "Points Expirations Export Object", - "type": "object", - "description": "This is an object representing an export of points expirations. ", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the export." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Status of the export. Informs you whether the export has already been completed.", - "enum": [ - "SCHEDULED", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "enum": [ - "API", - "WEBSITE" - ] - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "enum": [ - "points_expiration" - ] - }, - "parameters": { - "type": "object", - "description": "List of fields and filters that were passed in the request body to create the export.", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combination of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" + } + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_expiration": { + "title": "Expiration", + "description": "When points expire.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a points expiration, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", + "enum": [ + "Automation" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a points expiration, this value is `null`." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_EXPIRATION", + "enum": [ + "POINTS_EXPIRATION" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points removed during 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_filter_campaign_id" - }, - { - "$ref": "#/components/schemas/8_req_filter_voucher_id" - } - ] - } - } - }, - "result": { - "type": "object", - "description": "Contains the URL of the CSV file.", - "properties": { - "url": { - "type": "string", - "description": "URL of the CSV file location." } } - }, - "user_id": { - "type": "string", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr", - "description": " The user_id identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`." } } - }, - "8_req_export_points_expirations": { - "title": "Points Expirations Export Request Body", - "type": "object", - "description": "Request body schema for creating points expirations. ", - "properties": { - "parameters": { - "type": "object", - "description": "List of fields and filters that were passed in the request body to create the export.", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" + } + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of this type of transaction." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_transfer_out": { + "title": "Transfer Out", + "description": "When points are transferred from one loyalty card to another.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place.", + "enum": [ + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_TRANSFER_OUT", + "enum": [ + "POINTS_TRANSFER_OUT" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { + "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", + "properties": { + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being subtracted 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", + "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.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export.", - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_filter_campaign_id" - }, - { - "$ref": "#/components/schemas/8_req_filter_voucher_id" - } - ] } } } - } - }, - "8_req_filter_campaign_id": { - "title": "Filter by campaign ID", - "type": "object", - "description": "Filter conditions set on the campaign ID.", - "properties": { - "campaign_id": { - "$ref": "#/components/schemas/8_req_filter_conditions" - }, - "junction": { - "type": "string", - "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.", - "enum": [ - "AND", - "OR" - ] - } - } - }, - "8_req_filter_voucher_id": { - "title": "Filter by voucher ID", - "type": "object", - "description": "Filter conditions set on the voucher ID.", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/8_req_filter_conditions" - }, - "junction": { - "type": "string", - "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.", - "enum": [ - "AND", - "OR" - ] - } - } - }, - "8_req_filter_junction": { - "title": "Filter by campaign ID", - "type": "object", - "description": "Filter conditions by campaign ID.", - "properties": { - "junction": { - "type": "string", - "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." - } - } - }, - "8_req_filter_conditions": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results.", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results.", - "items": { - "type": "string" + }, + "destination_voucher": { + "type": "object", + "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the destination voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "code": { + "type": "string", + "description": "Unique code of the destination voucher.", + "example": "LOYALTY-CARD-A8XVurg" + }, + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "LOYALTY_CARD" + }, + "campaign": { + "type": "string", + "description": "Unqiue campaign name of the voucher's parent campaign." + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "loyalty_card": { + "type": "object", + "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", + "properties": { + "points": { + "type": "integer", + "description": "The total amount of points after the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." + }, + "next_expiration_date": { + "type": "string", + "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. This does not mean that the transferred points were added to this bucket. It only shows the next set of points due to expire. The transferred points are added to the last expiring bucket, i.e. to the bucket of points that are to expire the furthest in the future.", + "example": "2023-12-31" + }, + "next_expiration_points": { + "type": "integer", + "description": "The number of points due to expire on the next expiration date." } - }, - "$is": { - "type": "string", - "description": "Specify the exact resource value." - }, - "$is_not": { - "type": "string", - "description": "Results should omit this value." } + }, + "is_referral_code": { + "type": "integer", + "description": "Flag indicating whether this voucher is a referral code." } } } - }, - "8_res_list_reward_assignments": { - "title": "List Reward Assignments", - "type": "object", - "description": "Response body schema for **GET** `/loyalties/{campaignId}/rewards`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty reward assignments in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of reward assignment objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of reward assignment objects.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of reward assignment objects." - } - } - }, - "8_res_list_loyalty_tiers": { - "title": "List Loyalty Tiers", - "type": "object", - "description": "Response body schema for listing loyalty tiers for a campaign using **GET** `/loyalties/{campaignId}/tiers`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - } - }, - "8_res_get_member_loyalty_tier": { - "title": "Get Member's Loyalty Tier Response Body", - "type": "object", - "description": "Response body schema for retrieving a member's loyalty tier for a campaign using **GET** `/loyalties/members/{memberId}/tiers`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object_member" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tiers." - } - } - }, - "8_req_create_reward_assignment": { - "title": "Create Reward Assignment Request Body", - "type": "array", - "description": "Request body schema for **POST** `/loyalties/{campaignId}/rewards`.", - "items": { + } + }, + "related_transaction_id": { + "type": "string", + "description": "The related transaction ID on the receiving card.", + "example": "vtx_0c9afe802593b34b81" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "1_obj_loyalty_card_transaction_object_transfer_in": { + "title": "Transfer In", + "description": "When points are transferred in from another loyalty card.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique transaction ID.", + "example": "vtx_0c9dccc4d5813e71bd" + }, + "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. In case of a ponits transfer, this value is `null`." + }, + "voucher_id": { + "type": "string", + "description": "Unique voucher ID.", + "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "source": { + "type": "string", + "description": "The channel through which the transaction took place.", + "enum": [ + "API" + ] + }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred." + }, + "type": { + "type": "string", + "description": "Type of transaction.", + "default": "POINTS_TRANSFER_IN", + "enum": [ + "POINTS_TRANSFER_IN" + ] + }, + "details": { + "type": "object", + "description": "Contains the detailed information about the transaction.", + "properties": { + "balance": { "type": "object", + "description": "Contains information on how the balance was affected by the transaction.", "properties": { - "reward": { + "type": { "type": "string", - "example": "rew_2yGflHThU2yJwFECEFKrXBI2", - "description": "Unique reward ID." + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "loyalty_card" + }, + "total": { + "type": "integer", + "description": "The available points after the transaction." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON.", + "default": "balance" + }, + "points": { + "type": "integer", + "description": "The amount of points being added in the transaction." + }, + "balance": { + "type": "integer", + "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." }, - "parameters": { + "related_object": { "type": "object", - "description": "An object that defines the price of the reward in loyalty points.", + "description": "Defines the resource that is being modified with the values that are returned in the balance object.", "properties": { - "loyalty": { - "type": "object", - "description": "Stores the points parameter.", - "properties": { - "points": { - "type": "integer", - "description": "Defines how many points are required to obtain the reward." - } - } + "id": { + "type": "string", + "description": "Identifies the voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "type": { + "type": "string", + "description": "The object being modified, i.e. `voucher`.", + "default": "voucher" } } } } - } - }, - "8_res_create_reward_assignment": { - "title": "Create Reward Assignment Response Body", - "type": "array", - "description": "Response body schema for **POST** `/loyalties/{campaignId}/rewards`.", - "items": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } - }, - "8_req_update_reward_assignment": { - "title": "Update Reward Assignment Request Body", - "type": "object", - "description": "Request body schema for **PUT** `/loyalties/{campaignId}/rewards/{assignmentId}`.", - "properties": { - "parameters": { - "type": "object", - "description": "An object that defines the price of the reward in loyalty points.", - "properties": { - "loyalty": { - "type": "object", - "description": "Stores the points parameter.", - "properties": { - "points": { - "type": "integer", - "description": "Defines how many points are required to obtain the reward." - } + }, + "source_voucher": { + "type": "object", + "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.", + "properties": { + "id": { + "type": "string", + "description": "Identifies the source voucher that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + }, + "code": { + "type": "string", + "description": "Unique code of the source voucher.", + "example": "LOYALTY-CARD-A8XVurg" + }, + "type": { + "type": "string", + "description": "The type of voucher whose balance is being adjusted due to the transaction.", + "default": "LOYALTY_CARD" + }, + "campaign": { + "type": "string", + "description": "Unqiue campaign name of the voucher's parent campaign." + }, + "holder_id": { + "type": "string", + "description": "Unqiue customer ID of the loyalty card holder, this is the ID that was assigned by the Voucherify API.", + "example": "cust_xqA7DGj5eYPHg6PHVKwYRWiA" + }, + "campaign_id": { + "type": "string", + "description": "Unqiue campaign ID of the voucher's parent campaign.", + "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" + }, + "loyalty_card": { + "type": "object", + "description": "Contains information on how the balance on the source loyalty card was affected by the transaction.", + "properties": { + "points": { + "type": "integer", + "description": "The total amount of points after 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." + }, + "next_expiration_date": { + "type": "string", + "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. The points from the source loyalty card are taken from the expiration bucket(s) that are the first coming up to expire, starting from the first expiration bucket to expire in time. This parameter shows the next expiration date after the points were taken out of the loyalty card.", + "example": "2023-12-31" + }, + "next_expiration_points": { + "type": "integer", + "description": "The number of points due to expire on the expiration date." } } + }, + "is_referral_code": { + "type": "integer", + "description": "Flag indicating whether this voucher is a referral code." } } } - }, - "8_res_list_loyalty_tier_earning_rules": { - "title": "List Loyalty Tier Earning Rules", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tier earning rules in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier earning rule objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier earning rules.", - "items": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + }, + "related_transaction_id": { + "type": "string", + "description": "The related transaction ID on the source card.", + "example": "vtx_0c9afe802593b34b81" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "8_req_create_loyalty_card_transactions_export": { + "type": "object", + "title": "Create Loyalty Card Transactions Export Request Body", + "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", + "description": "Contains the parameters that define the data to be exported." + } + } + }, + "8_obj_export_loyalty_card_transactions": { + "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", + "title": "Export Transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details", + "related_transaction_id" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "items": { + "type": "string" + } + } + } + }, + "8_obj_export_transactions_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\n Using this endpoint, you can export [loyalty card transactions](ref:list-loyalty-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "default": "API" + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "default": "voucher_transactions" + }, + "parameters": { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + }, + "result": { + "type": "object", + "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](ref:download-export) method." + } + } + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } + } + }, + "8_obj_loyalty_tier_object": { + "type": "object", + "title": "Loyalty Tier Object", + "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", + "properties": { + "id": { + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "description": "Unique loyalty tier ID." + }, + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": "object", + "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", + "example": "2022-11-10T12:20:52.755Z", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-11-25T10:59:43.231Z", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "earning_rules": { + "type": "object", + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", + "properties": { + "unique_earning_rule_ID": { + "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } + ] } - }, - "8_res_list_loyalty_tier_rewards": { - "title": "List Loyalty Tier Rewards", - "type": "object", - "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty tier rewards in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty tier reward objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier reward objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" + } + }, + "rewards": { + "type": "object", + "description": "Contains a list of reward IDs and their points mapping for the given reward.", + "properties": { + "unique_reward_ID": { + "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier reward objects." - } + ] } - }, - "8_res_list_members": { - "title": "List Members", - "type": "object", - "description": "Response body schema for **GET** `/loyalties/{campaignId}/members`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about members in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "vouchers", - "description": "Identifies the name of the attribute that contains the array of voucher objects." - }, - "vouchers": { - "type": "array", - "description": "Contains array of voucher objects representing loyalty cards, in other words, loyalty program members.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in 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." } - }, - "total": { - "type": "integer", - "description": "Total number of voucher objects." } } - }, - "8_req_add_member": { - "title": "Add Member Request Body", - "type": "object", - "description": "Request body schema for assigning a loyalty card to a customer using **POST** `/loyalties/{campaignId}/members`.", - "properties": { - "voucher": { - "type": "string", - "description": "Specify the loyalty card code that you would like to publish to a customer." - }, - "channel": { - "type": "string", - "description": "Specify the distribution channel." - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/8_req_customer_id_string" - }, - { - "$ref": "#/components/schemas/8_req_customer_id" - }, - { - "$ref": "#/components/schemas/8_req_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "metadata": { - "type": "string", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." - } + } + }, + "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." } - }, - "8_req_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer." + } + }, + "object": { + "type": "string", + "default": "loyalty_tier", + "description": "The type of object represented by JSON. This object stores information about the loyalty." + } + } + }, + "8_obj_loyalty_tier_object_member": { + "type": "object", + "title": "Loyalty Tier Object", + "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", + "properties": { + "id": { + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "description": "Unique loyalty tier ID." + }, + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": "object", + "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", + "example": "2022-11-10T12:20:52.755Z", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-11-25T10:59:43.231Z", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "earning_rules": { + "type": "object", + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", + "properties": { + "unique_earning_rule_ID": { + "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } + }, + "rewards": { + "type": "object", + "description": "Contains a list of reward IDs and their points mapping for the given reward.", + "properties": { + "unique_reward_ID": { + "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in 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." + } } } + } + }, + "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": "Contains information about when the expiration tier will expire.", + "properties": { + "customer_id": { + "type": "string", + "example": "cust_qBwHpagDOFu71Z3F22UzR80X", + "description": "Unique customer ID whose point expiration dates are defined in this object." + }, + "campaign_id": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "description": "Unique parent campaign ID." + }, + "tier_id": { + "type": "string", + "example": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "description": "Unique loyalty tier ID." + }, + "start_date": { + "type": "string", + "example": "2022-11-10", + "description": "Exact start date of the loyalty tier for the given customer." + }, + "expiration_date": { + "type": "string", + "example": "2023-02-28", + "description": "Exact expiration date of the loyalty tier for the given customer." + }, + "created_at": { + "type": "string", + "example": "2022-11-09T11:26:26.719Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "example": "2022-11-10T08:54:47.200Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." + } + } + }, + "object": { + "type": "string", + "default": "loyalty_tier", + "description": "The type of object represented by JSON. This object stores information about the loyalty." + } + } + }, + "8_obj_mapping_multiply": { + "type": "object", + "title": "Multiply Points", + "description": "Points are multiplied by a multiplier.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "MULTIPLY" + ] + }, + "multiplier": { + "type": "integer", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." + } + } + }, + "8_obj_mapping_fixed": { + "type": "object", + "title": "Fixed Points", + "description": "Points are fixed.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "CUSTOM" + ] + }, + "points": { + "type": "integer", + "description": "Fixed number of points to be applied." + } + } + }, + "8_obj_earning_rule_object": { + "description": "This is an object representing an earning rule.", + "title": "Earning Rule Object", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "8_req_customer_id_string": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify or the source ID.", - "type": "string" + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "8_req_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + }, + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + }, + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" } } }, - "8_res_get_member_activities": { - "title": "Get Member Activities", - "type": "object", - "description": "Response body schema for retrieving member activities.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about member activities in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "activities", - "description": "Identifies the name of the attribute that contains the array of event objects." - }, - "activities": { - "type": "array", - "description": "Contains array of event objects.", - "items": {} - }, - "total": { - "type": "integer", - "description": "Total number of event objects." + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" } } }, - "8_res_list_member_rewards": { - "title": "List Member Rewards", - "type": "object", - "description": "Response body schema for `/loyalties/members/{memberId}/rewards`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about member rewards in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty reward objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty reward objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_reward_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty reward objects." + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" } } }, - "8_res_get_points_expiration": { - "title": "Get Points Expiration Response Body", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/members/{memberId}/points-expiration`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of loyalty points expiration buckets.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_points_bucket" - } - }, - "total": { - "type": "integer", - "description": "Total number of point expiration buckets." + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" + } + ] + }, + "8_obj_earning_rule_object_no_validation_rule": { + "description": "This is an object representing an earning rule.", + "title": "Earning Rule Object", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + }, + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + }, + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" } } }, - "9_req_create_customer": { - "type": "object", - "title": "Customer", - "description": "This is an object containing information about the customer.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service. \n\nPlease note that if you would like your data to sync based on the `source_id` of the customer, you need to define the `source_id` upfront. You will not be able to change or update the `source_id` later on." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + "every": 2, + "points": 2, + "property": "customer_life_time_value" } } }, - "9_req_update_customer": { - "type": "object", - "title": "Customer object", - "description": "This is an object containing information about the customer.", - "properties": { - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + "every": 3, + "points": 4, + "property": "customer_life_time_value" } } }, - "9_obj_customer_object": { - "type": "object", - "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", - "title": "Customer Object", - "examples": [ - { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", - "source_id": "08dd9b5a", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "address": { - "city": "New York", - "state": "NY", - "line_1": "678 Main St", - "line_2": null, - "country": "USA", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 5, - "total_failed": 0, - "total_succeeded": 5, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 830 - } - }, - "orders": { - "total_amount": 94600, - "total_count": 5, - "average_amount": 18920, - "last_order_amount": 27500, - "last_order_date": "2022-09-15T11:11:36.630Z" - } - }, - "loyalty": { - "points": 830, - "referred_customers": 0, - "campaigns": { - "Loyalty Campaign - Webinar": { - "points": 830, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "age": 24, - "loyalty_customer": "true", - "acquisition_channel": "Facebook" - }, - "system_metadata": { - "consents": { - "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { - "date": "2022-11-22T15:48:50.219Z", - "value": true - } - } - }, - "created_at": "2022-09-15T10:33:46.388Z", - "updated_at": "2022-11-22T15:48:50.220Z", - "assets": { - "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" - }, - "object": "customer" - } - ], - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_CSnYd37MXmrbS19XCrghjBsv" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate." - }, - "birthday": { - "type": "string", - "description": "Customer's birthday." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "summary": { - "type": "object", - "description": "Contains a summary of customer's redemption and order statistics.", - "properties": { - "redemptions": { - "type": "object", - "description": "Customer's redemptions statistics.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Total number of redemptions made by the customer." - }, - "total_failed": { - "type": "integer", - "description": "Total number of redemptions that failed." - }, - "total_succeeded": { - "type": "integer", - "description": "Total number of redemptions that succeeded." - }, - "total_rolled_back": { - "type": "integer", - "description": "Total number of redemptions that were rolled back for the customer." - }, - "total_rollback_failed": { - "type": "integer", - "description": "Total number of redemption rollbacks that failed." - }, - "total_rollback_succeeded": { - "type": "integer", - "description": "Total number of redemption rollbacks that succeeded." - }, - "gift": { - "type": "object", - "description": "Summary of gift card credits.", - "properties": { - "redeemed_amount": { - "type": "integer", - "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "amount_to_go": { - "type": "integer", - "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "loyalty_card": { - "type": "object", - "description": "Summary of loyalty points.", - "properties": { - "redeemed_points": { - "type": "integer", - "description": "Total number of loyalty points redeemed by the customer." - }, - "points_to_go": { - "type": "integer", - "description": "Sum of remaining available point balance across all loyalty cards." - } - } - } - } - }, - "orders": { - "type": "object", - "description": "Customer's order statistics.", - "properties": { - "total_amount": { - "type": "integer", - "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "total_count": { - "type": "integer", - "description": "Total number of orders made by the customer." - }, - "average_amount": { - "type": "integer", - "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "last_order_amount": { - "type": "integer", - "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "last_order_date": { - "type": "string", - "format": "date-time", - "example": "2022-08-30T11:51:08.029Z", - "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." - } - } - } - } - }, - "loyalty": { - "type": "object", - "description": "Summary of customer's loyalty information.", - "properties": { - "points": { - "type": "integer", - "description": "Sum of remaining available point balance across all loyalty cards." - }, - "referred_customers": { - "type": "integer", - "description": "Total number of customers referred by the customer." - }, - "campaigns": { - "type": "object", - "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", - "properties": { - "campaign_name": { - "type": "object", - "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", - "properties": { - "points": { - "type": "integer", - "description": "Remaining point balance in campaign." - }, - "loyalty_tier": { - "type": "string", - "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", - "description": "Customer's loyalty tier within the campaign." - }, - "referred_customers": { - "type": "integer", - "description": "Number of customers referred by the customer in campaign." - } - } - } - } - } - } - }, - "referrals": { - "type": "object", - "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", - "properties": { - "total": { - "type": "integer", - "description": "Total number of times this customer received a referral, i.e. was referred by another customer." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of campaigns that served as the source of a referral for the customer.", - "items": { - "type": "object", - "description": "Contains information about the source of the referral.", - "properties": { - "campaign_id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_rRsfatlwN7unSeUIJDCYedal" - }, - "referrer_id": { - "type": "string", - "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." - }, - "related_object_id": { - "type": "string", - "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." - }, - "related_object_type": { - "type": "string", - "description": "Related object type, i.e. `redemption`." - }, - "date": { - "type": "string", - "format": "date-time", - "example": "2022-08-30T10:19:39.196Z", - "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "system_metadata": { - "type": "object", - "description": "Object used to store system metadata information.", - "properties": { - "consents": { - "type": "object", - "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", - "properties": { - "consentId": { - "type": "object", - "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", - "example": "2022-05-10T08:50:10.338Z", - "format": "date-time" - }, - "value": { - "type": "boolean", - "description": "Accepted: `true`, Rejected: `false`" - } - } - } - } - }, - "source": { - "type": "string", - "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." - } - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", - "example": "2022-08-30T06:32:07.380Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", - "example": "2022-08-31T06:32:07.380Z", - "format": "date-time" - }, - "assets": { - "type": "object", - "description": "Contains information about the customer's cockpit.", - "properties": { - "cockpit_url": { - "type": "string", - "description": "Customer's cockpit URL address." - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the customer.", - "default": "customer" - } - } - }, - "9_obj_customer_object_email_parameter": { - "type": "object", - "description": "This is an object representing a customer.", - "title": "Customer Object", - "examples": [ - { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", - "source_id": "08dd9b5a", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "address": { - "city": "New York", - "state": "NY", - "line_1": "678 Main St", - "line_2": null, - "country": "USA", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 5, - "total_failed": 0, - "total_succeeded": 5, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 830 - } - }, - "orders": { - "total_amount": 94600, - "total_count": 5, - "average_amount": 18920, - "last_order_amount": 27500, - "last_order_date": "2022-09-15T11:11:36.630Z" - } - }, - "loyalty": { - "points": 830, - "referred_customers": 0, - "campaigns": { - "Loyalty Campaign - Webinar": { - "points": 830, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "age": 24, - "loyalty_customer": "true", - "acquisition_channel": "Facebook" - }, - "system_metadata": { - "consents": { - "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { - "date": "2022-11-22T15:48:50.219Z", - "value": true - } - } - }, - "created_at": "2022-09-15T10:33:46.388Z", - "updated_at": "2022-11-22T15:48:50.220Z", - "assets": { - "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" - }, - "object": "customer" - } - ], - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of a customer that is assigned by Voucherify.", - "example": "cust_CSnYd37MXmrbS19XCrghjBsv" - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate." - }, - "birthday": { - "type": "string", - "description": "Customer's birthday." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address." - }, - "line_2": { - "type": "string", - "description": "Second line of address." - }, - "country": { - "type": "string", - "description": "Country." - }, - "postal_code": { - "type": "string", - "description": "Postal code." - } - } - }, - "summary": { - "type": "object", - "description": "Contains a summary of customer's redemption and order statistics.", - "properties": { - "redemptions": { - "type": "object", - "description": "Customer's redemptions statistics.", - "properties": { - "total_redeemed": { - "type": "integer", - "description": "Total number of redemptions made by the customer." - }, - "total_failed": { - "type": "integer", - "description": "Total number of redemptions that failed." - }, - "total_succeeded": { - "type": "integer", - "description": "Total number of redemptions that succeeded." - }, - "total_rolled_back": { - "type": "integer", - "description": "Total number of redemptions that were rolled back for the customer." - }, - "total_rollback_failed": { - "type": "integer", - "description": "Total number of redemption rollbacks that failed." - }, - "total_rollback_succeeded": { - "type": "integer", - "description": "Total number of redemption rollbacks that succeeded." - }, - "gift": { - "type": "object", - "description": "Summary of gift card credits.", - "properties": { - "redeemed_amount": { - "type": "integer", - "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "amount_to_go": { - "type": "integer", - "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "loyalty_card": { - "type": "object", - "description": "Summary of loyalty points.", - "properties": { - "redeemed_points": { - "type": "integer", - "description": "Total number of loyalty points redeemed by the customer." - }, - "points_to_go": { - "type": "integer", - "description": "Sum of remaining available point balance accross all loyalty cards." - } - } - } - } - }, - "orders": { - "type": "object", - "description": "Customer's order statistics.", - "properties": { - "total_amount": { - "type": "integer", - "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "total_count": { - "type": "integer", - "description": "Total number of orders made by the customer." - }, - "average_amount": { - "type": "integer", - "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "last_order_amount": { - "type": "integer", - "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "last_order_date": { - "type": "string", - "example": "2022-08-30T11:51:08.029Z", - "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." - } - } - } - } - }, - "loyalty": { - "type": "object", - "description": "Summary of customer's loyalty information.", - "properties": { - "points": { - "type": "integer" - }, - "referred_customers": { - "type": "integer", - "description": "Total number of customers referred by the customer." - }, - "campaigns": { - "type": "object", - "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", - "properties": { - "campaign_name": { - "type": "object", - "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", - "properties": { - "points": { - "type": "integer", - "description": "Remaining point balance in campaign." - }, - "loyalty_tier": { - "type": "string", - "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", - "description": "Customer's loyalty tier within the campaign." - }, - "referred_customers": { - "type": "integer", - "description": "Number of customers referred by the customer in campaign." - } - } - } - } - } - } - }, - "referrals": { - "type": "object", - "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", - "properties": { - "total": { - "type": "integer", - "description": "Total number of times this customer received a referral, i.e. was referred by another customer." - }, - "campaigns": { - "type": "array", - "description": "Contains an array of campaigns that served as the source of a referral for the customer.", - "items": { - "type": "object", - "description": "Contains information about the source of the referral.", - "properties": { - "campaign_id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_rRsfatlwN7unSeUIJDCYedal" - }, - "referrer_id": { - "type": "string", - "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." - }, - "related_object_id": { - "type": "string", - "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." - }, - "related_object_type": { - "type": "string", - "description": "Related object type, i.e. `redemption`." - }, - "date": { - "type": "string", - "example": "2022-08-30T10:19:39.196Z", - "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - }, - "system_metadata": { - "type": "object", - "description": "Object used to store system metadata information.", - "properties": { - "consents": { - "type": "object", - "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", - "properties": { - "consentId": { - "type": "object", - "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", - "example": "2022-05-10T08:50:10.338Z", - "format": "date-time" - }, - "value": { - "type": "boolean", - "description": "Accepted: `true`, Rejected: `false`" - } - } - } - } - }, - "source": { - "type": "string", - "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." - } - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", - "example": "2022-08-30T06:32:07.380Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", - "example": "2022-08-31T06:32:07.380Z", - "format": "date-time" - }, - "assets": { - "type": "object", - "description": "Contains information about the customer's cockpit.", - "properties": { - "cockpit_url": { - "type": "string", - "description": "Customer's cockpit URL address." - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON. This object stores information about the customer.", - "default": "customer" - }, - "email_unsubscribed": { - "type": "boolean" - } - } - }, - "9_res_list_customers": { - "type": "object", - "title": "List Customers Response Body", - "description": "Response body schema for **GET** `/customers`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about customers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "customers", - "description": "Identifies the name of the attribute that contains the array of customer objects." - }, - "customers": { - "type": "array", - "description": "Contains array of customer objects.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of customers." - } - } - }, - "9_res_list_customer_activities": { - "type": "object", - "title": "List Customer Activities Response Body", - "description": "Request body schema for `/customers/{customerId}/activities`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about customer activities in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of customer activity objects." - }, - "data": { - "type": "array", - "description": "Array of customer activity objects.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_activity_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of customer activities." - } - } - }, - "22_obj_webhooks": { - "type": "object", - "title": "Webhooks", - "description": "Data object model for a webhook.\n\n\nredemption.succeeded \nredemption.failed \nredemption.rollback.succeeded \nredemption.rollback.failed \npublication.succeeded \nvoucher.published \nvoucher.updated \nvoucher.deleted \nvoucher.created \nVoucher.enabled \nvoucher.disabled \nvoucher.loyalty_card.points_added \nvoucher.gift.balance_added \ncampaign.enabled \ncampaign.deleted \ncampaign.created \ncampaign.updated \ncampaign.disabled \ncampaign.vouchers.generation.completed \nbusiness_validation_rule.assignment.created \nbusiness_validation_rule.assignment.deleted \nbusiness_validation_rule.created \nbusiness_validation_rule.deleted \nbusiness_validation_rule.updated \ncustomer.created \ncustomer.deleted \ncustomer.rewarded \ncustomer.rewarded.loyalty_points \ncustomer.consents.revoked \ncustomer.consents.given ", - "x-tags": [ - "WEBHOOKS" - ], - "properties": { - "id": { - "type": "string", - "example": "event_m7MXf3zPf1n51IoUM8XHpP0w", - "description": "Unique event ID." - }, - "object": { - "type": "string", - "default": "event", - "description": "The type of object represented by JSON. This object stores information about events in a dictionary." - }, - "webhook_id": { - "type": "string", - "example": "wh_K7hpwSVDmKaxmBsDn0EpCvDy", - "description": "Unique webhook ID." - }, - "project_id": { - "type": "string", - "example": "proj_z7id5", - "description": "Unique Voucherify project ID." - }, - "created_at": { - "type": "string", - "example": "2022-11-30T16:53:30.434Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the webhook was created in ISO 8601 format." - }, - "type": { - "type": "string", - "enum": [ - "redemption.succeeded", - "redemption.failed", - "redemption.rollback.succeeded", - "redemption.rollback.failed", - "publication.succeeded", - "voucher.published", - "voucher.updated", - "voucher.deleted", - "voucher.created", - "Voucher.enabled", - "voucher.disabled", - "voucher.loyalty_card.points_added", - "voucher.gift.balance_added", - "campaign.enabled", - "campaign.deleted", - "campaign.created", - "campaign.updated", - "campaign.disabled", - "campaign.vouchers.generation.completed", - "business_validation_rule.assignment.created", - "business_validation_rule.assignment.deleted", - "business_validation_rule.created", - "business_validation_rule.deleted", - "business_validation_rule.updated", - "customer.created", - "customer.deleted", - "customer.rewarded", - "customer.rewarded.loyalty_points", - "customer.consents.revoked", - "customer.consents.given" - ] - }, - "data": { - "$ref": "#/components/schemas/22_obj_webhook_object_data" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a webhook. The metadata object stores all custom attributes assigned to the webhook. It can be useful for storing additional information about the webhook in a structured format.", - "properties": { - "source": { - "type": "string", - "description": "The origin of the webhook.", - "enum": [ - "API" - ] - } - } - } - } - }, - "22_obj_webhook_object_data": { - "title": "Webhook Object", - "description": "Webhook event data object schema.", - "anyOf": [ - { - "$ref": "#/components/schemas/22_obj_event_redemption_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_publication_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_published" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_loyalty_card_points_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_gift_balance_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_vouchers_generation_completed" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded_loyalty_points" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_given" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_revoked" - } - ] - }, - "22_obj_event_redemption_succeeded": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `redemption.succeeded`.", - "type": "object" - }, - "22_obj_event_redemption_failed": { - "title": "Redemption Failed", - "description": "Event data object schema for `redemption.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_failed": { - "title": "Redemption Rollback Failed", - "description": "Event data object schema for `redemption.rollback.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_succeeded": { - "title": "Redemption Rollback Succeeded", - "description": "Event data object schema for `redemption.rollback.succeeded`.", - "type": "object" + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" }, - "22_obj_event_publication_succeeded": { - "title": "Publication Succeeded", - "description": "Event data object schema for `publication.succeeded`.", - "type": "object" - }, - "22_obj_event_voucher_published": { - "title": "Voucher Published", - "description": "Event data object schema for `voucher.published`.", - "type": "object" - }, - "22_obj_event_voucher_updated": { - "title": "Voucher Updated", - "description": "Event data object schema for `voucher.updated`.", - "type": "object" - }, - "22_obj_event_voucher_deleted": { - "title": "Voucher Deleted", - "description": "Event data object schema for `voucher.deleted`.", - "type": "object" + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" }, - "22_obj_event_voucher_created": { - "title": "Voucher Created", - "description": "Event data object schema for `voucher.created`.", - "type": "object" + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" }, - "22_obj_event_voucher_enabled": { - "title": "Voucher Enabled", - "description": "Event data object schema for `voucher.enabled`.", - "type": "object" + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" }, - "22_obj_event_voucher_disabled": { - "title": "Voucher Disabled", - "description": "Event data object schema for `voucher.disabled`.", - "type": "object" + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" }, - "22_obj_event_voucher_loyalty_card_points_added": { - "title": "Voucher Loyalty Card Points Added", - "description": "Event data object schema for `voucher.loyalty_card.points_added`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object" - } - } + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" }, - "22_obj_event_voucher_gift_balance_added": { - "title": "Voucher Gift Balance Added", - "description": "Event data object schema for `voucher.gift.balance_added`.", - "type": "object" + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment_no_validation_rule" + }, + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_tier_no_validation_rule" + } + ] + }, + "8_obj_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "22_obj_event_campaign_enabled": { - "title": "Campaign Enabled", - "description": "Event data object schema for `campaign.enabled`.", - "type": "object" + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "22_obj_event_campaign_deleted": { - "title": "Campaign Deleted", - "description": "Event data object schema for `campaign.deleted`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "campaign": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } - }, - "22_obj_event_campaign_created": { - "title": "Campaign Created", - "description": "Event data object schema for `campaign.created`.", - "type": "object" - }, - "22_obj_event_campaign_updated": { - "title": "Campaign Updated", - "description": "Event data object schema for `campaign.updated`.", - "type": "object" - }, - "22_obj_event_campaign_disabled": { - "title": "Campaign Disabled", - "description": "Event data object schema for `campaign.disabled`.", - "type": "object" - }, - "22_obj_event_campaign_vouchers_generation_completed": { - "title": "Campaign Vouchers Generation Completed", - "description": "Event data object schema for `campaign.vouchers.generation.completed`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_created": { - "title": "Business Validation Rule Assignment Created", - "description": "Event data object schema for `business_validation_rule.assignment.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_deleted": { - "title": "Business Validation Rule Assignment Deleted", - "description": "Event data object schema for `business_validation_rule.assignment.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_created": { - "title": "Business Validation Rule Created", - "description": "Event data object schema for `business_validation_rule.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_deleted": { - "title": "Business Validation Rule Deleted", - "description": "Event data object schema for `business_validation_rule.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_updated": { - "title": "Business Validation Rule Updated", - "description": "Event data object schema for `business_validation_rule.updated`.", - "type": "object" - }, - "22_obj_event_customer_created": { - "title": "Customer Created", - "description": "Event data object schema for `customer.created`.", - "type": "object" - }, - "22_obj_event_customer_deleted": { - "title": "Customer Deleted", - "description": "Event data object schema for `customer.deleted`.", - "type": "object" - }, - "22_obj_event_customer_rewarded": { - "title": "Customer Rewarded", - "description": "Event data object schema for `customer.rewarded`.", - "type": "object" - }, - "22_obj_event_customer_rewarded_loyalty_points": { - "title": "Customer Rewarded Loyalty Points", - "description": "Event data object schema for `customer.rewarded.loyalty_points`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "voucher": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "code": { - "type": "string" - }, - "loyalty_card": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "balance": { - "type": "integer" - } - } - }, - "type": { - "type": "string", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string" - }, - "campaign_id": { - "type": "string" - }, - "is_referral_code": { - "type": "boolean" - }, - "holder_id": { - "type": "string", - "example": "cust_o3ffuQSwM0vlxeJJoMqiOLMI" - } - } - }, - "campaign": { - "type": "string" - }, - "earning_rule": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "22_obj_event_customer_consents_revoked": { - "title": "Customer Consents Revoked", - "description": "Event data object schema for `customer.consents.revoked`.", - "type": "object" - }, - "22_obj_event_customer_consents_given": { - "title": "Customer Consents Given", - "description": "Event data object schema for `customer.consents.given`.", - "type": "object" - }, - "9_obj_customer_activity_object": { - "type": "object", - "title": "Customer Activity Object", - "description": "This is an object representing customer activity. \n\nThis is a general object which presents moments from customers' activity. There are all types of different events that customers perform during their journey once they participate in Promotions. Events describe moments when customers redeem coupons and earn points or rewards. The list of all types of activities is listed below.\n\nThe details describing the activity are collected in a property named `data`. In this object, software integrators will find all further information explaining the event context. \n\nCustomer Activity Object is a type of [Event](ref:track-custom-event) which is our way of letting you know when something interesting happens in your project. When an interesting event concerning an individual customer occurs, we create a new Customer Activity object. For example, when a code is published to a customer, we create a `customer.publication.succeeded` event.\n\n| **Event types (definition in progress)** |\n|:---|\n| customer.confirmed |\n| customer.created |\n| customer.updated |\n| customer.deleted |\n| customer.referred |\n| customer.custom_event |\n| customer.segment.entered |\n| customer.segment.left |\n| customer.sms.sent |\n| customer.sms.failed |\n| customer.email.sent |\n| customer.email.failed |\n| customer.activecampaign.sent |\n| customer.activecampaign.failed |\n| customer.braze.sent |\n| customer.braze.failed |\n| customer.mailchimp.sent |\n| customer.mailchimp.failed |\n| customer.intercom.sent |\n| customer.intercom.failed |\n| customer.rewarded |\n| customer.rewarded.loyalty_points |\n| customer.voucher.gift.balance_added |\n| customer.voucher.loyalty_card.points_added |\n| customer.voucher.loyalty_card.points_transferred |\n| customer.publication.succeeded |\n| customer.publication.failed |\n| customer.redemption.succeeded |\n| customer.redemption.failed |\n| customer.redemption.rollback.succeeded |\n| customer.redemption.rollback.failed |\n| customer.consents.given |\n| customer.consents.revoked |", - "x-tags": [ - "CUSTOMERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique event ID, assigned by Voucherify.", - "example": "evcus_0c150c51730c6b60b1" - }, - "type": { - "type": "string", - "description": "Event type.", - "enum": [ - "customer.confirmed", - "customer.created", - "customer.updated", - "customer.deleted", - "customer.referred", - "customer.custom_event", - "customer.segment_entered", - "customer.segment.left", - "customer.sms.sent", - "customer.sms.failed", - "customer.email.sent", - "customer.email.failed", - "customer.activecampaign.sent", - "customer.braze.sent", - "customer.mailchimp.sent", - "customer.intercom.sent", - "customer.intercom.failed", - "customer.rewarded", - "customer.rewarded.loyalty_points", - "customer.voucher.gift.balance_added", - "customer.voucher.loyalty_card.points_added", - "customer.voucher.loyalty_card.points_transferred", - "customer.publication.succeeded", - "customer.publication.failed", - "customer.redemption.succeeded", - "customer.redemption.failed", - "customer.redemption.rollback.succeeded", - "customer.redemption.rollback.failed", - "customer.consents.given", - "customer.consents.revoked" - ] - }, - "data": { - "type": "array", - "description": "Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.", - "items": { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data" - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.", - "example": "2022-08-30T09:14:07.660Z", - "format": "date-time" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data": { - "title": "Customer Activity Data Object", - "description": "Event data object schema.", - "anyOf": [ - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_confirmed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_created" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_updated" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_deleted" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_referred" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_custom_event" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_entered" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_left" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_sent" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded_loyalty_points" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_failed" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_given" - }, - { - "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_revoked" - } - ] + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_email_unsubscribed": { - "title": "Email Unsubscribed", - "description": "Email unsubscribed", - "type": "object", - "properties": { - "email_unsubscribed": { - "type": "boolean" - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } - }, - "9_obj_customer_activity_object_data_customer_confirmed": { - "title": "Customer Confirmed", - "description": "Event data object schema for `customer.confirmed`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - }, - "unconfirmed_customer": { - "type": "string", - "example": "ucust_1qa70mVfYkl11Ab0ZxDPdWNa" - } + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "9_obj_customer_activity_object_data_customer_created": { - "title": "Customer Created", - "description": "Event data object schema for `customer.created`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data_customer_updated": { - "title": "Customer Updated", - "description": "Event data object schema for `customer.updated`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } - } + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_deleted": { - "title": "Customer Deleted", - "description": "Event data object schema for `customer.deleted`.", - "type": "object", - "properties": { - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } - }, - "9_obj_customer_activity_object_data_customer_referred": { - "title": "Customer Referred", - "description": "Event data object schema for `customer.referred`.", - "type": "object", - "properties": { - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "referrer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "custom_event": { - "type": "object" - } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "9_obj_customer_activity_object_data_customer_custom_event": { - "title": "Custom Event", - "description": "Event data object schema for `customer.custom_event`.", - "type": "object", - "properties": { - "event": { - "type": "object" - }, - "loyalty": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "referral": { - "type": "object" - }, - "event_schema": { - "type": "object" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_order_paid_no_validation_rule": { + "description": "This is an object representing an earning rule for a paid order.", + "type": "object", + "title": "Earning Rule Object for Order Paid", + "examples": [ + { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data_customer_segment_entered": { - "title": "Segment Entered", - "description": "Event data object schema for `customer.segment.entered`.", - "type": "object", - "properties": { - "segment": { - "type": "object" - }, - "customer": { - "type": "object" - } - } + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_segment_left": { - "title": "Segment Left", - "description": "Event data object schema for `customer.segment.left`.", - "type": "object", - "properties": { - "segment": { - "type": "object" - }, - "customer": { - "type": "object" - } + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } + ] + }, + "event": { + "type": "string", + "enum": [ + "order.paid" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data_customer_sms_sent": { - "title": "SMS Sent", - "description": "Event data object schema for `customer.sms.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_sms_failed": { - "title": "SMS Failed", - "description": "Event data object schema for `customer.sms.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_email_sent": { - "title": "Email Sent", - "description": "Event data object schema for `customer.email.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_email_failed": { - "title": "Email Failed", - "description": "Event data object schema for `customer.email.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_activecampaign_sent": { - "title": "ActiveCampaign Sent", - "description": "Event data object schema for `customer.activecampaign.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_activecampaign_failed": { - "title": "ActiveCampaign Failed", - "description": "Event data object schema for `customer.activecampaign.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_braze_sent": { - "title": "Braze Sent", - "description": "Event data object schema for `customer.braze.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_braze_failed": { - "title": "Braze Failed", - "description": "Event data object schema for `customer.braze.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_mailchimp_sent": { - "title": "Mailchimp Sent", - "description": "Event data object schema for `customer.mailchimp.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_mailchimp_failed": { - "title": "Mailchimp Failed", - "description": "Event data object schema for `customer.mailchimp.failed`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_intercom_sent": { - "title": "Intercom Sent", - "description": "Event data object schema for `customer.intercom.sent`.", - "type": "object" - }, - "9_obj_customer_activity_object_data_customer_intercom_failed": { - "title": "Intercom Failed", - "description": "Event data object schema for `customer.intercom.failed`.", - "type": "object" + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_rewarded": { - "title": "Customer Rewarded", - "description": "Event data object schema for `customer.rewarded`.", - "type": "object", - "properties": { - "holder": { - "type": "object" - }, - "reward": { - "type": "object" - }, - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "custom_event": { - "type": "object" - }, - "referral_tier": { - "type": "object" - }, - "customer_event": { - "type": "object" - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "9_obj_customer_activity_object_data_customer_rewarded_loyalty_points": { - "title": "Customer Rewarded Loyalty Points", - "description": "Event data object schema for `customer.rewarded.loyalty_points`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "earning_rule": { - "type": "object" - }, - "loyalty_tier": { - "type": "object" - } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." } - }, - "9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added": { - "title": "Gift Voucher Balance Added", - "description": "Event data object schema for `customer.voucher.gift.balance_added`.", - "type": "object", - "properties": { - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added": { - "title": "Loyalty Card Points Added", - "description": "Event data object schema for `customer.voucher.loyalty_card.points_added`.", - "type": "object", - "properties": { - "balance": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred": { - "title": "Loyalty Card Points Transferred", - "description": "Event data object schema for `customer.voucher.loyalty_card.points_transferred`.", - "type": "object" + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_publication_succeeded": { - "title": "Publication Succeeded", - "description": "Event data object schema for `customer.publication.succeeded`.", - "type": "object", - "properties": { - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "publication": { - "type": "object" - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "9_obj_customer_activity_object_data_customer_publication_failed": { - "title": "Publication Failed", - "description": "Event data object schema for `customer.publication.failed`.", - "type": "object", - "properties": { - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "publication": { - "type": "object" - } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." } - }, - "9_obj_customer_activity_object_data_customer_redemption_succeeded": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `customer.redemption.succeeded`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "9_obj_customer_activity_object_data_customer_redemption_failed": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `customer.redemption.failed`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded": { - "title": "Redemption Rollback Succeeded", - "description": "Event data object schema for `customer.redemption.rollback.succeeded`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "voucher": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - }, - "redemption_rollback": { - "type": "object" - } - } + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "9_obj_customer_activity_object_data_customer_redemption_rollback_failed": { - "title": "Redemption Rollback Failed", - "description": "Event data object schema for `customer.redemption.rollback.failed`.", - "type": "object", - "properties": { - "order": { - "type": "object" - }, - "holder": { - "type": "object" - }, - "campaign": { - "type": "object" - }, - "customer": { - "type": "object" - }, - "redemption": { - "type": "object" - }, - "promotion_tier": { - "type": "object" - }, - "redemption_rollback": { - "type": "object" - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "9_obj_customer_activity_object_data_customer_consents_given": { - "title": "Consents Given", - "description": "Event data object schema for `customer.consents.given`.", - "type": "object", - "properties": { - "consents": { - "type": "object" - }, - "customer": { - "type": "object" - } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "9_obj_customer_activity_object_data_customer_consents_revoked": { - "title": "Consents Given", - "description": "Event data object schema for `customer.consents.revoked`.", - "type": "object", - "properties": { - "consents": { - "type": "object" - }, - "customer": { - "type": "object" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_entered_segment_no_validation_rule": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "customers_permanent_deletion_response_body": { - "type": "object", - "title": "Customer Permanent Deletion Response Body", - "description": "Response body schema for `/customers/{customerId}/permanent-deletion`.", - "properties": { - "id": { - "type": "string", - "description": "Unique permanent deletion object ID.", - "example": "del_mgzqZNwUnwnt1Ddw6phEG90Q" - }, - "created_at": { - "type": "string", - "example": "2022-09-02T17:55:47.865Z", - "description": "Timestamp representing the date and time when the customer was requested to be deleted in ISO 8601 format.", - "format": "date-time" - }, - "related_object_id": { - "type": "string", - "example": "cust_m557pDDl4IGXexkU6KOQ2Dwi", - "description": "Unique customer ID that is being deleted." - }, - "related_object": { - "type": "string", - "description": "Object being deleted.", - "default": "customer" - }, - "status": { - "type": "string", - "description": "Deletion status.", - "default": "DONE" - }, - "data_json": { - "type": "object", - "description": "Statistics summarizing the number of related information that was deleted.", - "required": [ - "events", - "customer_events", - "daily_events", - "segments", - "orders", - "order_events", - "customer" - ], - "properties": { - "events": { - "type": "integer", - "description": "Number of events deleted." - }, - "customer_events": { - "type": "integer", - "description": "Number of customer events deleted." - }, - "daily_events": { - "type": "integer", - "description": "Number of daily events deleted." - }, - "segments": { - "type": "integer", - "description": "Number of segments deleted." - }, - "orders": { - "type": "integer", - "description": "Number of orders deleted." - }, - "order_events": { - "type": "integer", - "description": "Number of order events deleted." - }, - "customer": { - "type": "integer", - "description": "Number of customers deleted.", - "default": 1 - } - } - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON.", - "default": "pernament_deletion" - } - }, - "required": [ - "id", - "created_at", - "related_object_id", - "related_object", - "status", - "data_json", - "object" - ] + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "customers_update_metadata_in_bulk_request_body": { - "type": "object", - "title": "Update Customers' Metadata in bulk Request Body", - "description": "Request body schema for `/customers/metadata/async`.", - "properties": { - "source_ids": { - "type": "array", - "description": "An array of customer `source_id`'s.", - "items": { - "type": "string" - } - }, - "metadata": { - "type": "object", - "description": "Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" }, - "required": [ - "source_ids", - "metadata" - ] - }, - "customers_update_in_bulk_request_body": { - "type": "array", - "title": "Update Customers in bulk Request Body", - "description": "Request body schema for `/customers/bulk/async`.", - "items": { - "$ref": "#/components/schemas/customers_update_in_bulk_item_request_body" + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "customers_update_in_bulk_item_request_body": { - "title": "Update Customers in bulk Request Body", - "description": "Request body schema for `/customers/bulk/async`.", - "properties": { - "source_id": { - "type": "string", - "description": "Unique customer source ID." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Customer's first and last name." - }, - "description": { - "type": [ - "string", - "null" - ], - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": [ - "string", - "null" - ], - "description": "Customer's email address." - }, - "phone": { - "type": [ - "string", - "null" - ], - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ], - "description": "City" - }, - "state": { - "type": [ - "string", - "null" - ], - "description": "State" - }, - "line_1": { - "type": [ - "string", - "null" - ], - "description": "First line of address." - }, - "line_2": { - "type": [ - "string", - "null" - ], - "description": "Second line of address." - }, - "country": { - "type": [ - "string", - "null" - ], - "description": "Country." - }, - "postal_code": { - "type": [ - "string", - "null" - ], - "description": "Postal code." - } - } - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate; format `YYYY-MM-DD`." - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " - } - }, - "required": [ - "source_id" - ] - }, - "9_req_update_customers_consents": { - "type": "object", - "title": "Update Customer Consents Request Body", - "description": "Request body schema for **PUT** `/customers/{customerId}/consents`.", - "properties": { - "consent_id": { - "type": "boolean", - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not." - }, - "unsubscribed": { - "type": "boolean", - "description": "To deny all consents, use `unsubscribed` as a consent identifier and `true` as a value." - } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." } - }, - "10_obj_order_object": { - "type": "object", - "title": "Order object", - "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", - "x-tags": [ - "ORDERS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." - }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" - }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - }, - "redemptions": { - "oneOf": [ - { - "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" - }, - { - "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" - } - ] - } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "10_obj_order_object_no_discount_calculations": { - "type": "object", - "title": "Order object", - "description": "This is an object representing an order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" - }, - "status": { - "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts." - }, - "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique identifier that represents the product or SKU from your inventory system." - }, - "related_object": { - "type": "string", - "description": "Reference to the object containing details of the related product. This can either be a `product` or `sku`.", - "enum": [ - "product", - "sku" - ] - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`." - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { - "type": "object", - "description": "Object containing information about the customer that is making the purchase.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." - } - } - }, - "referrer": { - "type": "object", - "description": "Object containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." - }, - "object": { - "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "10_obj_order_object_unstacked_redemptions": { - "type": "object", - "title": "Unstacked Redemption", - "description": "Redemption object representing a single redemption.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "enum": [ - "voucher", - "promotion_tier" - ] - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the related object that defines the incentive." - }, - "related_object_parent_id": { - "type": "string", - "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign." - } - } - } - } + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "10_obj_order_object_stacked_redemptions": { - "type": "object", - "title": "Stacked Redemption", - "description": "Redemption object representing a stacked redemption.", - "properties": { - "redemption_ID": { - "type": "object", - "description": "The property name is the unique parent redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of multiple incentives.", - "properties": { - "date": { - "type": "string", - "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", - "example": "2022-09-02T17:06:56.649Z", - "format": "date-time" - }, - "related_object_type": { - "type": "string", - "description": "The source of the incentive.", - "default": "redemption" - }, - "related_object_id": { - "type": "string", - "description": "Unique ID of the parent redemption.", - "example": "r_0ba186c4824e4881e1" - }, - "stacked": { - "type": "array", - "description": "Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.", - "items": { - "type": "string" - } - } - } - } + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "10_res_list_orders": { - "type": "object", - "title": "List Orders Response Body", - "description": "Response body schema representing **GET** `/orders`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about orders in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "orders", - "description": "Identifies the name of the attribute that contains the array of order objects." - }, - "orders": { - "type": "array", - "description": "Contains array of order objects.", - "items": { - "$ref": "#/components/schemas/10_obj_order_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of orders." - } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" } - }, - "10_req_create_order": { - "type": "object", - "title": "Order", - "description": "Request body schema for creating an order.", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "10_req_update_order": { - "type": "object", - "title": "Update Order Request Body", - "description": "Request body schema for **PUT** `/orders/{orderId}`.", - "properties": { - "status": { - "type": "string", - "description": "The order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULLFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - }, - "customer_id": { - "type": "string", - "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "description": "Unique customer ID of the customer making the purchase." - }, - "referrer_id": { - "type": "string", - "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "description": "Unique referrer ID." - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "10_req_create_order_export": { - "type": "object", - "title": "Create Order Export Request Body", - "description": "Request body schema for **POST** `/orders/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/16_obj_export_order", - "description": "Contains the parameters that define the data to be exported." - } - } + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "10_req_orders_import": { - "type": "array", - "title": "Import Orders Request Body", - "description": "Request body schema for POST `/orders/import`.", - "items": { - "type": "object", - "properties": { - "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "status": { - "type": "string", - "description": "The order status. One of `CREATED`, `PAID`, `CANCELED`, `FULFILLED`." - }, - "amount": { - "type": "integer", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." - }, - "customer": { - "$ref": "#/components/schemas/10_req_orders_customer_object" - }, - "referrer": { - "$ref": "#/components/schemas/10_req_orders_referrer_object" - }, - "items": { - "$ref": "#/components/schemas/10_req_orders_items_array" - } - } + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "10_req_orders_customer_object": { - "type": "object", - "title": "Customer", - "description": "This is an object containing information about the customer.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer that will be linked to the order; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Customer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a customer object." - }, - "email": { - "type": "string", - "description": "Customer's email address." - }, - "phone": { - "type": "string", - "description": "Customer's phone number." - }, - "address": { - "type": "object", - "description": "Customer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address" - }, - "line_2": { - "type": "string", - "description": "Second line of address" - }, - "country": { - "type": "string", - "description": "Country" - }, - "postal_code": { - "type": "string", - "description": "Postal code" - } - } - }, - "birthdate": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Customer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer." - } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" } - }, - "10_req_orders_referrer_object": { - "type": "object", - "title": "Referrer", - "description": "This is an ojbect containing information about the referrer.", - "properties": { - "id": { - "type": "string", - "description": "The unique ID of an existing customer that will be linked to the order as the referrer; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." - }, - "source_id": { - "type": "string", - "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." - }, - "name": { - "type": "string", - "description": "Referrer's first and last name." - }, - "description": { - "type": "string", - "description": "An arbitrary string that you can attach to a referrer object." - }, - "email": { - "type": "string", - "description": "Referrer's email address." - }, - "phone": { - "type": "string", - "description": "Referrer's phone number." - }, - "address": { - "type": "object", - "description": "Referrer's address.", - "properties": { - "city": { - "type": "string", - "description": "City" - }, - "state": { - "type": "string", - "description": "State" - }, - "line_1": { - "type": "string", - "description": "First line of address" - }, - "line_2": { - "type": "string", - "description": "Second line of address" - }, - "country": { - "type": "string", - "description": "Country" - }, - "postal_code": { - "type": "string", - "description": "Postal code" - } - } - }, - "birthdate": { - "type": "string", - "description": "Referrer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "birthday": { - "type": "string", - "description": "Referrer's birthdate; format `YYYY-MM-DD`.", - "format": "date" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a referrer." - } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "10_req_orders_items_array": { - "type": "array", - "title": "Items Array", - "description": "Array of items applied to the order.", - "items": { - "$ref": "#/components/schemas/10_req_orders_order_item" + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_custom_event": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "10_req_orders_order_item": { - "type": "object", - "title": "Order Item", - "description": "This object represents an order line item.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "related_object": { - "type": "string", - "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." - }, - "product_id": { - "type": "string", - "description": "A unique product ID assigned by Voucherify.", - "example": "prod_0a7e62db1fca8322a2" - }, - "sku_id": { - "type": "string", - "description": "A unique SKU ID assigned by Voucherify.", - "example": "sku_0a41e31c7b41c28358" - }, - "quantity": { - "type": "integer", - "description": "The quantity of the particular item in the cart." - }, - "price": { - "type": "integer", - "description": "The unit price of the item." - }, - "amount": { - "type": "integer", - "description": "The total amount of the order item (`price` * `quantity`)." - }, - "product": { - "$ref": "#/components/schemas/10_req_orders_order_item_product" - }, - "sku": { - "$ref": "#/components/schemas/10_req_orders_order_item_sku" - } - } + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "10_req_orders_order_item_product": { - "type": "object", - "title": "Product", - "description": "An object containing details of the related product.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "name": { - "type": "string", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Product price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format." - }, - "override": { - "type": "boolean", - "description": "The override set to true is used to store the product information in the system. If product does not exist, it will be created with the use of `source_id`; if it does exist, the provided values for the `name`, `price`, and `metadata` will replace those already stored in the system." - } + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "10_req_orders_order_item_sku": { - "type": "object", - "title": "SKU", - "description": "An object containing details of the related SKU.", - "properties": { - "source_id": { - "type": "string", - "description": "The merchant’s SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." - }, - "sku": { - "type": "string", - "description": "The SKU name." - }, - "price": { - "type": "integer", - "description": "SKU price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format." - }, - "override": { - "type": "boolean", - "description": "The override is used to store the SKU in the system. If the SKU does not exist, it will be created with the use of `source_id`. Additionally, if the SKU does not exist, you are required to set the parent `product_id` that it belongs to. Set the parent `product_id` one level above, i.e. at the item level. If the parent product does not exist in Voucherify, i.e. does not have a unique `product_id`, then define the product object one level above, i.e. at the item level and make sure to also include the override as `true` for the product." - } + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." } - }, - "10_obj_order_item_object": { - "title": "Order Item Object", - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" }, - "description": "This is an object representing an order item. \n\nOrder Items are always specified within the [order object](ref:get-order). They can be related either to [products](list-products) or [SKUs](ref:list-skus-in-product). \n\nProduct/SKU details sent within an order item will be used on top of Product/SKU already stored in the system during the [Redeem Voucher](ref:redeem-voucher), [Validate Voucher](ref:validate-voucher), [Validate Promotions](ref:validate-promotions) and [Redeem Promotion](ref:redeem-promotion) requests.", - "x-tags": [ - "ORDERS API" - ] - }, - "11_obj_product_object": { - "type": "object", - "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.", - "title": "Product Object", - "x-tags": [ - "PRODUCTS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0b1da8105693710357" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID from your inventory system." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the `product`.", - "default": "product" - }, - "skus": { - "$ref": "#/components/schemas/11_res_get_product_skus_object" - } + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_custom_event_no_validation_rule": { + "description": "This is an object representing an earning rule triggered by a custom event.", + "type": "object", + "title": "Earning Rule Object for Custom Event", + "examples": [ + { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" }, - "11_req_create_product": { - "type": "object", - "description": "Request schema for **POST** `/products`.", - "title": "Create Product Request Body", - "properties": { - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "11_req_update_products_metadata_in_bulk": { - "type": "object", - "description": "Request schema for **POST** `/products/metadata/async`.", - "title": "Update Products' Metadata in Bulk Request Body", - "properties": { - "source_ids": { - "type": "array", - "description": "Array of unique product source IDs.", - "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." - } + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "null", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" }, - "required": [ - "source_ids", - "metadata" - ] - }, - "11_req_update_product": { - "type": "object", - "description": "Request schema for **PUT** `/products/{productId}`.", - "title": "Update Product Request Body", - "properties": { - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } - }, - "11_req_update_product_bulk": { - "type": "object", - "description": "Request schema for **POST** `/products/bulk/async`.", - "title": "Update Product Request Body", - "properties": { - "source_id": { - "type": "string", - "description": "Unique product source ID from your inventory system.", - "example": "test_prod_id_1" - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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" - } - } - }, - "11_res_list_products": { - "type": "object", - "description": "Response body schema representing **GET** `/products`.", - "title": "Product Object", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about products in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of product objects.", - "default": "products" - }, - "products": { - "type": "array", - "description": "Contains array of product objects.", - "items": { - "$ref": "#/components/schemas/11_obj_list_products_product_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of product objects." - } + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "11_obj_list_products_product_object": { - "type": "object", - "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.", - "title": "Product Object", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID assigned by Voucherify.", - "example": "prod_0b1da8105693710357" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the product.", - "default": "product" - }, - "skus": { - "type": "object", - "description": "Contains a list of related child SKUs.", - "properties": { - "data": { - "type": "array", - "description": "Contains a list of SKU objects.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - }, - "total": { - "type": "number", - "description": "Total number of SKUs." - } - } - } + ] + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" } - }, - "11_res_get_product_skus_object": { - "type": "object", - "description": "Contains information about child SKUs.", - "title": "SKUs object", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of SKUs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of SKUs.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of SKUs in the product." - } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "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" - } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" }, - "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.", - "title": "Product Object", - "properties": { - "id": { - "type": "string", - "description": "Unique product ID.", - "example": "prod_f1r5Tpr0DuC7" - }, - "source_id": { - "type": "string", - "example": "productSourceID16", - "description": "Unique product source ID." - }, - "name": { - "type": "string", - "description": "Unique user-defined product name.", - "example": "T-shirt" - }, - "price": { - "type": "integer", - "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", - "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", - "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", - "example": "2022-05-23T09:24:07.405Z", - "format": "date-time" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about the `product`.", - "default": "product" - } + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" } - }, - "11_obj_sku_object": { - "title": "SKU Object", - "type": "object", - "description": "This is an object representing a product SKU. \n\nThe SKU (acronym from Stock Keeping Unit) is tightly related to the [product object](ref:get-product). It reflects its different variants. One product can have many SKUs which are characterized and differentiated by varying values of the parent product `attributes`.", - "x-tags": [ - "PRODUCTS API" - ], - "examples": [ - { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" - } - ], - "properties": { - "id": { - "type": "string", - "example": "sku_0b1621b319d248b79f", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "product_id": { - "type": "string", - "example": "prod_0b15f6b9f650c16990", - "description": "The parent product's unique ID." - }, - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency.", - "example": "USD" - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - }, - "created_at": { - "type": "string", - "example": "2022-05-17T10:36:30.187Z", - "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "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" - }, - "object": { - "type": "string", - "default": "sku", - "description": "The type of object represented by JSON. This object stores information about the `SKU`." - } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } - }, - "11_req_create_sku": { - "title": "SKU Object", - "type": "object", - "description": "Request body schema for **POST** `/products/{productId}/skus", - "properties": { - "source_id": { - "type": "string", - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency.", - "example": "USD" - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" } - }, - "product_collections_sku_in_collection": { - "title": "SKU in Collection", - "type": "object", - "description": "This is an object representing a SKU in product collection.", - "properties": { - "id": { - "type": "string", - "example": "sku_0b1621b319d248b79f", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": [ - "string", - "null" - ], - "example": "sku_source_id_4", - "description": "A unique SKU identifier from your inventory system." - }, - "product_id": { - "type": "string", - "example": "prod_0b15f6b9f650c16990", - "description": "The parent product's unique ID." - }, - "sku": { - "type": [ - "string", - "null" - ], - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "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": { - "type": "object", - "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", - "null" - ], - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - }, - "created_at": { - "type": "string", - "example": "2022-05-17T10:36:30.187Z", - "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", - "format": "date-time" - }, - "updated_at": { - "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" - }, - "object": { - "type": "string", - "default": "sku", - "description": "The type of object represented by JSON. This object stores information about the `SKU`." - }, - "product": { - "type": "object", - "description": "Stores information about the parent product.", - "required": [ - "id", - "source_id", - "name", - "price", - "attributes", - "metadata", - "object" - ], - "properties": { - "id": { - "type": "string", - "example": "prod_f15Tpr0DuC7", - "description": "Unique product ID." - }, - "source_id": { - "type": [ - "string", - "null" - ], - "example": "productSourceID11", - "description": "A unique product ID from your inventory system." - }, - "name": { - "type": [ - "string", - "null" - ], - "example": "Shirts", - "description": "Unique user-defined product name." - }, - "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 SKL 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." - }, - "object": { - "type": "string", - "default": "product", - "description": "The type of object represented by the object. This object stores information about the parent `product`." - } - } - } + } + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." }, - "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", - "type": "object", - "description": "Request body schema for **PUT** `/products/{productId}/skus/{skuId}`.", - "properties": { - "sku": { - "type": "string", - "example": "Large Pink Shirt", - "description": "Unique user-defined SKU name." - }, - "price": { - "type": "integer", - "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "currency": { - "type": "string", - "description": "SKU price currency." - }, - "attributes": { - "type": "object", - "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", - "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." - } + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } - }, - "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", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about products and SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of products and SKUs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of products and SKUs.", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/product_collections_product_in_collection" - }, - { - "$ref": "#/components/schemas/product_collections_sku_in_collection" - } - ] + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" + } + } + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_req_update_earning_rule_object_tier": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_earning_rule_object_tier_no_validation_rule": { + "description": "This is an object representing an earning rule for tiers.", + "type": "object", + "title": "Earning Rule Object for Tiers", + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.", + "type": "null" + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "event": { + "type": "string", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", + "enum": [ + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged" + ] + }, + "loyalty_tier": { + "type": "object", + "description": "Defines the tier associated with the earning rule definition.", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", + "example": "ltr_pudTGWasuIqxdiDM0go31OV1" + } + } + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, + "8_obj_fixed_points": { + "title": "Define Fixed Amount of Points", + "type": "object", + "description": "This is an object representing points calculated based on a fixed value.", + "properties": { + "points": { + "type": "integer", + "description": "The number of points to be added to the loyalty card.", + "example": 100 + }, + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", + "enum": [ + "FIXED" + ] + } + } + }, + "8_obj_calculate_points_proportionally_order_paid": { + "title": "Calculate Points Proportionally", + "description": "This is an object representing points calculated proportionally to another property.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_amounts" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_total_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_metadata" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_item_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_subtotal_amount" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_items_quantity" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "8_obj_calculate_points_proportionally_order_amounts": { + "title": "Calculate Points Proportionally to Order Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_AMOUNT" + ], + "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" + }, + "order": { + "type": "object", + "properties": { + "amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } - }, - "total": { - "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", - "description": "Response body schema for **GET** `/products/{productID}/skus`.", - "title": "List SKUs in Product Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about SKUs.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of SKUs.", - "default": "skus" - }, - "skus": { - "type": "array", - "description": "A dictionary that contains an array of SKUs.", - "items": { - "$ref": "#/components/schemas/11_obj_sku_object" + } + } + } + } + }, + "8_obj_calculate_points_proportionally_order_total_amount": { + "title": "Calculate Points Proportionally to Total Order Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_TOTAL_AMOUNT" + ], + "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + }, + "order": { + "type": "object", + "properties": { + "total_amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." } - }, - "total": { - "type": "integer", - "description": "Total number of SKUs in the product." } } - }, - "product_collections_static_collection": { - "type": "object", - "title": "Static Product Collection", - "description": "Schema model for a `STATIC` product collection.", - "properties": { - "type": { - "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", - "enum": [ - "STATIC" - ] - }, - "products": { - "description": "Defines a set of products for a `STATIC` product collection type.", - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "prod_0a41bcf807c5fcaaf6", - "description": "The product ID." - }, - "product_id": { - "type": "string", - "description": "Product ID for SKUs." - }, - "object": { - "enum": [ - "sku", - "product" - ], - "description": "Denotes the type of object represented by the ID." - } - }, - "required": [ - "id", - "object" - ] + } + } + } + }, + "8_obj_calculate_points_proportionally_order_metadata": { + "title": "Calculate Points Proportionally To an Order Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to an order metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_METADATA" + ], + "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `order.metadata` object)" + }, + "order": { + "type": "object", + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the order metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "number_of_store_visits", + "description": "Order metadata property." } } - }, - "required": [ - "type", - "products" - ] - }, - "product_collections_dynamic_collection": { - "type": "object", - "title": "Dynamic Product Collection", - "description": "Schema model for an `AUTO_UPDATE` product collection.", - "properties": { - "type": { - "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" - ] - }, - "filter": { - "type": "object", - "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" - } + } + } + } + } + }, + "8_obj_calculate_points_proportionally_item_amount": { + "title": "Calculate Points Proportionally to Order Items Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_AMOUNT" + ], + "description": "- `ORDER_ITEMS_AMOUNT`; Pre-discount amount spent on items defined in the `order_items.amount.object` & `.id` (X points for every Y spent on items excluding discounts)" + }, + "order_items": { + "type": "object", + "properties": { + "amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." } } - }, - "required": [ - "type", - "filter" - ] - }, - "product_collections_list_response_body": { - "type": "object", - "title": "List Product Collections Response Body", - "description": "Response body schema for **GET** `/product-collections`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about product collections.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the JSON property that contains the array of product collections." - }, - "data": { - "description": "A dictionary that contains an array of product collections and their details.", - "type": "array", - "items": { - "$ref": "#/components/schemas/product_collections_collection_item" + } + } + } + } + }, + "8_obj_calculate_points_proportionally_items_subtotal_amount": { + "title": "Calculate Points Proportionally to Order Items Subtotal Amount", + "type": "object", + "description": "This is an object representing points calculated proportionally to another property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_SUBTOTAL_AMOUNT" + ], + "description": "- `ORDER_ITEMS_SUBTOTAL_AMOUNT`; Amount spent on items defined in the `order_items.subtotal_amount.object` & `.id` (X points for every Y spent on items including discounts)" + }, + "order_items": { + "type": "object", + "properties": { + "subtotal_amount": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." } - }, - "total": { - "type": "integer", - "description": "Total number of product collections." } + } + } + } + } + }, + "8_obj_calculate_points_proportionally_items_quantity": { + "title": "Calculate Points Proportionally to Quantity of Items in the Cart", + "type": "object", + "description": "This is an object representing points calculated proportionally to quantity of items in the cart.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_QUANTITY" + ], + "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in `order_items.quantity.object` & `.id` (X points for every Y items excluding free items)" + }, + "order_items": { + "type": "object", + "properties": { + "quantity": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every set of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` `calculation_type`, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. `pc_75U0dHlr7u75BJodrW1AE3t6`, `prod_0bae32322150fd0546`, or `sku_0b7d7dfb090be5c619`." + } + } + } + } + } + } + }, + "8_obj_calculate_points_proportionally_customer_metadata": { + "title": "Calculate Points Proportionally To a Customer Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to a customer metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "`CUSTOMER_METADATA`: Customer Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `customer.metadata` object)" + }, + "customer": { + "type": "object", + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "customer_life_time_value", + "description": "Customer metadata property." + } + } + } + } + } + } + }, + "8_obj_calculate_points_proportionally_custom_event_metadata": { + "title": "Calculate Points Proportionally To a Custom Event Metadata Property", + "type": "object", + "description": "This is an object representing points calculated proportionally to a custom event metadata property.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio.", + "enum": [ + "PROPORTIONAL" + ] + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "`CUSTOM_EVENT_METADATA`: Custom Event Metadata (X points for every Y in metadata attribute, defined in the `property` key under the `custom_event.metadata` object)" + }, + "custom_event": { + "type": "object", + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "description": "Defines the ratio based on the property defined in the `calculation_type` parameter. For every given increment of value (1, 10, etc) defined in the `every` parameter for the property defined in `calculation_type`, give the customer the number of points defined in the `points` parameter. In other words, for `every` order metadata property value, give `points`.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the custom event metadata property to grant points for.", + "example": 100 + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card.", + "example": 10 + }, + "property": { + "type": "string", + "example": "volume_number", + "description": "Custom event metadata property." + } + } + } + } + } + } + }, + "8_res_list_loyalty_campaigns": { + "title": "List Loyalty Campaigns Response Body", + "type": "object", + "description": "Response body schema for listing loyalty campaigns using **GET** `/loyalties`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty campaigns in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "campaigns", + "description": "Identifies the name of the attribute that contains the array of loyalty campaign objects." + }, + "campaigns": { + "type": "array", + "description": "Contains an array of loyalty campaign objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object_no_extended_categories" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty campaign objects." + } + } + }, + "8_req_create_loyalty_cards": { + "type": "object", + "title": "Create Loyalty Campaign Request Body", + "description": "Request body schema for creating a loyalty campaign.", + "properties": { + "name": { + "type": "string", + "description": "Campaign name." + }, + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign (size of campaign)." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "voucher": { + "$ref": "#/components/schemas/2_req_campaign_object_voucher_object_LOYALTY_CARD" + } + } + }, + "8_loyalty_tiers_expiration_balance": { + "title": "Balance", + "type": "object", + "description": "Defines the Balance expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "BALANCE" + ], + "description": "Tier qualification. \n\n`BALANCE`: Points balance is based on the customer's current points balance. Customers qualify for the tier if their points balance is in the points range of the tier." + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points." + } + } + }, + "expiration_date": { + "description": "Defines the conditions for the expiration date of a tier.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_balance_drop" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance_expiration_date_custom" + } + ] + } + } + }, + "8_loyalty_tiers_expiration_balance_expiration_date_balance_drop": { + "title": "Balance Drop", + "type": "object", + "description": "Defines the conditions for the expiration date of a tier based on a pure balance drop.", + "properties": { + "type": { + "type": "string", + "enum": [ + "BALANCE_DROP" + ], + "description": "What triggers the tier to expire for a customer. \n`BALANCE_DROP`: Tier expires when the points balance drops below the required range of the tier." + } + } + }, + "8_loyalty_tiers_expiration_balance_expiration_date_custom": { + "title": "Custom", + "type": "object", + "description": "Defines the custom conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "What triggers the tier to expire for a customer. \n`CUSTOM`: Tier expires after a certain time period passes following the instance the points balance drops below the required range of the tier." + }, + "extend": { + "type": "string", + "description": "Defines the amount of time the tier will remain active in ISO 8601 format. The expiration date counter starts at the moment when the customer reaches the minimum required points that are required to be in the tier. For example, a tier with a duration of P3M will be valid for a duration of 3 months." + }, + "rounding": { + "description": "Defines the rounding mechanism for tier expiration.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_default_options" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_expiration_date_rounding_custom" + } + ] + } + } + }, + "8_loyalty_tiers_expiration_expiration_date_rounding_default_options": { + "title": "Calendar Periods", + "type": "object", + "description": "Defines the rounding mechanism for tier expiration based on a list of available time periods.", + "properties": { + "type": { + "type": "string", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ], + "description": "Period to which the expiration will be rounded to. \n- `MONTH`: The expiration date will be rounded to the end of the month. \n- `QUARTER`: The expiration date will be rounded to the end of the quarter. \n- `HALF_YEAR`: The expiration date will be rounded to the half year. \n- `YEAR`: The expiration date will be rounded to the end of the year." + } + } + }, + "8_loyalty_tiers_expiration_expiration_date_rounding_custom": { + "title": "Specific Month", + "type": "object", + "description": "Defines the custom rounding mechanism for tier expiration.", + "properties": { + "type": { + "type": "string", + "enum": [ + "CUSTOM" + ], + "description": "This mechanism describes a custom rounding for the expiration date." + }, + "unit": { + "type": "string", + "description": "Defines the type of unit of time in which the rounding period is counted.", + "enum": [ + "MONTH" + ] + }, + "value": { + "type": "integer", + "description": "Value for the unit of time that the rounding applies to. Units for this parameter are defined by the `rounding.unit` parameter. \n- `0`: January\n- `1`: February\n- `2`: March\n- `3`: April\n- `4`: May\n- `5`: June\n- `6`: July\n- `7`: August\n- `8`: September\n- `9`: October\n- `10`: November\n- `11`: December" + } + } + }, + "8_loyalty_tiers_expiration_points_in_period": { + "title": "Points in Period", + "type": "object", + "description": "Defines the Points in Period expiration mechanism for loyalty tiers.", + "properties": { + "qualification_type": { + "type": "string", + "enum": [ + "POINTS_IN_PERIOD" + ], + "description": "Tier qualification. \n\n`POINTS_IN_PERIOD`: A customer qualifies for the tier only if the sum of the accumulated points in a **defined time interval** reaches the tier threshold." + }, + "qualification_period": { + "type": "string", + "description": "Customers can qualify for the tier if they collected enough points in a given time period. So, in addition to the customer having to reach a points range, they also need to have collected the points within a set time period. \n\n| **Period** | **Definition** |\n|:---|:---|\n| **Calendar Month** | Points collected in one calendar month
                  January, February, March, etc. |\n| **Calendar Quarter** | Points collected in the quarter
                  - January - March
                  - April - June
                  - July - September
                  - October - December |\n| **Calendar Half-year** | Points collected in the half-year
                  - January - June
                  - July - December |\n| **Calendar Year** | Points collected in one calendar year
                  January - December |", + "enum": [ + "MONTH", + "QUARTER", + "HALF_YEAR", + "YEAR" + ] + }, + "start_date": { + "type": "object", + "description": "Defines the conditions for the start date of the tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "IMMEDIATE", + "NEXT_PERIOD" + ], + "description": "What triggers the tier to be valid for a customer. \n`IMMEDIATE`: After reaching the minimum required points. \n`NEXT_PERIOD`: When the next qualification period starts." + } + } + }, + "expiration_date": { + "type": "object", + "description": "Defines the conditions for the expiration date of a tier.", + "properties": { + "type": { + "type": "string", + "enum": [ + "END_OF_PERIOD", + "END_OF_NEXT_PERIOD" + ], + "description": "What triggers the tier to expire for a customer. \n`END_OF_PERIOD`: Expire tier at the end of the period. \n`END_OF_NEXT_PERIOD`: Expire tier at the end of the next period." + }, + "extend": { + "type": "string", + "description": "Extend the expiration by adding extra months or days in ISO 8601 format. The tier will remain active even though it reaches its expiration time period. For example, a tier with a duration of `P3M` will be valid for an additional duration of 3 months and a tier with a duration of `P1D` will be valid for an additional duration of 1 day." + } + } + } + } + }, + "8_req_update_loyalty_campaign": { + "type": "object", + "title": "Update Loyalty Campaign Request Body", + "description": "Request body schema for updating a loyalty campaign using **PUT** `/loyalties/{campaignId}`.", + "properties": { + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." + }, + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method). \n- `STATIC`: vouchers need to be manually published.", + "enum": [ + "AUTO_UPDATE", + "STATIC" + ] + }, + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. CONTEXT: `LOYALTY_PROGRAM`." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." + }, + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } + }, + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." + }, + "loyalty_tiers_expiration": { + "type": "object", + "description": "Defines the expiration mechanism for loyalty tiers.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_balance" + }, + { + "$ref": "#/components/schemas/8_loyalty_tiers_expiration_points_in_period" + } + ] + }, + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to. Either pass this parameter OR the `category`.", + "example": "cat_0b688929a2476386a7" + }, + "category": { + "type": "string", + "description": "The category assigned to the campaign. Either pass this parameter OR the `category_id`." + }, + "loyalty_card": { + "description": "Defines the loyalty card details.", + "type": "object", + "properties": { + "points": { + "type": "integer", + "description": "Initial loyalty card income in points to be applied to the loyalty card at voucher generation." + }, + "expiration_rules": { + "type": "object", + "description": "Defines point expiration rules.", + "properties": { + "period_type": { + "type": "string", + "enum": [ + "MONTH" + ], + "description": "The expiration period." + }, + "period_value": { + "type": "integer", + "description": "How many periods should pass before the expiration occurs." + }, + "rounding_type": { + "type": "string", + "enum": [ + "END_OF_MONTH", + "END_OF_QUARTER", + "END_OF_HALF_YEAR", + "END_OF_YEAR", + "PARTICULAR_MONTH" + ], + "description": "Round up expiration till the end of the given period type." + } + } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + } + } + }, + "8_req_create_earning_rules": { + "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", + "title": "Create Earning Rule Request Body", + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_earning_rule_object_order_paid" }, - "13_obj_validation_rule_object": { - "title": "Validation Rule Object", - "type": "object", - "description": "This is an object representing a validation rule. \n\nThis entity stores the rules used to limit resources in Voucherify. The validation rule can be assigned to resources such as a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)\n\nYou can configure the Validation Rule to include your own custom error messages which are going to be returned from the API upon a validation / redemption failure. You can read more [here](ref:errors#custom-error-messages-with-validation-rules).", - "x-tags": [ - "VALIDATION RULES API" - ], - "properties": { - "id": { - "type": "string", - "example": "val_eR1c41hu0vUU", - "description": "Unique validation rule ID." - }, - "name": { - "type": "string", - "description": "Custom, unique name for set of validation rules.", - "example": "Business Validation Rule" + { + "$ref": "#/components/schemas/8_req_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_req_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_req_earning_rule_object_tier" + } + ] + } + }, + "8_req_create_earning_rules_copy": { + "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", + "type": "object", + "title": "Create Earning Rule Request Body", + "properties": { + "event": { + "type": "string", + "enum": [ + "order.paid", + "customer.segment.entered", + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. Read more here. \n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment. Read more here. \n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining custom events. " + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "description": "Fixed. Applicable to events `order.paid`, `customer.segment.entered`, and `custom_event`.", + "properties": { + "points": { + "type": "integer", + "description": "The number of points to be added to the loyalty card.", + "example": 1000 + }, + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", + "default": "FIXED" + } }, - "rules": { - "type": "object", - "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the rule.", - "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
                  customer.metadata* \n**Order** |order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** | sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive | order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n\n*Requires the `property` field to be defined." - }, - "property": { - "type": [ - "string", - "null" - ], - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n customer_metadata
                  custom_event_metadata
                  order_items_metadata
                  order_metadata
                  product_metadata
                  redemption_metadata" - }, - "conditions": { - "type": "object", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n**Condition (key)** | **Definition** | **Does not support Types** \n--- | --- | ---\n $is | A property is a predefined value. | \n $is_not | A property is not a predefined value. | \n $in | A property either one value in a predefined list of values. | \n $less_than | A property is less than a predefined value. | boolean \n $less_than_or_equal | A property is less than or equal to a predefined value. | boolean \n $more_than | A property is more than a predefined value. | boolean \n $more_than_or_equal | A property is more than or equal to a predefined value. | boolean \n $starts_with | A property starts with the predefined sequence of characters. | boolean, number \n $ends_with | A property ends with the predefined sequence of characters. | boolean, number \n $contains | A property contains the predefined sequence of characters. | boolean, number \n $timeframe | | boolean, number \n $dow | | boolean, string \n $count | | boolean, string \n $count_more | | boolean, string \n $count_less | | boolean, string ", - "properties": { - "$one_of_voucherify_conditions": { - "type": "array", - "description": "Contains a set of conditions for the rule.", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] - } - } - } - }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } - } - }, - "logic": { - "type": "string" - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." - } + "required": [ + "points", + "type" + ] + }, + { + "description": "Proportional. Applicable to only `order.paid`.", + "properties": { + "type": { + "type": "string", + "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio", + "default": "PROPORTIONAL" + }, + "order": { + "type": "object", + "description": "Defines proportion for calculating how many points to add to a loyalty card. The ratio is based on the order amount. For `every` dollar spent, the customer will get this many `points`. \n", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "description": "Defines the ratio based on the order amount.", + "required": [ + "every", + "points" + ], + "properties": { + "every": { + "type": "integer", + "description": "Order amount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points awarded." } } } - }, - "logic": { - "type": "string", - "example": "(1 and 2) and (3)", - "description": "Defines the logic between the rules." - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." } } }, - "applicable_to": { - "type": "object", - "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { - "type": "object", - "description": "Defines the excluded item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." - } - } - } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { - "type": "object", - "description": "Defines the included item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." - } - } - } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." - } - } + "required": [ + "type", + "order" + ] + } + ], + "type": "object" + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day. `start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + }, + "required": [ + "duration", + "interval" + ] + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API." + } + }, + "required": [ + "schema_id" + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + }, + "required": [ + "id" + ] + } + }, + "required": [ + "event", + "loyalty" + ] + }, + "8_req_update_earning_rule": { + "description": "Request body schema for updating earning rules using **PUT** `/loyalties/{campaignId}/earning-rules/{earningRuleId}` endpoint.", + "title": "Update Earning Rule Request Body", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_order_paid" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_entered_segment" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_custom_event" + }, + { + "$ref": "#/components/schemas/8_req_update_earning_rule_object_tier" + } + ] + }, + "8_res_list_earning_rules": { + "description": "Response body schema for listing earning rules using **GET** `/loyalties/{campaignId}/earning-rules` endpoint.", + "type": "object", + "title": "List Earning Rules Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "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/8_obj_earning_rule_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + } + }, + "8_req_add_remove_points_balance": { + "title": "Add or Remove Points Balance Request Body", + "type": "object", + "description": "Request schema for adding or removing points from a loyalty card.", + "properties": { + "points": { + "type": "integer", + "description": "Incremental balance to be added to/subtracted from the loyalty card. \n\nTo add points: `100` \nTo subtract points, add a minus: `-100`" + }, + "expiration_type": { + "type": "string", + "default": "PROGRAM_RULES", + "enum": [ + "PROGRAM_RULES", + "NON_EXPIRING", + "CUSTOM_DATE" + ], + "description": "Set the type of expiration for added points. \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", + "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`.", + "example": "2020-05-30" + }, + "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." + } + } + }, + "8_res_add_remove_points_balance": { + "description": "Response schema for adding or removing points from a loyalty card.", + "type": "object", + "title": "Add or Remove Loyalty Card Balance Response Body", + "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", + "description": "The balance after adding/removing points." + }, + "type": { + "type": "string", + "description": "The type of voucher being modified.", + "default": "loyalty_card" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. Default is `balance`.", + "default": "balance" + }, + "related_object": { + "type": "object", + "description": "Defines the object that is being modified with the values that are returned in the balance object.", + "properties": { + "type": { + "type": "string", + "description": "The object being modified.", + "default": "voucher" + }, + "id": { + "type": "string", + "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API.", + "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + } + } + } + } + }, + "8_req_transfer_loyalty_points": { + "description": "Request body schema for transferring points from a loyalty card.", + "type": "array", + "title": "Transfer Loyalty Points Request Body", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source).", + "example": "L-CARD-02hgnq4" + }, + "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).", + "example": 2 + }, + "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." + } + } + } + }, + "8_req_redeem_reward": { + "description": "Request body schema for redeeming a reward.", + "type": "object", + "title": "Redeem Reward Request Body", + "properties": { + "reward": { + "type": "object", + "description": "Contains information about the reward that the customer wants to redeem and the number of points the customer is choosing to use for the reward if the reward is a pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID assigned by Voucherify. The reward must be assigned to the campaign in order for the user to be able to use the reward.", + "example": "rew_eSi4eYJk7o3tOycvweicR2z7" + }, + "points": { + "type": "integer", + "description": "The number of loyalty points that the user wants to spend in order to fulfill the order. The number of points cannot be higher than the current balance on the loyalty card." + } + } + }, + "order": { + "$ref": "#/components/schemas/8_req_order_object_redeem_reward", + "description": "Order object that is **required** when redeeming a pay with points reward." + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + } + } + }, + "8_req_order_object_redeem_reward": { + "type": "object", + "title": "Order object", + "description": "Request body schema for creating an order, **required** when redeeming a pay with points reward.", + "properties": { + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + } + } + }, + "8_res_redeem_reward": { + "description": "Response body schema for redeeming a reward.", + "title": "Redeem Reward Response Body", + "$ref": "#/components/schemas/8_obj_redemption_object_loyalty_card_extended" + }, + "8_obj_redemption_object_loyalty_card_extended": { + "type": "object", + "title": "Loyalty Card Voucher", + "description": "This is an object representing a redemption. \n\nRedemption is the key operation in the voucher lifecycle. A customer can redeem a voucher once or multiple times depending on selected limit (`quantity`). Each redemption is recorded in voucher/promotion's history (`redemption_entries`). There is also an option to cancel a redemption. We call such operation a [redemption rollback](rollback-redemption).", + "properties": { + "id": { + "type": "string", + "example": "r_0bc92f81a6801f9bca", + "description": "Unique redemption ID." + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the redemption.", + "default": "redemption" + }, + "date": { + "type": "string", + "format": "date-time", + "example": "2022-10-03T12:24:58.008Z", + "description": "Timestamp in ISO 8601 format indicating when the redemption occured." + }, + "customer_id": { + "type": "string", + "example": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "description": "Unique customer ID of the redeeming customer." + }, + "tracking_id": { + "type": "string", + "example": "track_fxEMFiLowFHg==", + "description": "Hashed customer source ID." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes in the form of key/value pairs assigned to the redemption." + }, + "amount": { + "type": "integer", + "description": "Number of points being redeemed for a reward." + }, + "result": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ], + "description": "Redemption result." + }, + "order": { + "description": "Defines the details of the order that is related to the redemption.", + "$ref": "#/components/schemas/7_obj_order_object" + }, + "customer": { + "type": "object", + "description": "Defines the customer redeeming the reward.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "source_id": { + "type": "string", + "description": "The merchant's customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the customer. A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format." + }, + "object": { + "type": "string", + "description": "Type of object represented is `customer`.", + "default": "customer" + } + } + }, + "related_object_type": { + "type": "string", + "description": "Defines the related object. i.e. `voucher`.", + "enum": [ + "voucher" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique related object ID assigned by Voucherify, i.e. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher." + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object", + "description": "Defines the details of the voucher being redeemed." + }, + "reward": { + "description": "Defines the reward being redeemed.", + "anyOf": [ + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_pay_with_points" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_product" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_material_sku" + }, + { + "$ref": "#/components/schemas/7_obj_redemption_object_loyalty_card_digital" + } + ] + }, + "loyalty_card": { + "type": "object", + "description": "Stores the number of points being subtracted from the loyalty card for the reward redemption.", + "properties": { + "points": { + "type": "integer", + "description": "Number of points being subtracted from the loyalty card for the reward redemption." + } + } + } + } + }, + "8_res_loyalties_campaign_id_tiers_tier_id_earning_rules": { + "type": "object", + "properties": { + "object": { + "type": "string" + }, + "data_ref": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" }, "created_at": { - "type": "string", - "example": "2022-03-23T07:44:00.444Z", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "format": "date-time" + "type": "string" }, "updated_at": { - "type": "string", - "example": "2022-04-26T08:35:54.960Z", - "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "basic", - "advanced", - "complex" - ], - "description": "Type of validation rule." - }, - "context_type": { - "type": "string", - "enum": [ - "earning_rule.order.paid", - "earning_rule.custom_event", - "earning_rule.customer.segment.entered", - "campaign.discount_coupons", - "campaign.discount_coupons.discount.apply_to_order", - "campaign.discount_coupons.discount.apply_to_items", - "campaign.discount_coupons.discount.apply_to_items_proportionally", - "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", - "campaign.discount_coupons.discount.fixed.apply_to_items", - "campaign.gift_vouchers", - "campaign.gift_vouchers.gift.apply_to_order", - "campaign.gift_vouchers.gift.apply_to_items", - "campaign.referral_program", - "campaign.referral_program.discount.apply_to_order", - "campaign.referral_program.discount.apply_to_items", - "campaign.referral_program.discount.apply_to_items_proportionally", - "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", - "campaign.referral_program.discount.fixed.apply_to_items", - "campaign.promotion", - "campaign.promotion.discount.apply_to_order", - "campaign.promotion.discount.apply_to_items", - "campaign.promotion.discount.apply_to_items_proportionally", - "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", - "campaign.promotion.discount.fixed.apply_to_items", - "campaign.loyalty_program", - "campaign.lucky_draw", - "voucher.discount_voucher", - "voucher.discount_voucher.discount.apply_to_order", - "voucher.discount_voucher.discount.apply_to_items", - "voucher.discount_voucher.discount.apply_to_items_proportionally", - "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", - "voucher.discount_voucher.discount.fixed.apply_to_items", - "voucher.gift_voucher", - "voucher.gift_voucher.gift.apply_to_order", - "voucher.gift_voucher.gift.apply_to_items", - "voucher.loyalty_card", - "voucher.lucky_draw_code", - "distribution.custom_event", - "reward_assignment.pay_with_points", - "global" - ], - "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + "type": "null" }, - "object": { - "type": "string", - "default": "validation_rules", - "description": "The type of object represented by JSON. This object stores information about the validation rule." - } - } - }, - "13_req_create_validation_rule": { - "title": "Create Validation Rule Request Body", - "type": "object", - "description": "Request body schema for **POST** `/validation-rules`.", - "properties": { - "name": { - "type": "string", - "description": "Custom, unique name for the set of validation rules.", - "example": "Business Validation Rule" + "validation_rule_id": { + "type": "null" }, - "rules": { + "loyalty": { "type": "object", - "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", "properties": { - "1": { - "type": "object", - "description": "Defines the rule.", - "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n| **Name** |\n|:---|\n| **Customer** |\n| customer.segment
                  customer.metadata* |\n| **Order** |\n| order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** |\n| campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |\n| redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** |\n| product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** |\n| sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** |\n| publication.redeemable_by_linked_customer |\n| **Custom Event** |\n| custom_event.metadata* |\n| **Order items** |\n| order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive |\n| order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n*Requires the `property` field to be defined." - }, - "property": { - "type": [ - "string", - "null" - ], - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" - }, - "conditions": { - "type": "object", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", - "properties": { - "$one_of_voucherify_conditions": { - "type": "array", - "description": "Contains a set of conditions for the rule.", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] - } - } - } - }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } - } - }, - "logic": { - "type": "string" - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." - } - } - } - } + "points": { + "type": "integer" }, - "logic": { - "type": "string", - "example": "(1 and 2) and (3)", - "description": "Defines the logic between the rules." + "type": { + "type": "string" } } }, - "error": { + "event": { + "type": "string" + }, + "source": { "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + "banner": { + "type": "string" + }, + "object_id": { + "type": "string" + }, + "object_type": { + "type": "string" } } }, - "applicable_to": { + "active": { + "type": "boolean" + }, + "object": { + "type": "string" + }, + "automation_id": { + "type": "string" + }, + "custom_event": { "type": "object", "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { - "type": "object", - "description": "Defines the excluded item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." - } - } - } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { - "type": "object", - "description": "Defines the included item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." - } - } - } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." + "schema_id": { + "type": "string" } } } } - }, - "13_res_list_validation_rules": { - "description": "Response body schema for listing validation rules. \n\nThis entity stores the [validation rules](ref:get-validation-rule) used to limit your resources.", - "type": "object", - "title": "List Validation Rules Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about validation rules.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of validation rules.", - "default": "data" - }, - "data": { - "type": "array", - "uniqueItems": true, - "description": "An array of validation rules.", - "items": { - "type": "object", - "description": "Stores information about the validation rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique validation rule ID.", - "example": "val_F4Artfc4HQIq" - }, - "name": { - "type": "string", - "description": "Custom, unique name for the set of validation rules." - }, - "rules": { - "type": "object", - "description": "A set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the rule.", - "properties": { - "name": { - "type": "string", - "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
                  customer.metadata* \n**Order** |order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** | sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive | order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n*Requires the `property` field to be defined." - }, - "rules": { - "type": "object", - "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", - "properties": { - "1": { - "type": "object", - "description": "Defines the nested rule.", - "properties": { - "name": { - "type": "string" - }, - "property": { - "type": "string" - }, - "conditions": { - "type": "object" - }, - "rules": { - "type": "object" - } - } - }, - "logic": { - "type": "string" - } - } - }, - "property": { - "type": "string", - "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" - }, - "conditions": { - "type": "array", - "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", - "items": { - "type": [ - "string", - "integer", - "boolean" - ] - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." - } - } - } - } - }, - "logic": { - "type": "string", - "description": "Defines the logic between the rules.", - "example": "(1 and 2) and (3)" - } - } - }, - "error": { - "type": "object", - "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", - "properties": { - "message": { - "type": "string", - "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." - } - } - }, - "applicable_to": { - "type": "object", - "properties": { - "excluded": { - "type": "array", - "description": "Defines which items are excluded from a discount.", - "items": { - "type": "object", - "description": "Defines the excluded item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being excluded from the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY" - ], - "description": "Discount effect for an excluded resource." - } - } - } - }, - "included": { - "type": "array", - "description": "Defines which items are included in a discount.", - "items": { - "type": "object", - "description": "Defines the included item.", - "properties": { - "object": { - "type": "string", - "enum": [ - "product", - "sku", - "products_collection" - ], - "description": "The type of object being included in the rule." - }, - "id": { - "type": "string", - "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." - }, - "source_id": { - "type": "string" - }, - "strict": { - "type": "boolean" - }, - "effect": { - "type": "string", - "enum": [ - "APPLY_TO_EVERY", - "APPLY_TO_CHEAPEST", - "APPLY_TO_MOST_EXPENSIVE" - ], - "description": "Discount effect for an included resource." - }, - "quantity_limit": { - "type": "integer", - "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." - } - } - } - }, - "included_all": { - "type": "boolean", - "description": "Indicates whether all items are included in the discount." - } - } - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", - "example": "2022-04-07T07:42:44.442Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-05-09T07:42:44.442Z", - "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "basic", - "advanced", - "complex" - ], - "description": "Type of validation rule." - }, - "context_type": { - "type": "string", - "enum": [ - "earning_rule.order.paid", - "earning_rule.custom_event", - "earning_rule.customer.segment.entered", - "campaign.discount_coupons", - "campaign.discount_coupons.discount.apply_to_order", - "campaign.discount_coupons.discount.apply_to_items", - "campaign.discount_coupons.discount.apply_to_items_proportionally", - "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", - "campaign.discount_coupons.discount.fixed.apply_to_items", - "campaign.gift_vouchers", - "campaign.gift_vouchers.gift.apply_to_order", - "campaign.gift_vouchers.gift.apply_to_items", - "campaign.referral_program", - "campaign.referral_program.discount.apply_to_order", - "campaign.referral_program.discount.apply_to_items", - "campaign.referral_program.discount.apply_to_items_proportionally", - "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", - "campaign.referral_program.discount.fixed.apply_to_items", - "campaign.promotion", - "campaign.promotion.discount.apply_to_order", - "campaign.promotion.discount.apply_to_items", - "campaign.promotion.discount.apply_to_items_proportionally", - "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", - "campaign.promotion.discount.fixed.apply_to_items", - "campaign.loyalty_program", - "campaign.lucky_draw", - "voucher.discount_voucher", - "voucher.discount_voucher.discount.apply_to_order", - "voucher.discount_voucher.discount.apply_to_items", - "voucher.discount_voucher.discount.apply_to_items_proportionally", - "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", - "voucher.discount_voucher.discount.fixed.apply_to_items", - "voucher.gift_voucher", - "voucher.gift_voucher.gift.apply_to_order", - "voucher.gift_voucher.gift.apply_to_items", - "voucher.loyalty_card", - "voucher.lucky_draw_code", - "distribution.custom_event", - "reward_assignment.pay_with_points", - "global" - ], - "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" - }, - "assignments_count": { - "description": "The number of instances the validation rule has been assigned to different types of redeemables.", - "type": "integer" - }, - "object": { - "type": "string", - "default": "validation_rules", - "description": "The type of object represented by each nested object in the JSON `data` array. This object stores information about the validation rules." - } - } + } + }, + "total": { + "type": "integer" + } + }, + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", + "title": "List Loyalty Tier Earning Rules" + }, + "8_res_loyalties_campaign_id_tiers_tier_id_rewards": { + "title": "List Loyalty Tier Rewards", + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`." + }, + "8_res_loyalties_campaign_id_reward-assignments_assignment_id": { + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}`", + "title": "Get Reward Assignment", + "properties": { + "id": { + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" + }, + "reward_id": { + "type": "string", + "example": "rew_JhjeISE1npQyxRmGV1JYohDP" + }, + "related_object_id": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "related_object_type": { + "type": "string", + "example": "campaign" + }, + "created_at": { + "type": "string", + "example": "2021-12-13T11:58:32.261Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-01-13T11:58:32.261Z", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "reward_assignment" + } + } + }, + "8_res_loyalties_campaign_id_reward-assignments_assignment_id_reward": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "parameters": { + "type": "object", + "properties": { + "coin": { + "type": "object", + "properties": { + "exchange_ratio": { + "type": "number" + }, + "points_ratio": { + "type": "integer" } - }, - "total": { - "type": "integer", - "description": "Total number of validation rules in the project." } } - }, - "13_obj_validation_rule_assignment_object": { - "title": "Validation Rule Assignment Object", - "type": "object", - "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", - "x-tags": [ - "VALIDATION RULES API" - ], - "properties": { - "id": { - "type": "string", - "example": "asgm_74F7QZoYbUoljwQO", - "description": "Validation rule assignment ID." - }, - "rule_id": { - "type": "string", - "example": "val_4j7DCRm2IS59", - "description": "Validation rule ID." - }, - "related_object_id": { - "type": "string", - "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", - "description": "The resource ID to which the validation rule was assigned." - }, - "related_object_type": { - "type": "string", - "description": "The type of resource to which the validation rule was assigned.", - "enum": [ - "voucher", - "campaign", - "earning_rule", - "reward_assignment", - "promotion_tier", - "distribution" - ] - }, - "created_at": { - "type": "string", - "example": "2022-02-17T08:18:15.085Z", - "description": "Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "validation_rules_assignment", - "description": "The type of object represented by the ID." + } + }, + "stock": { + "type": "null" + }, + "redeemed": { + "type": "null" + }, + "attributes": { + "type": "object", + "properties": {} + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "null", + "format": "date-time" + }, + "object": { + "type": "string" + } + }, + "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}/`", + "title": "Get Reward Details" + }, + "8_obj_export_object_points_expiration": { + "title": "Points Expirations Export Object", + "type": "object", + "description": "This is an object representing an export of points expirations. ", + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the export." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Status of the export. Informs you whether the export has already been completed.", + "enum": [ + "SCHEDULED", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "enum": [ + "API", + "WEBSITE" + ] + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "enum": [ + "points_expiration" + ] + }, + "parameters": { + "type": "object", + "description": "List of fields and filters that were passed in the request body to create the export.", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combination of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" } - } - }, - "13_res_validation-rules_validationRuleId_assignments": { - "type": "object", - "description": "Validation Rule Assignments", - "title": "Validation Rule Assignments", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about validation rule assignments.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of validation rule assignments.", - "items": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_filter_campaign_id" + }, + { + "$ref": "#/components/schemas/8_req_filter_voucher_id" } - }, - "total": { - "type": "integer", - "description": "Total number of validation rule assignments." + ] + } + } + }, + "result": { + "type": "object", + "description": "Contains the URL of the CSV file.", + "properties": { + "url": { + "type": "string", + "description": "URL of the CSV file location." + } + } + }, + "user_id": { + "type": "string", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0Fr", + "description": " The user_id identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`." + } + } + }, + "8_req_export_points_expirations": { + "title": "Points Expirations Export Request Body", + "type": "object", + "description": "Request body schema for creating points expirations. ", + "properties": { + "parameters": { + "type": "object", + "description": "List of fields and filters that were passed in the request body to create the export.", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export.", + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_filter_campaign_id" + }, + { + "$ref": "#/components/schemas/8_req_filter_voucher_id" + } + ] } - }, - "13_req_create_validation_rule_assignments": { - "description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.", - "title": "Create Validation Rule Assignments Request Body", - "oneOf": [ - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_voucher" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_campaign" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_promotion_tier" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_earning_rule" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_reward" - }, - { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_distribution" + } + } + } + }, + "8_req_filter_campaign_id": { + "title": "Filter by campaign ID", + "type": "object", + "description": "Filter conditions set on the campaign ID.", + "properties": { + "campaign_id": { + "$ref": "#/components/schemas/8_req_filter_conditions" + }, + "junction": { + "type": "string", + "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.", + "enum": [ + "AND", + "OR" + ] + } + } + }, + "8_req_filter_voucher_id": { + "title": "Filter by voucher ID", + "type": "object", + "description": "Filter conditions set on the voucher ID.", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/8_req_filter_conditions" + }, + "junction": { + "type": "string", + "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.", + "enum": [ + "AND", + "OR" + ] + } + } + }, + "8_req_filter_junction": { + "title": "Filter by campaign ID", + "type": "object", + "description": "Filter conditions by campaign ID.", + "properties": { + "junction": { + "type": "string", + "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." + } + } + }, + "8_req_filter_conditions": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results.", + "items": { + "type": "string" } - ] - }, - "13_req_create_validation_rule_assignments_voucher": { - "type": "object", - "description": "Assign a validation rule to a voucher.", - "title": "Voucher", - "properties": { - "voucher": { - "type": "string", - "description": "Unique voucher ID or code to which you would like to assign the validation rule to.", - "example": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results.", + "items": { + "type": "string" } + }, + "$is": { + "type": "string", + "description": "Specify the exact resource value." + }, + "$is_not": { + "type": "string", + "description": "Results should omit this value." } + } + } + } + }, + "8_res_list_reward_assignments": { + "title": "List Reward Assignments", + "type": "object", + "description": "Response body schema for **GET** `/loyalties/{campaignId}/rewards`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty reward assignments in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of reward assignment objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of reward assignment objects.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of reward assignment objects." + } + } + }, + "8_res_list_loyalty_tiers": { + "title": "List Loyalty Tiers", + "type": "object", + "description": "Response body schema for listing loyalty tiers for a campaign using **GET** `/loyalties/{campaignId}/tiers`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + } + }, + "8_res_get_member_loyalty_tier": { + "title": "Get Member's Loyalty Tier Response Body", + "type": "object", + "description": "Response body schema for retrieving a member's loyalty tier for a campaign using **GET** `/loyalties/members/{memberId}/tiers`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object_member" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tiers." + } + } + }, + "8_req_create_reward_assignment": { + "title": "Create Reward Assignment Request Body", + "type": "array", + "description": "Request body schema for **POST** `/loyalties/{campaignId}/rewards`.", + "items": { + "type": "object", + "properties": { + "reward": { + "type": "string", + "example": "rew_2yGflHThU2yJwFECEFKrXBI2", + "description": "Unique reward ID." }, - "13_req_create_validation_rule_assignments_campaign": { + "parameters": { "type": "object", - "description": "Assign a validation rule to a campaign.", - "title": "Campaign", + "description": "An object that defines the price of the reward in loyalty points.", "properties": { - "campaign": { - "type": "string", - "description": "Unique campaign ID or name to which you would like to assign the validation rule to.", - "example": "camp_HXsR22VUMC4hN4DR7eAhCalp" + "loyalty": { + "type": "object", + "description": "Stores the points parameter.", + "properties": { + "points": { + "type": "integer", + "description": "Defines how many points are required to obtain the reward." + } + } } } - }, - "13_req_create_validation_rule_assignments_promotion_tier": { - "type": "object", - "description": "Assign a validation rule to a promotion tier.", - "title": "Promotion Tier", - "properties": { - "promotion_tier": { - "type": "string", - "description": "Unique promotion tier ID to which you would like to assign the validation rule to.", - "example": "promo_Vet0vCNyyo5pOddHfu2X3FCB" + } + } + } + }, + "8_res_create_reward_assignment": { + "title": "Create Reward Assignment Response Body", + "type": "array", + "description": "Response body schema for **POST** `/loyalties/{campaignId}/rewards`.", + "items": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + }, + "8_req_update_reward_assignment": { + "title": "Update Reward Assignment Request Body", + "type": "object", + "description": "Request body schema for **PUT** `/loyalties/{campaignId}/rewards/{assignmentId}`.", + "properties": { + "parameters": { + "type": "object", + "description": "An object that defines the price of the reward in loyalty points.", + "properties": { + "loyalty": { + "type": "object", + "description": "Stores the points parameter.", + "properties": { + "points": { + "type": "integer", + "description": "Defines how many points are required to obtain the reward." + } } } - }, - "13_req_create_validation_rule_assignments_earning_rule": { - "type": "object", - "description": "Assign a validation rule to an earning rule.", - "title": "Earning Rule", - "properties": { - "earning_rule": { - "type": "string", - "description": "Unique earning rule ID to which you would like to assign the validation rule to.", - "example": "ern_CfvQ4vWEKD4kHTxghdY8YJGs" - } + } + } + } + }, + "8_res_list_loyalty_tier_earning_rules": { + "title": "List Loyalty Tier Earning Rules", + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about loyalty tier earning rules in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty tier earning rule objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier earning rules.", + "items": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + } + }, + "8_res_list_loyalty_tier_rewards": { + "title": "List Loyalty Tier Rewards", + "type": "object", + "description": "Response schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty tier rewards in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty tier reward objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty tier reward objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier reward objects." + } + } + }, + "8_res_list_members": { + "title": "List Members", + "type": "object", + "description": "Response body schema for **GET** `/loyalties/{campaignId}/members`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about members in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "vouchers", + "description": "Identifies the name of the attribute that contains the array of voucher objects." + }, + "vouchers": { + "type": "array", + "description": "Contains array of voucher objects representing loyalty cards, in other words, loyalty program members.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } + }, + "total": { + "type": "integer", + "description": "Total number of voucher objects." + } + } + }, + "8_req_add_member": { + "title": "Add Member Request Body", + "type": "object", + "description": "Request body schema for assigning a loyalty card to a customer using **POST** `/loyalties/{campaignId}/members`.", + "properties": { + "voucher": { + "type": "string", + "description": "Specify the loyalty card code that you would like to publish to a customer." + }, + "channel": { + "type": "string", + "description": "Specify the distribution channel." + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/8_req_customer_id_string" + }, + { + "$ref": "#/components/schemas/8_req_customer_id" + }, + { + "$ref": "#/components/schemas/8_req_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "13_req_create_validation_rule_assignments_reward": { - "type": "object", - "description": "Assign a validation rule to a reward.", - "title": "Reward", - "properties": { - "related_object_id": { - "type": "string", - "description": "Unique reward assignment ID, i.e. rewa_6VSWcXjfm5PuZlfeuZxl5JZT. This is the first parameter to be sent for a validation rule assignment to be assigned to a reward assignment. The prerequisites for assigning a validation rule to a reward assignment are: \n1. Define a loyalty campaign. \n2. Connect a reward with the campaign. \n3. Retrieve a reward assignment ID for the reward assigned to the loyalty campaign. \n4. And finally you can use this endpoint to assign a validation rule to the particular reward assignment.", - "example": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT" + ], + "description": "Customer's information." + }, + "metadata": { + "type": "string", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format." + } + } + }, + "8_req_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer." + } + } + }, + "8_req_customer_id_string": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify or the source ID.", + "type": "string" + }, + "8_req_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } + } + }, + "8_res_get_member_activities": { + "title": "Get Member Activities", + "type": "object", + "description": "Response body schema for retrieving member activities.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about member activities in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "activities", + "description": "Identifies the name of the attribute that contains the array of event objects." + }, + "activities": { + "type": "array", + "description": "Contains array of event objects.", + "items": {} + }, + "total": { + "type": "integer", + "description": "Total number of event objects." + } + } + }, + "8_res_list_member_rewards": { + "title": "List Member Rewards", + "type": "object", + "description": "Response body schema for `/loyalties/members/{memberId}/rewards`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about member rewards in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of loyalty reward objects." + }, + "data": { + "type": "array", + "description": "Contains array of loyalty reward objects.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_reward_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty reward objects." + } + } + }, + "8_res_get_points_expiration": { + "title": "Get Points Expiration Response Body", + "type": "object", + "description": "Response body schema for `/loyalties/{campaignId}/members/{memberId}/points-expiration`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Contains array of loyalty points expiration buckets.", + "items": { + "$ref": "#/components/schemas/8_obj_loyalty_points_bucket" + } + }, + "total": { + "type": "integer", + "description": "Total number of point expiration buckets." + } + } + }, + "9_req_create_customer": { + "type": "object", + "title": "Customer", + "description": "This is an object containing information about the customer.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service. \n\nPlease note that if you would like your data to sync based on the `source_id` of the customer, you need to define the `source_id` upfront. You will not be able to change or update the `source_id` later on." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number. This parameter is mandatory when you try to send out codes to customers via an SMS channel." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } + } + }, + "9_req_update_customer": { + "type": "object", + "title": "Customer object", + "description": "This is an object containing information about the customer.", + "properties": { + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } + } + }, + "9_obj_customer_object": { + "type": "object", + "description": "This is an object representing a customer. \n\nThis entity allows you to:\n* store customer details in Voucherify\n* link [redemptions](ref:list-redemptions) and [validations](ref:validate-voucher) to a particular customer\n* build customer segments and use them in validation rules. ", + "title": "Customer Object", + "examples": [ + { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", + "source_id": "08dd9b5a", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "address": { + "city": "New York", + "state": "NY", + "line_1": "678 Main St", + "line_2": null, + "country": "USA", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 5, + "total_failed": 0, + "total_succeeded": 5, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 }, - "related_object_type": { - "type": "string", - "description": "This is the second parameter that needs to be sent in order to properly assign a validation rule to a reward assignment.", - "example": "reward_assignment", - "default": "reward_assignment", - "enum": [ - "reward_assignment" - ] + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 830 } + }, + "orders": { + "total_amount": 94600, + "total_count": 5, + "average_amount": 18920, + "last_order_amount": 27500, + "last_order_date": "2022-09-15T11:11:36.630Z" } }, - "13_req_create_validation_rule_assignments_distribution": { - "type": "object", - "description": "Assign a validation rule to a distribution.", - "title": "Distribution", - "properties": { - "distribution": { - "type": "string", - "description": "Unique distribution ID to which you would like to assign the validation rule to.", - "example": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + "loyalty": { + "points": 830, + "referred_customers": 0, + "campaigns": { + "Loyalty Campaign - Webinar": { + "points": 830, + "referred_customers": 0 } } }, - "14_obj_segment_object": { - "title": "Customer Segment Object", - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "seg_1wc52c5z6r1kQ81brO8j9Hk2", - "description": "Unique segment ID." - }, - "name": { - "type": "string", - "description": "Segment name." - }, - "created_at": { - "type": "string", - "example": "2022-05-12T13:01:56.896Z", - "description": "Timestamp representing the date and time when the segment was created in ISO 8601 format.", - "format": "date-time" - }, - "type": { - "type": "string", - "enum": [ - "auto-update", - "static" - ], - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers)." - }, - "filter": { - "type": [ - "object", - "null" - ], - "description": "Defines a set of criteria for an `auto-update` segment type. " - }, - "initial_sync_status": { - "type": "string", - "enum": [ - "IN_PROGRESS", - "DONE" - ] - }, - "object": { - "type": "string", - "default": "segment", - "description": "The type of object represented by JSON. This object stores information about the customer segment." - } - }, - "description": "This is an object representing a customer segment.", - "x-tags": [ - "SEGMENTS API" - ] + "referrals": { + "total": 0, + "campaigns": [] }, - "14_req_create_segment": { - "title": "Create Customer Segment Request Body", - "description": "Request body schema for **POST** `/segments`.", - "oneOf": [ - { - "$ref": "#/components/schemas/14_req_create_segment_static" - }, - { - "$ref": "#/components/schemas/14_req_create_segment_dynamic" - } - ] + "metadata": { + "age": 24, + "loyalty_customer": "true", + "acquisition_channel": "Facebook" }, - "14_req_create_segment_static": { - "title": "Static Customer Segment", - "type": "object", - "description": "Request body schema for creating a static customer segment in **POST** `/segments`.", - "properties": { - "name": { - "type": "string", - "description": "Segment name." - }, - "type": { - "type": "string", - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", - "default": "static" - }, - "customers": { - "type": "array", - "description": "Array of customer IDs.", - "items": {} + "system_metadata": { + "consents": { + "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { + "date": "2022-11-22T15:48:50.219Z", + "value": true } } }, - "14_req_create_segment_dynamic": { - "title": "Dynamic Customer Segment", - "type": "object", - "description": "Request body schema for creating a dynamic customer segment in **POST** `/segments`.", - "properties": { - "name": { - "type": "string", - "description": "Segment name." - }, - "type": { - "type": "string", - "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", - "default": "auto-update" - }, - "filter": { - "type": "object", - "description": "Defines a set of criteria for an `auto-update` segment type." + "created_at": "2022-09-15T10:33:46.388Z", + "updated_at": "2022-11-22T15:48:50.220Z", + "assets": { + "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" + }, + "object": "customer" + } + ], + "x-tags": [ + "CUSTOMERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_CSnYd37MXmrbS19XCrghjBsv" + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It is externally defined. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate." + }, + "birthday": { + "type": "string", + "description": "Customer's birthday." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "summary": { + "type": "object", + "description": "Contains a summary of customer's redemption and order statistics.", + "properties": { + "redemptions": { + "type": "object", + "description": "Customer's redemptions statistics.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Total number of redemptions made by the customer." + }, + "total_failed": { + "type": "integer", + "description": "Total number of redemptions that failed." + }, + "total_succeeded": { + "type": "integer", + "description": "Total number of redemptions that succeeded." + }, + "total_rolled_back": { + "type": "integer", + "description": "Total number of redemptions that were rolled back for the customer." + }, + "total_rollback_failed": { + "type": "integer", + "description": "Total number of redemption rollbacks that failed." + }, + "total_rollback_succeeded": { + "type": "integer", + "description": "Total number of redemption rollbacks that succeeded." + }, + "gift": { + "type": "object", + "description": "Summary of gift card credits.", + "properties": { + "redeemed_amount": { + "type": "integer", + "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "amount_to_go": { + "type": "integer", + "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "loyalty_card": { + "type": "object", + "description": "Summary of loyalty points.", + "properties": { + "redeemed_points": { + "type": "integer", + "description": "Total number of loyalty points redeemed by the customer." + }, + "points_to_go": { + "type": "integer", + "description": "Sum of remaining available point balance across all loyalty cards." + } + } + } + } + }, + "orders": { + "type": "object", + "description": "Customer's order statistics.", + "properties": { + "total_amount": { + "type": "integer", + "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "total_count": { + "type": "integer", + "description": "Total number of orders made by the customer." + }, + "average_amount": { + "type": "integer", + "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_amount": { + "type": "integer", + "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_date": { + "type": "string", + "format": "date-time", + "example": "2022-08-30T11:51:08.029Z", + "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." + } } } - }, - "14_res_customers_customerId_segments": { - "type": "object", - "title": "List Segments for Customer Response Body", - "description": "Response body schema for `/customers/{customerId}/segments`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about customer segments.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the JSON property that contains the array of segment IDs.", - "default": "data" - }, - "data": { - "type": "array", - "description": "A dictionary that contains an array of segment IDs and names.", - "items": { + } + }, + "loyalty": { + "type": "object", + "description": "Summary of customer's loyalty information.", + "properties": { + "points": { + "type": "integer", + "description": "Sum of remaining available point balance across all loyalty cards." + }, + "referred_customers": { + "type": "integer", + "description": "Total number of customers referred by the customer." + }, + "campaigns": { + "type": "object", + "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", + "properties": { + "campaign_name": { "type": "object", + "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", "properties": { - "id": { - "type": "string", - "description": "Unique segment ID.", - "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" + "points": { + "type": "integer", + "description": "Remaining point balance in campaign." }, - "name": { + "loyalty_tier": { "type": "string", - "description": "Segment name." + "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", + "description": "Customer's loyalty tier within the campaign." }, - "object": { - "type": "string", - "description": "The type of object represented by the ID.", - "default": "segment" + "referred_customers": { + "type": "integer", + "description": "Number of customers referred by the customer in campaign." } } } - }, - "total": { - "type": "integer", - "description": "Total number of segments the customer belongs to." } } - }, - "15_obj_event_object": { - "title": "Event Object", - "type": "object", - "description": "This is an object representing an event. \n\nVoucherify distinguishes two types of events - custom and internal. Both are presented in the same Event structure. \n\n## Custom Events\n\nCustom Events are actions taken by your customers. They’re best suited for tracking high-value customer interactions with your application. Logging a custom event can trigger any number of distributions, and enables the segmentation filters around the recency and frequency of that event.\n\nWith Custom Event metadata field, Voucherify allows you to set properties on custom events. These properties can then be used for further qualifying trigger conditions, increasing personalization in messaging, and generating more sophisticated analytics through raw data export.\n\nThe Custom Events are directly linked to the customers' resources from Voucherify. It means that each event gets a connection to a customer. \n\n\n> #### An example \n>\n> If an e-commerce application wanted to send a message to a user when he/she abandons their cart, the custom event could additionally improve its target audience and allow for increased distribution personalization by adding a Custom Event of the `value` of customers’ order.\n\n## Internal Voucherify Events \n\nMoreover, Events are our way of letting you know when something interesting happens in your project. When an interesting event occurs, we create a new Event object. For example, when a redemption succeeds, we create a `redemption.succeeded` event.\n\nNote that many API requests may cause multiple events to be created. For example, if you create a new redemption for a new customer not existing yet in Voucherify, you will receive both a `customer.created` event and a `redemption.succeeded` event.\n\nThe events occur when the state of another API resource changes and the state of that resource at the time of the change is embedded in the data field of the event. \n\n| **Types of internal events** |\n|:---|\n| **Campaign** |\n| campaign.validation_rules.created
                  campaign.created
                  campaign.disabled
                  campaign.export_mailchimp_scheduled
                  campaign.export_mailchimp_done
                  campaign.validation_rules.deleted
                  campaign.validation_rules.updated
                  campaign.updated
                  campaign.deleted
                  campaign.export_mailchimp_failed
                  campaign.enabled |\n| **Voucher** |\n| voucher.validation.succeeded
                  voucher.updated
                  voucher.enabled
                  voucher.gift.balance_added
                  voucher.validation_rules.updated
                  voucher.published
                  voucher.validation_rules.deleted
                  voucher.disabled
                  voucher.validation.failed
                  voucher.validation_rules.created
                  voucher.deleted
                  voucher.created |\n| **Redemption** |\n| redemption.succeeded
                  redemption.failed
                  redemption.rollback.failed
                  redemption.rollback.succeeded |\n| **Customer** |\n| customer.rewarded
                  customer.rewarded.loyalty_points
                  customer.sms.sent
                  customer.email.failed
                  customer.deleted
                  customer.created
                  customer.updated
                  customer.segment.left
                  customer.sms.failed
                  customer.segment.entered
                  customer.email.sent |\n| **Order** |\n| order.canceled
                  order.created
                  order.updated
                  order.paid |\n| **Product** |\n| product.updated
                  product.created
                  product.deleted |\n| **SKU** |\n| sku.updated
                  sku.created
                  sku.deleted |\n| **Distribution** |\n| distribution.sms.failed
                  distribution.sms.sent
                  distribution.email.sent
                  distribution.email.failed |\n| **Export** |\n| export.done
                  export.scheduled
                  export.failed
                  export.deleted | \n\n## Webhooks \n\nVoucherify also has a separate system for sending the event objects directly to an endpoint at your end (server). We called that mechanism webhooks. They are managed in your project settings. \n\n| **Attribute** | **Description** | **Example** |\n|:---|:---|:---|\n| `id`
                  string | | event_xjGas2mI2PduFFPL2NAcFeHkHfLn3H |\n| `object`
                  string | Type of the object represented by JSON. Value is `event`. | |\n| `created_at`
                  string, ISO 8601 date format | Time at which the object was created. | 2016-11-16T14:14:31Z |\n| `type`
                  string | Description of the event | view_pricing_page
                  redemption.succeeded |\n| `data.object`
                  object | The object containing data associated with the event. It can be a `customer`, `redemption` or any other type of object which is a source of the event. In this object structure, you can also find a property `related_object` which contains values presenting any other resource connected to the event.

                  For Custom Event the structure of child attributes is constant:

                  - customer (`object`) - The object presenting a profile of the related customer who performed an action.

                  - metadata (`object`) - A set of key/value pairs that you can attach to a custom event object. It can be useful for storing additional information about the event in a structured format. | \"data\": { \"object\": { \"customer\": { \"id\": \"cust_OtHDKrv5sJrjd8aYBYZ6AOIF\", \"name\": \"Gustav Purpleson\", \"object\": \"customer\", \"source_id\": \"gustav@purpleson.com\", \"created_at\": 1510834859417, \"updated_at\": 1510835106559 }, \"metadata\": { \"lang\": \"en\", \"test\": true, \"page\": \"http://main.io\" } } } |\n| `metadata`
                  object | A set of key/value pairs that Voucherify attaches to a custom event object. It is a set of additional system information about the event in a structured format. | |\n\n\n```json\n{\n \"id\": \"event_ehkvgZFgSePlb95SH3JJulkApy9Kg9\",\n \"object\": \"event\",\n \"created_at\": \"2017-11-16T14:45:34.181Z\",\n \"type\": \"redemption.succeeded\",\n \"data\": {\n \"object\": {\n \"id\": \"r_mist0IpebikTaRdxiOGI2IhL\",\n \"date\": \"2017-11-16T14:45:32.733Z\",\n \"order\": {\n \"id\": \"ord_AhDlR13vQE5ino95P2NIABBN\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"sku_id\": null,\n \"quantity\": 1,\n \"source_id\": null,\n \"product_id\": \"iphone8\"\n }\n ],\n \"amount\": 50000,\n \"object\": \"order\",\n \"status\": \"CREATED\",\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": null,\n \"referrer\": null,\n \"source_id\": null,\n \"created_at\": \"2017-11-16T14:45:32.023Z\",\n \"updated_at\": null,\n \"discount_amount\": 2000\n },\n \"object\": \"redemption\",\n \"result\": \"SUCCESS\",\n \"voucher\": {\n \"code\": \"2017-goX-aH\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"object\": \"voucher\",\n \"campaign\": \"SteffenTest\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 2000\n },\n \"is_referral_code\": false\n },\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": {\n \"city\": \"London1\"\n },\n \"customer_id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"tracking_id\": \"track_3tM7KR57bbeIRtMcvpKYr2aAOrCpYBDZ\",\n \"related_object_type\": \"voucher\"\n },\n \"previous_attributes\": {}\n },\n \"metadata\": {\n \"source\": \"API\"\n }\n}\n```\n\n## Customisable Campaign Events \n\nAs part of campaign creation, users can configure webhooks triggered when specific activities appear within a campaign's lifetime. Those webhooks get configurable names and the users implement them in Voucherify Dashboard as part of the campaign creation process.\n\nThis type of webhooks can be configured for the following actions: \n\n| **Action** |\n|:---|\n| **Referral Program** |\n| Referrer rewarded
                  Referral code assigned
                  Customer referred |\n| **Loyalty Campaign** |\n| Loyalty card assigned
                  Points earned
                  Points redeemed | \n\nPayloads of customizable webhooks:\n\n### Referral Program\n\n\n```json\n{\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:09:57.765Z\",\n \"type\": \"referral_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"is_referral_code\": true,\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 1,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:00:08.306Z\",\n \"updated_at\": \"2021-11-12T11:09:40.671Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null,\n \"last_order_date\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:09:57.749Z\",\n \"updated_at\": \"2021-11-12T11:09:58.620Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null,\n \"value\": \"$10.00\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:09:57.765Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:49.723Z\",\n \"type\": \"referrer_rewarded_webhook\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/k\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1+tdyBGQeM+ZONM/k\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 1,\n \"campaigns\": {\n \"Referral Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 1\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:09:57.749Z\",\n \"updated_at\": \"2021-01-24T11:19:41.513Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_9Y7nwUx3BaU3cHqBVbd0TEtS2ENiFZhJ\",\n \"created_at\": \"2021-01-24T11:19:40.317Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"test_referrer__01\",\n \"metadata\": {},\n \"channel\": \"Automation\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"dOzJ84Ky\",\n \"vouchers\": [\n {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/kBdZ\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BtdyBGQeM%2BZONM%2FkBdZ\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\"\n ],\n \"campaign_name\": \"Bonus Cards\",\n \"gift\": {\n \"amount\": 0,\n \"balance\": 0\n },\n \"loyalty_card\": null,\n \"discount\": null,\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"is_referral_code\": true,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_Fuzc1rngCCuKRDfBXBjUwl5j\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-01-24T11:19:43.883Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"reward_assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"source_id\": \"event_0a26b3d269013fc79e\",\n \"source_type\": \"redemption_event\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"type\": \"GIFT_VOUCHER\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"object\": \"reward\",\n \"name\": \"Credits - 5$\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"reward_id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"related_object_id\": \"rrt_NWk1WYi1sZs3Epjvvd5a9JZx\",\n \"related_object_type\": \"referral_tier\",\n \"created_at\": \"2021-01-24T11:00:08.471Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"event_0a26b3d269013fc79e\",\n \"type\": \"redemption_event\"\n },\n \"balance\": {\n \"amount\": 500\n }\n },\n \"created_at\": \"2021-01-24T11:19:49.723Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:41.101Z\",\n \"type\": \"referee_invited\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": \"2021-01-24T11:09:40.671Z\",\n \"created_at\": \"2021-01-24T11:00:08.306Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"type\": \"customer.referred\",\n \"created_at\": \"2021-01-24T11:19:34.223Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {}\n },\n \"metadata_json\": {\n \"is_rewarded\": true,\n \"source\": null\n },\n \"automation_id\": null,\n \"group_id\": \"v-0a26b3d24b032c4871\"\n }\n },\n \"metadata\": {}\n}\n```\n\n### Loyalty Campaign \n\n\n```json\n{\n \"id\": \"evcus_0a26b89763051ed721\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"type\": \"loyalty_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 0,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:40:19.724Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"value\": 0\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b89763051ed721\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:40:18.125Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b9290fc4891587\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:42:51.380Z\",\n \"type\": \"points_earned\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 220\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": \"2021-11-12T11:42:50.332Z\",\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": {\n \"distr_naR4rx0AgM1baWZkFm1kfHn7A9\": {\n \"date\": \"2021-11-12T11:40:21.957Z\"\n },\n \"distr_pnfPKLDAxUpiPi3ZsuMrygtYNN\": {\n \"date\": \"2021-11-12T11:42:50.332Z\"\n }\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n }\n },\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": null,\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": null,\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 220\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 220,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 220,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:47.393Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b9290fc4891587\",\n \"type\": \"customer.rewarded.loyalty_points\",\n \"created_at\": \"2021-11-12T11:42:47.359Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:40.635Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n },\n \"balance\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n }\n },\n \"metadata_json\": {\n \"source\": \"Automation\"\n },\n \"automation_id\": \"auto_McXM3rjWcPwaNU5ndIIP13jX\",\n \"group_id\": \"v-0a26b921779d7eebcb\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json \n{\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:53:09.910Z\",\n \"type\": \"points_redeemed\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 1,\n \"total_failed\": 0,\n \"total_succeeded\": 1,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 218,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 218,\n \"referred_customers\": 0\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:53:07.582Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_aFszQ4kOtT1Hori8Wl1i0az1sFQN3CRv\",\n \"created_at\": \"2021-11-12T11:53:03.172Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"Loyal_customer__01\",\n \"metadata\": {},\n \"channel\": \"API\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"xUgBLQck\",\n \"vouchers\": [\n {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\"\n ],\n \"campaign_name\": \"20% discount\",\n \"gift\": null,\n \"loyalty_card\": null,\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 218\n },\n \"type\": \"LOYALTY_CARD\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_uATcoUjIp3VJNgT5TZT5NMaT\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-11-12T11:53:06.025Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"reward_assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"source_id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"source_type\": \"redemption\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"object\": \"reward\",\n \"name\": \"20% discount\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"reward_id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"related_object_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"related_object_type\": \"campaign\",\n \"parameters\": {\n \"loyalty\": {\n \"points\": 2\n }\n },\n \"created_at\": \"2021-11-12T11:39:05.504Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"type\": \"redemption\"\n },\n \"balance\": null\n },\n \"created_at\": \"2021-11-12T11:53:09.910Z\"\n }\n },\n \"metadata\": {}\n}\n```", - "x-tags": [ - "EVENTS API" - ] - }, - "15_req_track_custom_event": { - "title": "Track Custom Event Request Body", - "type": "object", - "description": "Request schema for tracking a custom event.", - "properties": { - "event": { - "type": "string", - "description": "Event name. This is the same name that you used to define a custom event in the **Dashboard** > **Project Settings** > **Event Schema**." - }, - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" - }, - { - "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "type": "object" - }, - "referral": { + } + }, + "referrals": { + "type": "object", + "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", + "properties": { + "total": { + "type": "integer", + "description": "Total number of times this customer received a referral, i.e. was referred by another customer." + }, + "campaigns": { + "type": "array", + "description": "Contains an array of campaigns that served as the source of a referral for the customer.", + "items": { "type": "object", - "description": "If a **conversion event** for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event. ", + "description": "Contains information about the source of the referral.", "properties": { - "code": { + "campaign_id": { "type": "string", - "description": "A code through which a new visitor has been referred to a service." + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_rRsfatlwN7unSeUIJDCYedal" }, "referrer_id": { "type": "string", - "description": "Unique ID of the referring person - it is optional and not required if the referral **code** is provided.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } - } - }, - "loyalty": { - "type": "object", - "description": "If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.", - "properties": { - "code": { + "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + }, + "related_object_id": { + "type": "string", + "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." + }, + "related_object_type": { + "type": "string", + "description": "Related object type, i.e. `redemption`." + }, + "date": { "type": "string", - "description": "Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the `event` parameter of the request payload gets sent along with this loyalty card code." + "format": "date-time", + "example": "2022-08-30T10:19:39.196Z", + "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." } } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the **Dashboard** > **Project Settings** > **Event Schema** > **Edit particular event** > **Metadata property definition**." - } - } - }, - "15_res_track_custom_event": { - "title": "Track Custom Event Request Body", - "type": "object", - "description": "Request schema for tracking a custom event.", - "properties": { - "object": { - "type": "string", - "default": "event", - "description": "The object represented is an `event`." - }, - "type": { - "type": "string", - "description": "The event name." - }, - "customer": { - "type": "object", - "description": "An empty customer object." - }, - "referral": { - "type": "null", - "description": "A `null` referral object." - }, - "loyalty": { - "type": "null", - "description": "A `null` loyalty object." } } - }, - "16_obj_export_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\nThe `/exports` endpoint allows you to retrieve Voucherify objects such as [vouchers](ref:get-voucher), [redemptions](ref:list-redemptions), [publications](ref:list-publications), [customers](ref:get-customer), and [orders](ref:get-order) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can [get](ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported and `filter` out the relevant data\n\n\n```json\n{\n \"fields\": [\n \"code\",\n \"voucher_type\"\n ],\n \"filters\": {\n \"categories\": {\n \"conditions\": {\n \"$in\": [\n \"postman\"\n ]\n }\n }\n }\n}\n```\n\n\n## Fields values\nHere is a list of the fields you can export for particular objects. \n| **Object** | **Fields** |\n|:---|:---|\n| voucher | 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
                  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
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| redemption | 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
                  metadata.X *where X is the name of a particular metadata property* |\n| publication | voucher_code
                  customer_id
                  customer_source_id
                  date
                  channel
                  campaign
                  is_winner
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| customer | 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
                  birthdate
                  birthday
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| order | id
                  source_id
                  status
                  created_at
                  updated_at
                  amount
                  discount_amount
                  items_discount_amount
                  total_discount_amount
                  total_amount
                  customer_id
                  referrer_id
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| points expiration | id
                  campaign_id
                  voucher_id
                  expires_at
                  status
                  points |\n\n\n## Pagination and example request\nVoucherify allows you to specify the timeframe for the records you want to retrieve. Thanks to this mechanism it should be easy to implement a pagination mechanism. See the example of request body: \n\n\n```json Export Redemption Example\n{\n \"exported_object\": \"redemption\",\n \"parameters\": {\n \"order\": \"-created_at\",\n \"fields\": [\n \"id\",\n \"object\",\n \"date\",\n \"voucher_code\",\n \"customer_id\",\n \"result\"\n ],\n \"filters\": {\n \"junction\": \"and\",\n \"created_at\": {\n \"conditions\": {\n \"$after\": [\n \"2018-05-30T22:00:00.000Z\"\n ],\n \"$before\": [\n \"2018-06-29T22:00:00.000Z\"\n ]\n }\n }\n }\n }\n}\n```\n\nAn export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "x-tags": [ - "EXPORTS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "enum": [ - "API", - "WEBSITE" - ] - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "enum": [ - "order", - "voucher", - "publication", - "redemption", - "customer", - "points_expiration", - "voucher_transactions" - ] - }, - "parameters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_export_order" - }, - { - "$ref": "#/components/schemas/16_obj_export_voucher" - }, - { - "$ref": "#/components/schemas/16_obj_export_publication" - }, - { - "$ref": "#/components/schemas/16_obj_export_redemption" - }, - { - "$ref": "#/components/schemas/16_obj_export_customer" - }, - { - "$ref": "#/components/schemas/16_obj_export_points_expiration" - }, - { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - } - ] - }, - "result": { - "type": "object", - "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](ref:download-export) method." + } + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "system_metadata": { + "type": "object", + "description": "Object used to store system metadata information.", + "properties": { + "consents": { + "type": "object", + "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", + "properties": { + "consentId": { + "type": "object", + "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", + "example": "2022-05-10T08:50:10.338Z", + "format": "date-time" + }, + "value": { + "type": "boolean", + "description": "Accepted: `true`, Rejected: `false`" + } } } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" } + }, + "source": { + "type": "string", + "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." } - }, - "16_res_list_exports": { - "description": "Response schema for listing exports.", - "type": "object", - "title": "List Exports Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about exports.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of exports.", - "default": "exports" - }, - "exports": { - "type": "array", - "uniqueItems": true, - "description": "An array of export objects.", - "items": { - "$ref": "#/components/schemas/16_obj_export_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of exports." - } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", + "example": "2022-08-30T06:32:07.380Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", + "example": "2022-08-31T06:32:07.380Z", + "format": "date-time" + }, + "assets": { + "type": "object", + "description": "Contains information about the customer's cockpit.", + "properties": { + "cockpit_url": { + "type": "string", + "description": "Customer's cockpit URL address." } - }, - "16_req_create_export_POST": { - "description": "Request schema for creating an export.", - "type": "object", - "title": "Create Export Request Body", - "properties": { - "exported_object": { - "type": "string", - "description": "The type of object to be exported.", - "enum": [ - "order", - "voucher", - "publication", - "redemption", - "customer", - "points_expiration", - "voucher_transactions" - ] + } + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the customer.", + "default": "customer" + } + } + }, + "9_obj_customer_object_email_parameter": { + "type": "object", + "description": "This is an object representing a customer.", + "title": "Customer Object", + "examples": [ + { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M", + "source_id": "08dd9b5a", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "address": { + "city": "New York", + "state": "NY", + "line_1": "678 Main St", + "line_2": null, + "country": "USA", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 5, + "total_failed": 0, + "total_succeeded": 5, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 }, - "parameters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_export_order" - }, - { - "$ref": "#/components/schemas/16_obj_export_voucher" - }, - { - "$ref": "#/components/schemas/16_obj_export_publication" - }, - { - "$ref": "#/components/schemas/16_obj_export_redemption" - }, - { - "$ref": "#/components/schemas/16_obj_export_customer" - }, - { - "$ref": "#/components/schemas/16_obj_export_points_expiration" - }, - { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - } - ] + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 830 } + }, + "orders": { + "total_amount": 94600, + "total_count": 5, + "average_amount": 18920, + "last_order_amount": 27500, + "last_order_date": "2022-09-15T11:11:36.630Z" } }, - "16_obj_export_order": { - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data.", - "title": "order", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at", - "updated_at", - "-updated_at", - "status", - "-status" - ] - }, - "fields": { - "type": "array", - "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" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |", - "items": { - "type": "string" - } - }, - "filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_order_status" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_source_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_total_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_discount_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_total_discount_amount" - }, - { - "$ref": "#/components/schemas/16_obj_filter_order_items_discount_amount" - } - ] + "loyalty": { + "points": 830, + "referred_customers": 0, + "campaigns": { + "Loyalty Campaign - Webinar": { + "points": 830, + "referred_customers": 0 } } }, - "16_obj_export_voucher": { - "description": "List of available fields and filters that can be exported with a voucher along with the sorting order of the returned data.", - "title": "voucher", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] - }, - "fields": { - "type": "array", - "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", - "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", - "metadata" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                  `GIFT_VOUCHER`: amount left to spend
                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| metadata | Returns all voucher metadata. | Response will include all voucher metadata. |\n| metadata.X | Where X is the name of a particular voucher metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |\n", - "items": { - "type": "string" - } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `categories`\n\n - `vouchers`\n\n - `type`\n\n - `holder_id`\n\n - `is_referral_code`\n\n - `published_for_customer_id`\n\n - `validity_timeframe`\n\n - `category_ids`" + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "age": 24, + "loyalty_customer": "true", + "acquisition_channel": "Facebook" + }, + "system_metadata": { + "consents": { + "cnst_lbgOBhHTuDrB7sjIhFjvIALj": { + "date": "2022-11-22T15:48:50.219Z", + "value": true } } }, - "16_obj_export_publication": { - "description": "List of available fields and filters that can be exported with a publication along with the sorting order of the returned data.", - "title": "publication", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at", - "channel", - "-channel" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "voucher_code", - "customer_id", - "customer_source_id", - "date", - "channel", - "campaign", - "is_winner", - "metadata" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Returns all publication metadata. | Response will include all publication metadata. |\n| metadata.X | Where X is the name of a particular publication metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" - } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `failure_code`\n\n - `result`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `voucher_type`\n\n - `is_referral_code`\n\n - `parent_object_id`\n\n - `related_object_id`\n\n - `source_id`", - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_publication_failure_code" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_result" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_customer_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_campaign_name" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_voucher_type" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_is_referral_code" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_parent_object_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_related_object_id" - }, - { - "$ref": "#/components/schemas/16_obj_filter_publication_source_id" + "created_at": "2022-09-15T10:33:46.388Z", + "updated_at": "2022-11-22T15:48:50.220Z", + "assets": { + "cockpit_url": "https://cockpits.voucherify.io/customers?token=U2FsdGVkX186yavyLJyykWa9KfhE1J850qWbQ1B%2BjKBZ0wrIzBNaW1WR6tNZo71Y5oTWG6PYpI9BpXDSnzz7CRfQ3lu7M151btz2vlYVxbd2eHNOjTFEwTbD8wK4moLONgtTlPM8ze42nmutFk5GUBepUEhxHRfbk8zekWqWvo8%2FbnAJsPl2rxYyaggwXQDj" + }, + "object": "customer" + } + ], + "x-tags": [ + "CUSTOMERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of a customer that is assigned by Voucherify.", + "example": "cust_CSnYd37MXmrbS19XCrghjBsv" + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate." + }, + "birthday": { + "type": "string", + "description": "Customer's birthday." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" + }, + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address." + }, + "line_2": { + "type": "string", + "description": "Second line of address." + }, + "country": { + "type": "string", + "description": "Country." + }, + "postal_code": { + "type": "string", + "description": "Postal code." + } + } + }, + "summary": { + "type": "object", + "description": "Contains a summary of customer's redemption and order statistics.", + "properties": { + "redemptions": { + "type": "object", + "description": "Customer's redemptions statistics.", + "properties": { + "total_redeemed": { + "type": "integer", + "description": "Total number of redemptions made by the customer." + }, + "total_failed": { + "type": "integer", + "description": "Total number of redemptions that failed." + }, + "total_succeeded": { + "type": "integer", + "description": "Total number of redemptions that succeeded." + }, + "total_rolled_back": { + "type": "integer", + "description": "Total number of redemptions that were rolled back for the customer." + }, + "total_rollback_failed": { + "type": "integer", + "description": "Total number of redemption rollbacks that failed." + }, + "total_rollback_succeeded": { + "type": "integer", + "description": "Total number of redemption rollbacks that succeeded." + }, + "gift": { + "type": "object", + "description": "Summary of gift card credits.", + "properties": { + "redeemed_amount": { + "type": "integer", + "description": "Total amount of gift card credits redeemed by customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "amount_to_go": { + "type": "integer", + "description": "Remaining gift card balance across all gift cards. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } } - ] + }, + "loyalty_card": { + "type": "object", + "description": "Summary of loyalty points.", + "properties": { + "redeemed_points": { + "type": "integer", + "description": "Total number of loyalty points redeemed by the customer." + }, + "points_to_go": { + "type": "integer", + "description": "Sum of remaining available point balance accross all loyalty cards." + } + } + } } - } - }, - "16_obj_export_redemption": { - "description": "List of available fields and filters that can be exported with a redemption along with the sorting order of the returned data.", - "title": "redemption", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at" - ] - }, - "fields": { - "type": "array", - "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" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Returns all redemption metadata. | Response will include all redemption metadata. |\n| metadata.X | Where X is the name of a particular redemption metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" + }, + "orders": { + "type": "object", + "description": "Customer's order statistics.", + "properties": { + "total_amount": { + "type": "integer", + "description": "The total amount spent by the customer. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "total_count": { + "type": "integer", + "description": "Total number of orders made by the customer." + }, + "average_amount": { + "type": "integer", + "description": "Average amount spent on orders. `total_amount` ÷ `total_count`. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_amount": { + "type": "integer", + "description": "Amount spent on last order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "last_order_date": { + "type": "string", + "example": "2022-08-30T11:51:08.029Z", + "description": "Timestamp representing the date and time of the customer's last order in ISO 8601 format." } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `voucher_code`\n\n - `related_object_id`\n\n - `related_object_parent_id`\n\n - `parent_redemption_id`\n\n - `failure_code`\n\n - `result`\n\n - `object`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `user_login`" } } - }, - "16_obj_export_customer": { - "description": "List of available fields and filters that can be exported with a customer along with the sorting order of the returned data.", - "title": "customer", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "name", - "-name", - "id", - "-id", - "email", - "-email", - "source_id", - "-source_id", - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "fields": { - "type": "array", - "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" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | |\n| loyalty_referred_customers | How many customers were referred by this customer. | |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| birthdate | Customer's birthdate. | 2022-04-29 |\n| metadata | Returns all customer metadata. | Response will include all customer metadata. |\n| metadata.X | Where X is the name of a particular customer metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", - "items": { - "type": "string" + } + }, + "loyalty": { + "type": "object", + "description": "Summary of customer's loyalty information.", + "properties": { + "points": { + "type": "integer" + }, + "referred_customers": { + "type": "integer", + "description": "Total number of customers referred by the customer." + }, + "campaigns": { + "type": "object", + "description": "Contains campaigns with details about point balances and how many customers were referred by the customer.", + "properties": { + "campaign_name": { + "type": "object", + "description": "Contains details about the point balances left on loyalty cards and the number of referred customers in each campaign.", + "properties": { + "points": { + "type": "integer", + "description": "Remaining point balance in campaign." + }, + "loyalty_tier": { + "type": "string", + "example": "ltr_UJ5Q54Q0OvEhua87Qfv2Ki5x", + "description": "Customer's loyalty tier within the campaign." + }, + "referred_customers": { + "type": "integer", + "description": "Number of customers referred by the customer in campaign." + } + } } - }, - "filters": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `name` (string)\n\n - `email` (string)\n\n - `phone` (string)\n\n - `metadata` (json)\n\n - `metadata.X` (?)\n\n - `address` (json)\n\n - `address.state` (string)\n\n - `address.country` (string)\n\n - `address.postal_code` (string)\n\n - `birthday` (string - date-time)\n\n - `birthdate` (string date-time)\n\n - `created_at` (date)\n\n - `source_id` (string)\n\n - `system.metadata` (json)\n\n - `system.metadata.source` (string)\n\n - `system.metadata.consents.unsubscribed` (boolean)\n\n - `loyalty_points` (json)\n\n - `loyalty` (json)\n\n - `summary.orders.total_amount` (json)\n\n - `summary.orders.last_order_date` (date)\n\n - `summary.orders.last_order_amount` (json)\n\n - `summary.redemptions.gift.redeemed_amount` (integer)\n\n - `summary.redemptions.total_succeeded` (integer)\n\n - `events.cart_abandoned.last_occurred` (integer)\n\n - `events.newsletter_subscribed.count` (integer)\n\n - `events.sign_up.last_occurred` (integer)" } } - }, - "16_obj_export_points_expiration": { - "description": "List of available fields and filters that can be exported with points expirations along with the sorting order of the returned data.", - "title": "points expiration", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "expires_at", - "-expires_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ] - ], - "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", - "items": { - "type": "string" - } - }, - "filters": { - "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `campaign_id`\n\n - `voucher_id`", - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_filter_points_expiration_campaign_id" + } + }, + "referrals": { + "type": "object", + "description": "Summary of customer's referrals, in this case, the customer being the referee, i.e. information about the source of referrals and number of times the customer was referred by other customers.", + "properties": { + "total": { + "type": "integer", + "description": "Total number of times this customer received a referral, i.e. was referred by another customer." + }, + "campaigns": { + "type": "array", + "description": "Contains an array of campaigns that served as the source of a referral for the customer.", + "items": { + "type": "object", + "description": "Contains information about the source of the referral.", + "properties": { + "campaign_id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_rRsfatlwN7unSeUIJDCYedal" }, - { - "$ref": "#/components/schemas/16_obj_filter_points_expiration_voucher_id" + "referrer_id": { + "type": "string", + "example": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "description": "Unique referrer ID, assigned by Voucherify. This is the customer ID of a customer that is referring this customer." + }, + "related_object_id": { + "type": "string", + "description": "Related object ID, i.e. `r_0b9d4cc4aa164dd073`." + }, + "related_object_type": { + "type": "string", + "description": "Related object type, i.e. `redemption`." + }, + "date": { + "type": "string", + "example": "2022-08-30T10:19:39.196Z", + "description": "Timestamp representing the date and time when the customer was referred in ISO 8601 format." } - ] - } - } - }, - "16_obj_export_gift_card_transactions": { - "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.", - "title": "gift card transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "items": { - "type": "string" } - }, - "filters": { - "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id" } } - }, - "16_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", - "title": "loyalty card transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" + } + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + }, + "system_metadata": { + "type": "object", + "description": "Object used to store system metadata information.", + "properties": { + "consents": { + "type": "object", + "description": "Stores a list of consent ID's along with the timestamp and decision on accepting or rejecting a marketing permission.", + "properties": { + "consentId": { + "type": "object", + "description": "Unique ID of a consent, i.e. `cnst_lbgOBhHTuDrB7sjIhFjvIALj`.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when a consent was accepted or rejected in ISO 8601 format.", + "example": "2022-05-10T08:50:10.338Z", + "format": "date-time" + }, + "value": { + "type": "boolean", + "description": "Accepted: `true`, Rejected: `false`" + } + } } - }, - "filters": { - "$ref": "#/components/schemas/16_obj_filter_loyalty_card_transactions_voucher_id" - } - } - }, - "16_obj_filter_publication_failure_code": { - "description": "Filter conditions set on the publication `failure_code`. Available options are:\n\n - `not_found`,\n\n - `no_voucher_suitable_for_publication`\n\n - `voucher_already_published`\n\n - `duplicate_source_id`\n\n - `too_many_vouchers_requested`", - "title": "Filter by failure code", - "type": "object", - "properties": { - "failure_code": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_result": { - "description": "Filter conditions set on the publication `result`. Available options are:\n\n - `SUCCESS`\n\n - `FAILURE`", - "title": "Filter by result", - "type": "object", - "properties": { - "result": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_customer_id": { - "description": "Filter conditions set on the publication `customer_id`.", - "title": "Filter by customer ID", - "type": "object", - "properties": { - "customer_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_campaign_name": { - "description": "Filter conditions set on the publication `campaign_name`.", - "title": "Filter by campaign name", - "type": "object", - "properties": { - "campaign_name": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_voucher_type": { - "description": "Filter conditions set on the publication `voucher_type`.", - "title": "Filter by voucher type", - "type": "object", - "properties": { - "voucher_type": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" } + }, + "source": { + "type": "string", + "description": "Takes on the name of the source of the integration if the customer was created through an integration, i.e. `Bigcommerce` or `Shopify`." } - }, - "16_obj_filter_publication_is_referral_code": { - "description": "Filter conditions set on the publication `is_referral_code`.", - "title": "Filter if the code is a referral code", - "type": "object", - "properties": { - "is_referral_code": { - "$ref": "#/components/schemas/16_filter_conditions_boolean" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer was created in ISO 8601 format.", + "example": "2022-08-30T06:32:07.380Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer was updated in ISO 8601 format.", + "example": "2022-08-31T06:32:07.380Z", + "format": "date-time" + }, + "assets": { + "type": "object", + "description": "Contains information about the customer's cockpit.", + "properties": { + "cockpit_url": { + "type": "string", + "description": "Customer's cockpit URL address." } - }, - "16_obj_filter_publication_parent_object_id": { - "description": "Filter conditions set on the publication `parent_object_id`, which is the parent campaigns unique ID assigned by Voucherify.", - "title": "Filter by parent object ID", - "type": "object", - "properties": { - "parent_object_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_related_object_id": { - "description": "Filter conditions set on the publication `related_object_id`.", - "title": "Filter by related object ID", - "type": "object", - "properties": { - "related_object_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_publication_source_id": { - "description": "Filter conditions set on the publication `source_id`.", - "title": "Filter by publication source ID", - "type": "object", - "properties": { - "source_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_status": { - "description": "Filter conditions set on the order `status`.", - "title": "Filter by status", - "type": "object", - "properties": { - "status": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_source_id": { - "description": "Filter conditions set on the order `source_id`.", - "title": "Filter by order source ID", - "type": "object", - "properties": { - "source_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_amount": { - "description": "Filter conditions set on the order `amount`.", - "title": "Filter by order amount", - "type": "object", - "properties": { - "amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_total_amount": { - "description": "Filter conditions set on the order `total_amount`.", - "title": "Filter by order total amount", - "type": "object", - "properties": { - "total_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_discount_amount": { - "description": "Filter conditions set on the order `discount_amount`.", - "title": "Filter by order discount amount", - "type": "object", - "properties": { - "discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_total_discount_amount": { - "description": "Filter conditions set on the order `total_discount_amount`.", - "title": "Filter by order total discount amount", - "type": "object", - "properties": { - "total_discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_order_items_discount_amount": { - "description": "Filter conditions set on the order `items_discount_amount`.", - "title": "Filter by order items discount amount", - "type": "object", - "properties": { - "items_discount_amount": { - "$ref": "#/components/schemas/16_filter_conditions_number" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_points_expiration_campaign_id": { - "description": "Filter conditions set on`the `campaign_id`.", - "title": "Filter by campaign ID", - "type": "object", - "properties": { - "campaign_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_points_expiration_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_gift_card_transactions_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_obj_filter_loyalty_card_transactions_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", - "title": "Filter by voucher ID", - "type": "object", - "properties": { - "voucher_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "16_filter_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.", - "title": "Logical Operator Between Filters", - "type": "string", - "enum": [ - "AND", - "OR" - ] - }, - "16_filter_conditions_string": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - } - } - } - } - }, - "16_filter_conditions_number": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "integer" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "integer" - } - }, - "$is": { - "type": "integer", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "integer", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$more_than": { - "type": "integer", - "description": "Value is more than the specified number." - }, - "$more_than_equal": { - "type": "integer", - "description": "Value is more than or equal to the specified number." - }, - "$less_than": { - "type": "integer", - "description": "Value is less than the specified number." - }, - "$less_than_equal": { - "type": "integer", - "description": "Value is less than or equal to the specified number." - } - } - } - } - }, - "16_filter_conditions_array": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - }, - "$count": { - "type": "integer", - "description": "Value has exactly this number of elements." - }, - "$count_less": { - "type": "integer", - "description": "Value has less than this number of elements." - }, - "$count_more": { - "type": "integer", - "description": "Value has more than this number of elements." - }, - "$contains": { - "type": "string", - "description": "Array contains this element." - } - } - } - } - }, - "16_filter_conditions_boolean": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - } - } - } - } - }, - "16_filter_conditions_date": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$after": { - "type": "string", - "description": "Value is after this date. Value for this parameter is in ISO 8601 format." - }, - "$before": { - "type": "string", - "description": "Value is before this date. Value for this parameter is in ISO 8601 format." - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - } - } - } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by the JSON. This object stores information about the customer.", + "default": "customer" + }, + "email_unsubscribed": { + "type": "boolean" + } + } + }, + "9_res_list_customers": { + "type": "object", + "title": "List Customers Response Body", + "description": "Response body schema for **GET** `/customers`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about customers in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "customers", + "description": "Identifies the name of the attribute that contains the array of customer objects." + }, + "customers": { + "type": "array", + "description": "Contains array of customer objects.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of customers." + } + } + }, + "9_res_list_customer_activities": { + "type": "object", + "title": "List Customer Activities Response Body", + "description": "Request body schema for `/customers/{customerId}/activities`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about customer activities in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of customer activity objects." + }, + "data": { + "type": "array", + "description": "Array of customer activity objects.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_activity_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of customer activities." + } + } + }, + "22_obj_webhooks": { + "type": "object", + "title": "Webhooks", + "description": "Data object model for a webhook.\n\n\nredemption.succeeded \nredemption.failed \nredemption.rollback.succeeded \nredemption.rollback.failed \npublication.succeeded \nvoucher.published \nvoucher.updated \nvoucher.deleted \nvoucher.created \nVoucher.enabled \nvoucher.disabled \nvoucher.loyalty_card.points_added \nvoucher.gift.balance_added \ncampaign.enabled \ncampaign.deleted \ncampaign.created \ncampaign.updated \ncampaign.disabled \ncampaign.vouchers.generation.completed \nbusiness_validation_rule.assignment.created \nbusiness_validation_rule.assignment.deleted \nbusiness_validation_rule.created \nbusiness_validation_rule.deleted \nbusiness_validation_rule.updated \ncustomer.created \ncustomer.deleted \ncustomer.rewarded \ncustomer.rewarded.loyalty_points \ncustomer.consents.revoked \ncustomer.consents.given ", + "x-tags": [ + "WEBHOOKS" + ], + "properties": { + "id": { + "type": "string", + "example": "event_m7MXf3zPf1n51IoUM8XHpP0w", + "description": "Unique event ID." + }, + "object": { + "type": "string", + "default": "event", + "description": "The type of object represented by JSON. This object stores information about events in a dictionary." + }, + "webhook_id": { + "type": "string", + "example": "wh_K7hpwSVDmKaxmBsDn0EpCvDy", + "description": "Unique webhook ID." + }, + "project_id": { + "type": "string", + "example": "proj_z7id5", + "description": "Unique Voucherify project ID." + }, + "created_at": { + "type": "string", + "example": "2022-11-30T16:53:30.434Z", + "format": "date-time", + "description": "Timestamp representing the date and time when the webhook was created in ISO 8601 format." + }, + "type": { + "type": "string", + "enum": [ + "redemption.succeeded", + "redemption.failed", + "redemption.rollback.succeeded", + "redemption.rollback.failed", + "publication.succeeded", + "voucher.published", + "voucher.updated", + "voucher.deleted", + "voucher.created", + "Voucher.enabled", + "voucher.disabled", + "voucher.loyalty_card.points_added", + "voucher.gift.balance_added", + "campaign.enabled", + "campaign.deleted", + "campaign.created", + "campaign.updated", + "campaign.disabled", + "campaign.vouchers.generation.completed", + "business_validation_rule.assignment.created", + "business_validation_rule.assignment.deleted", + "business_validation_rule.created", + "business_validation_rule.deleted", + "business_validation_rule.updated", + "customer.created", + "customer.deleted", + "customer.rewarded", + "customer.rewarded.loyalty_points", + "customer.consents.revoked", + "customer.consents.given" + ] + }, + "data": { + "$ref": "#/components/schemas/22_obj_webhook_object_data" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs attached to a webhook. The metadata object stores all custom attributes assigned to the webhook. It can be useful for storing additional information about the webhook in a structured format.", + "properties": { + "source": { + "type": "string", + "description": "The origin of the webhook.", + "enum": [ + "API" + ] } - }, - "16_filter_conditions_date_time": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$after": { - "type": "string", - "description": "Value is after this date. Value for this parameter is in ISO 8601 format.", - "format": "date-time" - }, - "$before": { - "type": "string", - "description": "Value is before this date. Value for this parameter is in ISO 8601 format.", - "format": "date-time" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - } + } + } + } + }, + "22_obj_webhook_object_data": { + "title": "Webhook Object", + "description": "Webhook event data object schema.", + "anyOf": [ + { + "$ref": "#/components/schemas/22_obj_event_redemption_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_failed" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_rollback_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_redemption_rollback_failed" + }, + { + "$ref": "#/components/schemas/22_obj_event_publication_succeeded" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_published" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_enabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_disabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_loyalty_card_points_added" + }, + { + "$ref": "#/components/schemas/22_obj_event_voucher_gift_balance_added" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_enabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_disabled" + }, + { + "$ref": "#/components/schemas/22_obj_event_campaign_vouchers_generation_completed" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_business_validation_rule_updated" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_created" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_deleted" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_rewarded" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_rewarded_loyalty_points" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_consents_given" + }, + { + "$ref": "#/components/schemas/22_obj_event_customer_consents_revoked" + } + ] + }, + "22_obj_event_redemption_succeeded": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `redemption.succeeded`.", + "type": "object" + }, + "22_obj_event_redemption_failed": { + "title": "Redemption Failed", + "description": "Event data object schema for `redemption.failed`.", + "type": "object" + }, + "22_obj_event_redemption_rollback_failed": { + "title": "Redemption Rollback Failed", + "description": "Event data object schema for `redemption.rollback.failed`.", + "type": "object" + }, + "22_obj_event_redemption_rollback_succeeded": { + "title": "Redemption Rollback Succeeded", + "description": "Event data object schema for `redemption.rollback.succeeded`.", + "type": "object" + }, + "22_obj_event_publication_succeeded": { + "title": "Publication Succeeded", + "description": "Event data object schema for `publication.succeeded`.", + "type": "object" + }, + "22_obj_event_voucher_published": { + "title": "Voucher Published", + "description": "Event data object schema for `voucher.published`.", + "type": "object" + }, + "22_obj_event_voucher_updated": { + "title": "Voucher Updated", + "description": "Event data object schema for `voucher.updated`.", + "type": "object" + }, + "22_obj_event_voucher_deleted": { + "title": "Voucher Deleted", + "description": "Event data object schema for `voucher.deleted`.", + "type": "object" + }, + "22_obj_event_voucher_created": { + "title": "Voucher Created", + "description": "Event data object schema for `voucher.created`.", + "type": "object" + }, + "22_obj_event_voucher_enabled": { + "title": "Voucher Enabled", + "description": "Event data object schema for `voucher.enabled`.", + "type": "object" + }, + "22_obj_event_voucher_disabled": { + "title": "Voucher Disabled", + "description": "Event data object schema for `voucher.disabled`.", + "type": "object" + }, + "22_obj_event_voucher_loyalty_card_points_added": { + "title": "Voucher Loyalty Card Points Added", + "description": "Event data object schema for `voucher.loyalty_card.points_added`.", + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "related_object": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" + }, + "voucher": { + "$ref": "#/components/schemas/1_obj_voucher_object" + } + } + }, + "22_obj_event_voucher_gift_balance_added": { + "title": "Voucher Gift Balance Added", + "description": "Event data object schema for `voucher.gift.balance_added`.", + "type": "object" + }, + "22_obj_event_campaign_enabled": { + "title": "Campaign Enabled", + "description": "Event data object schema for `campaign.enabled`.", + "type": "object" + }, + "22_obj_event_campaign_deleted": { + "title": "Campaign Deleted", + "description": "Event data object schema for `campaign.deleted`.", + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "campaign": { + "$ref": "#/components/schemas/2_obj_campaign_object" + } + } + }, + "22_obj_event_campaign_created": { + "title": "Campaign Created", + "description": "Event data object schema for `campaign.created`.", + "type": "object" + }, + "22_obj_event_campaign_updated": { + "title": "Campaign Updated", + "description": "Event data object schema for `campaign.updated`.", + "type": "object" + }, + "22_obj_event_campaign_disabled": { + "title": "Campaign Disabled", + "description": "Event data object schema for `campaign.disabled`.", + "type": "object" + }, + "22_obj_event_campaign_vouchers_generation_completed": { + "title": "Campaign Vouchers Generation Completed", + "description": "Event data object schema for `campaign.vouchers.generation.completed`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_assignment_created": { + "title": "Business Validation Rule Assignment Created", + "description": "Event data object schema for `business_validation_rule.assignment.created`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_assignment_deleted": { + "title": "Business Validation Rule Assignment Deleted", + "description": "Event data object schema for `business_validation_rule.assignment.deleted`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_created": { + "title": "Business Validation Rule Created", + "description": "Event data object schema for `business_validation_rule.created`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_deleted": { + "title": "Business Validation Rule Deleted", + "description": "Event data object schema for `business_validation_rule.deleted`.", + "type": "object" + }, + "22_obj_event_business_validation_rule_updated": { + "title": "Business Validation Rule Updated", + "description": "Event data object schema for `business_validation_rule.updated`.", + "type": "object" + }, + "22_obj_event_customer_created": { + "title": "Customer Created", + "description": "Event data object schema for `customer.created`.", + "type": "object" + }, + "22_obj_event_customer_deleted": { + "title": "Customer Deleted", + "description": "Event data object schema for `customer.deleted`.", + "type": "object" + }, + "22_obj_event_customer_rewarded": { + "title": "Customer Rewarded", + "description": "Event data object schema for `customer.rewarded`.", + "type": "object" + }, + "22_obj_event_customer_rewarded_loyalty_points": { + "title": "Customer Rewarded Loyalty Points", + "description": "Event data object schema for `customer.rewarded.loyalty_points`.", + "type": "object", + "properties": { + "object": { + "$ref": "#/components/schemas/9_obj_customer_object" + }, + "related_object": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" + }, + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object" + }, + "voucher": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "code": { + "type": "string" + }, + "loyalty_card": { + "type": "object", + "properties": { + "points": { + "type": "integer" + }, + "balance": { + "type": "integer" } } + }, + "type": { + "type": "string", + "default": "LOYALTY_CARD" + }, + "campaign": { + "type": "string" + }, + "campaign_id": { + "type": "string" + }, + "is_referral_code": { + "type": "boolean" + }, + "holder_id": { + "type": "string", + "example": "cust_o3ffuQSwM0vlxeJJoMqiOLMI" } - }, - "17_obj_async_action_object": { - "title": "Async Action Object", - "type": "object", - "description": "This is an object representing an asynchronous action.", - "x-tags": [ - "ASYNC ACTIONS API" - ], - "properties": { - "id": { - "type": "string", - "example": "aa_0adad13d6f057f088e", - "description": "Async action unique ID." - }, - "type": { - "type": "string", - "description": "Type of async action.", - "enum": [ - "CAMPAIGN.VOUCHERS_IMPORT", - "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "CAMPAIGN.VOUCHERS_UPDATE", - "CAMPAIGN.VOUCHERS_DELETE", - "CAMPAIGN.VOUCHERS_GENERATE", - "CAMPAIGNS.METADATA_KEY_PURGE", - "CUSTOMERS.IMPORT_CSV", - "CUSTOMERS.BULK_UPDATE", - "CUSTOMERS.METADATA_UPDATE", - "CUSTOMERS.METADATA_KEY_PURGE", - "PRODUCTS.BULK_UPDATE", - "PRODUCTS.METADATA_UPDATE", - "PRODUCTS.METADATA_KEY_PURGE", - "PRODUCTS.IMPORT_CSV", - "SKUS.IMPORT_CSV", - "VOUCHERS.IMPORT", - "VOUCHERS.IMPORT_CSV", - "VOUCHERS.BULK_UPDATE", - "VOUCHERS.METADATA_UPDATE", - "VOUCHERS.METADATA_KEY_PURGE", - "ORDERS.IMPORT", - "ORDERS.METADATA_KEY_PURGE" - ] + } + }, + "campaign": { + "type": "string" + }, + "earning_rule": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + } + }, + "22_obj_event_customer_consents_revoked": { + "title": "Customer Consents Revoked", + "description": "Event data object schema for `customer.consents.revoked`.", + "type": "object" + }, + "22_obj_event_customer_consents_given": { + "title": "Customer Consents Given", + "description": "Event data object schema for `customer.consents.given`.", + "type": "object" + }, + "9_obj_customer_activity_object": { + "type": "object", + "title": "Customer Activity Object", + "description": "This is an object representing customer activity. \n\nThis is a general object which presents moments from customers' activity. There are all types of different events that customers perform during their journey once they participate in Promotions. Events describe moments when customers redeem coupons and earn points or rewards. The list of all types of activities is listed below.\n\nThe details describing the activity are collected in a property named `data`. In this object, software integrators will find all further information explaining the event context. \n\nCustomer Activity Object is a type of [Event](ref:track-custom-event) which is our way of letting you know when something interesting happens in your project. When an interesting event concerning an individual customer occurs, we create a new Customer Activity object. For example, when a code is published to a customer, we create a `customer.publication.succeeded` event.\n\n| **Event types (definition in progress)** |\n|:---|\n| customer.confirmed |\n| customer.created |\n| customer.updated |\n| customer.deleted |\n| customer.referred |\n| customer.custom_event |\n| customer.segment.entered |\n| customer.segment.left |\n| customer.sms.sent |\n| customer.sms.failed |\n| customer.email.sent |\n| customer.email.failed |\n| customer.activecampaign.sent |\n| customer.activecampaign.failed |\n| customer.braze.sent |\n| customer.braze.failed |\n| customer.mailchimp.sent |\n| customer.mailchimp.failed |\n| customer.intercom.sent |\n| customer.intercom.failed |\n| customer.rewarded |\n| customer.rewarded.loyalty_points |\n| customer.voucher.gift.balance_added |\n| customer.voucher.loyalty_card.points_added |\n| customer.voucher.loyalty_card.points_transferred |\n| customer.publication.succeeded |\n| customer.publication.failed |\n| customer.redemption.succeeded |\n| customer.redemption.failed |\n| customer.redemption.rollback.succeeded |\n| customer.redemption.rollback.failed |\n| customer.consents.given |\n| customer.consents.revoked |", + "x-tags": [ + "CUSTOMERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique event ID, assigned by Voucherify.", + "example": "evcus_0c150c51730c6b60b1" + }, + "type": { + "type": "string", + "description": "Event type.", + "enum": [ + "customer.confirmed", + "customer.created", + "customer.updated", + "customer.deleted", + "customer.referred", + "customer.custom_event", + "customer.segment_entered", + "customer.segment.left", + "customer.sms.sent", + "customer.sms.failed", + "customer.email.sent", + "customer.email.failed", + "customer.activecampaign.sent", + "customer.braze.sent", + "customer.mailchimp.sent", + "customer.intercom.sent", + "customer.intercom.failed", + "customer.rewarded", + "customer.rewarded.loyalty_points", + "customer.voucher.gift.balance_added", + "customer.voucher.loyalty_card.points_added", + "customer.voucher.loyalty_card.points_transferred", + "customer.publication.succeeded", + "customer.publication.failed", + "customer.redemption.succeeded", + "customer.redemption.failed", + "customer.redemption.rollback.succeeded", + "customer.redemption.rollback.failed", + "customer.consents.given", + "customer.consents.revoked" + ] + }, + "data": { + "type": "array", + "description": "Contains details about the event. The objects that are returned in the data attribute differ based on the context of the event type.", + "items": { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data" + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the customer activity occurred in ISO 8601 format.", + "example": "2022-08-30T09:14:07.660Z", + "format": "date-time" + } + } + }, + "9_obj_customer_activity_object_data": { + "title": "Customer Activity Data Object", + "description": "Event data object schema.", + "anyOf": [ + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_confirmed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_created" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_updated" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_deleted" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_referred" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_custom_event" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_entered" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_segment_left" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_sms_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_email_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_activecampaign_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_braze_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_mailchimp_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_sent" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_intercom_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_rewarded_loyalty_points" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_publication_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_redemption_rollback_failed" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_given" + }, + { + "$ref": "#/components/schemas/9_obj_customer_activity_object_data_customer_consents_revoked" + } + ] + }, + "9_obj_customer_activity_object_data_customer_email_unsubscribed": { + "title": "Email Unsubscribed", + "description": "Email unsubscribed", + "type": "object", + "properties": { + "email_unsubscribed": { + "type": "boolean" + } + } + }, + "9_obj_customer_activity_object_data_customer_confirmed": { + "title": "Customer Confirmed", + "description": "Event data object schema for `customer.confirmed`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + }, + "unconfirmed_customer": { + "type": "string", + "example": "ucust_1qa70mVfYkl11Ab0ZxDPdWNa" + } + } + }, + "9_obj_customer_activity_object_data_customer_created": { + "title": "Customer Created", + "description": "Event data object schema for `customer.created`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } + } + }, + "9_obj_customer_activity_object_data_customer_updated": { + "title": "Customer Updated", + "description": "Event data object schema for `customer.updated`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } + } + }, + "9_obj_customer_activity_object_data_customer_deleted": { + "title": "Customer Deleted", + "description": "Event data object schema for `customer.deleted`.", + "type": "object", + "properties": { + "customer": { + "$ref": "#/components/schemas/9_obj_customer_object_email_parameter" + } + } + }, + "9_obj_customer_activity_object_data_customer_referred": { + "title": "Customer Referred", + "description": "Event data object schema for `customer.referred`.", + "type": "object", + "properties": { + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "referrer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "custom_event": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_custom_event": { + "title": "Custom Event", + "description": "Event data object schema for `customer.custom_event`.", + "type": "object", + "properties": { + "event": { + "type": "object" + }, + "loyalty": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "referral": { + "type": "object" + }, + "event_schema": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_segment_entered": { + "title": "Segment Entered", + "description": "Event data object schema for `customer.segment.entered`.", + "type": "object", + "properties": { + "segment": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_segment_left": { + "title": "Segment Left", + "description": "Event data object schema for `customer.segment.left`.", + "type": "object", + "properties": { + "segment": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_sms_sent": { + "title": "SMS Sent", + "description": "Event data object schema for `customer.sms.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_sms_failed": { + "title": "SMS Failed", + "description": "Event data object schema for `customer.sms.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_email_sent": { + "title": "Email Sent", + "description": "Event data object schema for `customer.email.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_email_failed": { + "title": "Email Failed", + "description": "Event data object schema for `customer.email.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_activecampaign_sent": { + "title": "ActiveCampaign Sent", + "description": "Event data object schema for `customer.activecampaign.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_activecampaign_failed": { + "title": "ActiveCampaign Failed", + "description": "Event data object schema for `customer.activecampaign.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_braze_sent": { + "title": "Braze Sent", + "description": "Event data object schema for `customer.braze.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_braze_failed": { + "title": "Braze Failed", + "description": "Event data object schema for `customer.braze.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_mailchimp_sent": { + "title": "Mailchimp Sent", + "description": "Event data object schema for `customer.mailchimp.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_mailchimp_failed": { + "title": "Mailchimp Failed", + "description": "Event data object schema for `customer.mailchimp.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_intercom_sent": { + "title": "Intercom Sent", + "description": "Event data object schema for `customer.intercom.sent`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_intercom_failed": { + "title": "Intercom Failed", + "description": "Event data object schema for `customer.intercom.failed`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_rewarded": { + "title": "Customer Rewarded", + "description": "Event data object schema for `customer.rewarded`.", + "type": "object", + "properties": { + "holder": { + "type": "object" + }, + "reward": { + "type": "object" + }, + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "custom_event": { + "type": "object" + }, + "referral_tier": { + "type": "object" + }, + "customer_event": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_rewarded_loyalty_points": { + "title": "Customer Rewarded Loyalty Points", + "description": "Event data object schema for `customer.rewarded.loyalty_points`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "earning_rule": { + "type": "object" + }, + "loyalty_tier": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_voucher_gift_voucher_balance_added": { + "title": "Gift Voucher Balance Added", + "description": "Event data object schema for `customer.voucher.gift.balance_added`.", + "type": "object", + "properties": { + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_added": { + "title": "Loyalty Card Points Added", + "description": "Event data object schema for `customer.voucher.loyalty_card.points_added`.", + "type": "object", + "properties": { + "balance": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_voucher_loyalty_card_points_transferred": { + "title": "Loyalty Card Points Transferred", + "description": "Event data object schema for `customer.voucher.loyalty_card.points_transferred`.", + "type": "object" + }, + "9_obj_customer_activity_object_data_customer_publication_succeeded": { + "title": "Publication Succeeded", + "description": "Event data object schema for `customer.publication.succeeded`.", + "type": "object", + "properties": { + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "publication": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_publication_failed": { + "title": "Publication Failed", + "description": "Event data object schema for `customer.publication.failed`.", + "type": "object", + "properties": { + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "publication": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_succeeded": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `customer.redemption.succeeded`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_failed": { + "title": "Redemption Succeeded", + "description": "Event data object schema for `customer.redemption.failed`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_rollback_succeeded": { + "title": "Redemption Rollback Succeeded", + "description": "Event data object schema for `customer.redemption.rollback.succeeded`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "voucher": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + }, + "redemption_rollback": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_redemption_rollback_failed": { + "title": "Redemption Rollback Failed", + "description": "Event data object schema for `customer.redemption.rollback.failed`.", + "type": "object", + "properties": { + "order": { + "type": "object" + }, + "holder": { + "type": "object" + }, + "campaign": { + "type": "object" + }, + "customer": { + "type": "object" + }, + "redemption": { + "type": "object" + }, + "promotion_tier": { + "type": "object" + }, + "redemption_rollback": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_consents_given": { + "title": "Consents Given", + "description": "Event data object schema for `customer.consents.given`.", + "type": "object", + "properties": { + "consents": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "9_obj_customer_activity_object_data_customer_consents_revoked": { + "title": "Consents Given", + "description": "Event data object schema for `customer.consents.revoked`.", + "type": "object", + "properties": { + "consents": { + "type": "object" + }, + "customer": { + "type": "object" + } + } + }, + "customers_permanent_deletion_response_body": { + "type": "object", + "title": "Customer Permanent Deletion Response Body", + "description": "Response body schema for `/customers/{customerId}/permanent-deletion`.", + "properties": { + "id": { + "type": "string", + "description": "Unique permanent deletion object ID.", + "example": "del_mgzqZNwUnwnt1Ddw6phEG90Q" + }, + "created_at": { + "type": "string", + "example": "2022-09-02T17:55:47.865Z", + "description": "Timestamp representing the date and time when the customer was requested to be deleted in ISO 8601 format.", + "format": "date-time" + }, + "related_object_id": { + "type": "string", + "example": "cust_m557pDDl4IGXexkU6KOQ2Dwi", + "description": "Unique customer ID that is being deleted." + }, + "related_object": { + "type": "string", + "description": "Object being deleted.", + "default": "customer" + }, + "status": { + "type": "string", + "description": "Deletion status.", + "default": "DONE" + }, + "data_json": { + "type": "object", + "description": "Statistics summarizing the number of related information that was deleted.", + "required": [ + "events", + "customer_events", + "daily_events", + "segments", + "orders", + "order_events", + "customer" + ], + "properties": { + "events": { + "type": "integer", + "description": "Number of events deleted." + }, + "customer_events": { + "type": "integer", + "description": "Number of customer events deleted." + }, + "daily_events": { + "type": "integer", + "description": "Number of daily events deleted." + }, + "segments": { + "type": "integer", + "description": "Number of segments deleted." + }, + "orders": { + "type": "integer", + "description": "Number of orders deleted." + }, + "order_events": { + "type": "integer", + "description": "Number of order events deleted." + }, + "customer": { + "type": "integer", + "description": "Number of customers deleted.", + "default": 1 + } + } + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON.", + "default": "pernament_deletion" + } + }, + "required": [ + "id", + "created_at", + "related_object_id", + "related_object", + "status", + "data_json", + "object" + ] + }, + "customers_update_metadata_in_bulk_request_body": { + "type": "object", + "title": "Update Customers' Metadata in bulk Request Body", + "description": "Request body schema for `/customers/metadata/async`.", + "properties": { + "source_ids": { + "type": "array", + "description": "An array of customer `source_id`'s.", + "items": { + "type": "string" + } + }, + "metadata": { + "type": "object", + "description": "Metadata key value pairs to be updated. A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments." + } + }, + "required": [ + "source_ids", + "metadata" + ] + }, + "customers_update_in_bulk_request_body": { + "type": "array", + "title": "Update Customers in bulk Request Body", + "description": "Request body schema for `/customers/bulk/async`.", + "items": { + "$ref": "#/components/schemas/customers_update_in_bulk_item_request_body" + } + }, + "customers_update_in_bulk_item_request_body": { + "title": "Update Customers in bulk Request Body", + "description": "Request body schema for `/customers/bulk/async`.", + "properties": { + "source_id": { + "type": "string", + "description": "Unique customer source ID." + }, + "name": { + "type": [ + "string", + "null" + ], + "description": "Customer's first and last name." + }, + "description": { + "type": [ + "string", + "null" + ], + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": [ + "string", + "null" + ], + "description": "Customer's email address." + }, + "phone": { + "type": [ + "string", + "null" + ], + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": [ + "string", + "null" + ], + "description": "City" + }, + "state": { + "type": [ + "string", + "null" + ], + "description": "State" + }, + "line_1": { + "type": [ + "string", + "null" + ], + "description": "First line of address." + }, + "line_2": { + "type": [ + "string", + "null" + ], + "description": "Second line of address." + }, + "country": { + "type": [ + "string", + "null" + ], + "description": "Country." + }, + "postal_code": { + "type": [ + "string", + "null" + ], + "description": "Postal code." + } + } + }, + "birthdate": { + "type": [ + "string", + "null" + ], + "description": "Customer's birthdate; format `YYYY-MM-DD`." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments. " + } + }, + "required": [ + "source_id" + ] + }, + "9_req_update_customers_consents": { + "type": "object", + "title": "Update Customer Consents Request Body", + "description": "Request body schema for **PUT** `/customers/{customerId}/consents`.", + "properties": { + "consent_id": { + "type": "boolean", + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not." + }, + "unsubscribed": { + "type": "boolean", + "description": "To deny all consents, use `unsubscribed` as a consent identifier and `true` as a value." + } + } + }, + "10_obj_order_object": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", + "x-tags": [ + "ORDERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "status": { + "product_id": { "type": "string", - "description": "Status of async action. Informs you whether the async action has already been completed.", - "enum": [ - "ENQUEUED", - "IN_PROGRESS", - "DONE", - "FAILED" - ] + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "result": { - "anyOf": [ - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_delete" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_generate" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_skus_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import_csv" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_bulk_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_update" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_key_purge" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_import" - }, - { - "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_metadata_key_purge" - } - ] - }, - "created_at": { + "sku_id": { "type": "string", - "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", - "example": "2022-06-23T11:21:45.578Z", - "format": "date-time" + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "updated_at": { - "type": "string", - "example": "2022-06-23T11:21:46.795Z", - "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", - "format": "date-time" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "request_id": { - "type": "string", - "example": "v-0b45cee140c3c9b5ca", - "description": "Unique request ID." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "processing_time": { + "discount_amount": { "type": "integer", - "example": 1217, - "description": "The length of time it took to process the request in milliseconds." + "description": "The item-level discount applied to the item." }, - "progress": { + "price": { "type": "integer", - "description": "% progress to completion of the asynchronous action.", - "minimum": 0, - "maximum": 100 + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "object": { - "type": "string", - "default": "async_action", - "description": "The type of object represented by JSON. This object stores information about the `async_action`." - } - } - }, - "17_res_list_async_actions_GET": { - "description": "Response body schema for listing asynchronous actions. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action.\n\n| **Types by Context** |\n|:---|\n| **CAMPAIGN** |\n| CAMPAIGN.VOUCHERS_IMPORT
                  CAMPAIGN.VOUCHERS_IMPORT_CSV
                  CAMPAIGN.VOUCHERS_UPDATE
                  CAMPAIGN.VOUCHERS_DELETE
                  CAMPAIGN.VOUCHERS_GENERATE |\n| **CUSTOMERS** |\n| CUSTOMERS.IMPORT_CSV
                  CUSTOMERS.BULK_UPDATE
                  CUSTOMERS.METADATA_UPDATE
                  CUSTOMERS.METADATA_KEY_PURGE |\n| **PRODUCTS** |\n| PRODUCTS.BULK_UPDATE
                  PRODUCTS.METADATA_UPDATE
                  PRODUCTS.METADATA_KEY_PURGE
                  PRODUCTS.IMPORT_CSV
                  SKUS.IMPORT_CSV |\n| **VOUCHERS** |\n| VOUCHERS.IMPORT
                  VOUCHERS.IMPORT_CSV
                  VOUCHERS.BULK_UPDATE
                  VOUCHERS.METADATA_UPDATE
                  VOUCHERS.METADATA_KEY_PURGE |", - "type": "object", - "examples": [ - { - "object": "list", - "data_ref": "async_actions", - "async_actions": [ - { - "id": "aa_0ae2af6a38161f8c79", - "type": "CAMPAIGN.VOUCHERS_DELETE", - "status": "DONE", - "created_at": "2022-04-07T11:34:39.072Z", - "object": "async_action" + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - { - "id": "aa_0ae27a55b696a4e0f0", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "created_at": "2022-04-07T07:42:44.442Z", - "object": "async_action" + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" }, - { - "id": "aa_0adad13d6f057f088e", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "created_at": "2022-04-01T08:54:35.196Z", - "object": "async_action" + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." }, - { - "id": "aa_0adacc81de057f084c", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "created_at": "2022-04-01T08:33:54.552Z", - "object": "async_action" - } - ] - } - ], - "title": "List Async Actions Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about asynchronous actions.", - "default": "list" - }, - "data_ref": { - "type": "string", - "default": "async_actions", - "description": "Identifies the name of the JSON property that contains the array of asynchronous actions." - }, - "async_actions": { - "type": "array", - "description": "An array of async actions.", - "items": { - "type": "object", - "additionalProperties": false, - "description": "Contains an async action definition.", - "properties": { - "id": { - "type": "string", - "description": "Async action unique ID.", - "example": "aa_0ae2af6a38161f8c79" - }, - "type": { - "type": "string", - "description": "Type of async action.", - "enum": [ - "CAMPAIGN.VOUCHERS_IMPORT", - "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "CAMPAIGN.VOUCHERS_UPDATE", - "CAMPAIGN.VOUCHERS_DELETE", - "CAMPAIGN.VOUCHERS_GENERATE", - "CUSTOMERS.IMPORT_CSV", - "CUSTOMERS.BULK_UPDATE", - "CUSTOMERS.METADATA_UPDATE", - "CUSTOMERS.METADATA_KEY_PURGE", - "PRODUCTS.BULK_UPDATE", - "PRODUCTS.METADATA_UPDATE", - "PRODUCTS.METADATA_KEY_PURGE", - "PRODUCTS.IMPORT_CSV", - "SKUS.IMPORT_CSV", - "VOUCHERS.IMPORT", - "VOUCHERS.IMPORT_CSV", - "VOUCHERS.BULK_UPDATE", - "VOUCHERS.METADATA_UPDATE", - "VOUCHERS.METADATA_KEY_PURGE" - ] - }, - "status": { - "type": "string", - "description": "Status of async action. Informs you whether the async action has already been completed.", - "enum": [ - "ENQUEUED", - "IN_PROGRESS", - "DONE", - "FAILED" - ] - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", - "example": "2022-04-07T07:42:44.442Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", - "example": "2022-06-22T07:58:21.703Z", - "format": "date-time" - }, - "request_id": { - "type": "string", - "example": "v-0ba50a7feb4998490", - "description": "Unique request ID." - }, - "progress": { - "type": "integer", - "minimum": 0, - "maximum": 100, - "description": "% progress to completion of the asynchronous action." - }, - "object": { - "type": "string", - "default": "async_action", - "description": "The type of object represented by each nested object in the JSON async_actions array. This object stores information about the `async_action`." - } + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - } - } - }, - "17_res_obj_get_async_action_result_message": { - "title": "Message", - "type": "object", - "description": "Result schema with message.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - } - } - }, - "17_res_obj_get_async_action_result_message_failed": { - "title": "Message with Failed Array", - "type": "object", - "description": "Result schema with message and failed array.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": {} - } - } - }, - "17_res_obj_get_async_action_result_code_updated_found": { - "title": "Code Updated and Found", - "type": "object", - "description": "Result schema with an array of code, updated, and found parameters.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } } } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_import": { - "title": "CAMPAIGN.VOUCHERS_IMPORT", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_import_csv": { - "title": "CAMPAIGN.VOUCHERS_IMPORT_CSV", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "row": { - "type": "integer", - "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_update": { - "title": "CAMPAIGN.VOUCHERS_UPDATE", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_UPDATE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + }, + "redemptions": { + "oneOf": [ + { + "$ref": "#/components/schemas/10_obj_order_object_unstacked_redemptions" + }, + { + "$ref": "#/components/schemas/10_obj_order_object_stacked_redemptions" } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_delete": { - "title": "CAMPAIGN.VOUCHERS_DELETE", + ] + } + } + }, + "10_obj_order_object_no_discount_calculations": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order.", + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts." + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_DELETE async action type.", "properties": { - "message": { + "object": { "type": "string", - "description": "A human-readable message providing a short description about the result." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_campaign_vouchers_generate": { - "title": "CAMPAIGN.VOUCHERS_GENERATE", - "type": "object", - "description": "Result schema for a CAMPAIGN.VOUCHERS_GENERATE async action type.", - "properties": { - "message": { + "product_id": { "type": "string", - "description": "A human-readable message providing a short description about the result." + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_campaign_metadata_key_purge": { - "title": "CAMPAIGNS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a CAMPAIGNS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { + "sku_id": { "type": "string", - "description": "A human-readable message providing a short description about the result." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_import_csv": { - "title": "CUSTOMERS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a CUSTOMERS.IMPORT_CSV async action type.", - "properties": { - "message": { + "source_id": { "type": "string", - "description": "A human-readable message providing a short description about the result." + "description": "A unique identifier that represents the product or SKU from your inventory system." }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique customer ID from your inventory system as indicated in the CSV file." - }, - "row": { - "type": "integer", - "description": "The CSV file row number where the customer is recorded. The row counter excludes the file headers row." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the customer import." - } - } - } + "related_object": { + "type": "string", + "description": "Reference to the object containing details of the related product. This can either be a `product` or `sku`.", + "enum": [ + "product", + "sku" + ] }, - "done_count": { + "quantity": { "type": "integer", - "description": "Number of resources processed successfully." + "description": "Quantity of the item in the cart." }, - "failed_count": { + "amount": { "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_customers_bulk_update": { - "title": "CUSTOMERS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a CUSTOMERS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique customer `source_id`." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "done_count": { + "price": { "type": "integer", - "description": "Number or resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_metadata_update": { - "title": "CUSTOMERS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a CUSTOMERS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique customer `source_id`." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "done_count": { + "subtotal_amount": { "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_customers_metadata_key_purge": { - "title": "CUSTOMERS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a CUSTOMERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`." }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_bulk_update": { - "title": "PRODUCTS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a PRODUCTS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique product `source_id`." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } - }, - "17_res_obj_get_async_action_result_products_metadata_update": { - "title": "PRODUCTS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a PRODUCTS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique product `source_id`." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." } } - }, - "17_res_obj_get_async_action_result_products_metadata_key_purge": { - "title": "PRODUCTS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a PRODUCTS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources updated successfully." - } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "17_res_obj_get_async_action_result_products_import_csv": { - "title": "PRODUCTS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a PRODUCTS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "description": "Contains the details regarding a CSV file line item failed import.", - "properties": { - "row": { - "type": "integer", - "description": "The CSV file row number where the product definition is recorded. The row counter excludes the file headers row." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the product import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_skus_import_csv": { - "title": "SKUS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a SKUS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result.", - "example": "2 sku(s) imported successfully, 6 failed." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "description": "Contains the details regarding a CSV file line item failed import.", - "properties": { - "row": { - "type": "integer", - "description": "The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.", - "example": 2 - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the SKU import.", - "example": "Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]" - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_import": { - "title": "VOUCHERS.IMPORT", - "type": "object", - "description": "Result schema for a VOUCHERS.IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "description": "If any records failed during the process, this array shows the failure details.", - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } - }, - "17_res_obj_get_async_action_result_vouchers_import_csv": { - "title": "VOUCHERS.IMPORT_CSV", - "type": "object", - "description": "Result schema for a VOUCHERS.IMPORT_CSV async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "row": { - "type": "integer", - "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." } - }, - "17_res_obj_get_async_action_result_vouchers_bulk_update": { - "title": "VOUCHERS.BULK_UPDATE", - "type": "object", - "description": "Result schema for a VOUCHERS.BULK_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "10_obj_order_object_unstacked_redemptions": { + "type": "object", + "title": "Unstacked Redemption", + "description": "Redemption object representing a single redemption.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of an incentive.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "enum": [ + "voucher", + "promotion_tier" + ] + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the related object that defines the incentive." + }, + "related_object_parent_id": { + "type": "string", + "description": "Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign." } - }, - "17_res_obj_get_async_action_result_vouchers_metadata_update": { - "title": "VOUCHERS.METADATA_UPDATE", - "type": "object", - "description": "Result schema for a VOUCHERS.METADATA_UPDATE async action type.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." + } + } + } + }, + "10_obj_order_object_stacked_redemptions": { + "type": "object", + "title": "Stacked Redemption", + "description": "Redemption object representing a stacked redemption.", + "properties": { + "redemption_ID": { + "type": "object", + "description": "The property name is the unique parent redemption ID; i.e. `r_0ba186c4824e4881e1`. This object contains information about the redemption of multiple incentives.", + "properties": { + "date": { + "type": "string", + "description": "Timestamp representing the date and time when the redemption was created in ISO 8601 format.", + "example": "2022-09-02T17:06:56.649Z", + "format": "date-time" + }, + "related_object_type": { + "type": "string", + "description": "The source of the incentive.", + "default": "redemption" + }, + "related_object_id": { + "type": "string", + "description": "Unique ID of the parent redemption.", + "example": "r_0ba186c4824e4881e1" + }, + "stacked": { + "type": "array", + "description": "Contains a list of unique IDs of child redemptions, which belong to the stacked incentives.", + "items": { + "type": "string" } } + } + } + } + }, + "10_res_list_orders": { + "type": "object", + "title": "List Orders Response Body", + "description": "Response body schema representing **GET** `/orders`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about orders in a dictionary." + }, + "data_ref": { + "type": "string", + "default": "orders", + "description": "Identifies the name of the attribute that contains the array of order objects." + }, + "orders": { + "type": "array", + "description": "Contains array of order objects.", + "items": { + "$ref": "#/components/schemas/10_obj_order_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of orders." + } + } + }, + "10_req_create_order": { + "type": "object", + "title": "Order", + "description": "Request body schema for creating an order.", + "properties": { + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." + }, + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + } + } + }, + "10_req_update_order": { + "type": "object", + "title": "Update Order Request Body", + "description": "Request body schema for **PUT** `/orders/{orderId}`.", + "properties": { + "status": { + "type": "string", + "description": "The order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULLFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." + }, + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" + }, + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" + }, + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + }, + "customer_id": { + "type": "string", + "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "description": "Unique customer ID of the customer making the purchase." + }, + "referrer_id": { + "type": "string", + "example": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "description": "Unique referrer ID." + } + } + }, + "10_req_create_order_export": { + "type": "object", + "title": "Create Order Export Request Body", + "description": "Request body schema for **POST** `/orders/export`.", + "properties": { + "parameters": { + "$ref": "#/components/schemas/16_obj_export_order", + "description": "Contains the parameters that define the data to be exported." + } + } + }, + "10_req_orders_import": { + "type": "array", + "title": "Import Orders Request Body", + "description": "Request body schema for POST `/orders/import`.", + "items": { + "type": "object", + "properties": { + "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 an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." }, - "17_res_obj_get_async_action_result_vouchers_metadata_key_purge": { - "title": "VOUCHERS.METADATA_KEY_PURGE", - "type": "object", - "description": "Result schema for a VOUCHERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } + "status": { + "type": "string", + "description": "The order status. One of `CREATED`, `PAID`, `CANCELED`, `FULFILLED`." }, - "17_res_obj_get_async_action_result_orders_import": { - "title": "ORDERS.IMPORT", - "type": "object", - "description": "Result schema for a ORDERS.IMPORT async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "description": "If any records failed during the process, this array shows the failure details.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique order source ID." - }, - "reason": { - "type": "string", - "description": "Detailed failure cause for the voucher code import." - } - } - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - }, - "failed_count": { - "type": "integer", - "description": "Number of resources failed to process." - } - } + "amount": { + "type": "integer", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order; this is the sum of the order items' amounts." }, - "17_res_obj_get_async_action_result_orders_metadata_key_purge": { - "title": "ORDERS.METADATA_KEY_PURGE", + "metadata": { "type": "object", - "description": "Result schema for a ORDERS.METADATA_KEY_PURGE async action type.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "done_count": { - "type": "integer", - "description": "Number of resources processed successfully." - } - } + "description": "A set of custom key/value pairs that you can attach to an order. It can be useful for storing additional information about the order in a structured format." }, - "18_res_list_consents_GET": { - "description": "Response body schema for listing consents.", - "type": "object", - "examples": [ - { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" - }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" - } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" - }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" - } - ], - "total": 2 - } - } - ], - "title": "List Consents Response Body", - "properties": { - "groups": { - "type": "object", - "description": "Contains marketing permission groups' definitions.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "Stores information about marketing permission groups." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of marketing permission groups." - }, - "data": { - "type": "array", - "description": "An array of marketing permission groups.", - "items": { - "type": "object", - "additionalProperties": false, - "description": "Contains a marketing permission group's definition.", - "properties": { - "id": { - "type": "string", - "example": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "description": "Unique group ID." - }, - "name": { - "type": "string", - "description": "Marketing permission group name." - }, - "description": { - "type": "string", - "description": "Marketing permission group category." - }, - "consents": { - "type": "array", - "description": "List of consents that are assigned to the group.", - "items": { - "type": "string" - } - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-04-13T09:12:47.743Z", - "description": "Timestamp representing the date and time when the group was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-05-14T09:11:27.037Z", - "description": "Timestamp representing the date and time when the group was updated in ISO 8601 format." - }, - "object": { - "type": "string", - "default": "consent_group", - "description": "Stores information about a marketing permission group." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of groups." - } - } - }, - "consents": { - "type": "object", - "description": "Contains opt-in consents' definitions.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "Stores information about opt-in consents." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of opt-in consents." - }, - "data": { - "type": "array", - "description": "An array of consents.", - "items": { - "type": "object", - "additionalProperties": false, - "description": "Contains an opt-in consent definition.", - "properties": { - "id": { - "type": "string", - "example": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "description": "Unique consent ID." - }, - "name": { - "type": "string", - "description": "Consent name." - }, - "description": { - "type": "string", - "description": "Consent description." - }, - "category": { - "type": "string", - "description": "Consent category." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-04-13T09:11:27.037Z", - "description": "Timestamp representing the date and time when the consent was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-05-14T09:11:27.037Z", - "description": "Timestamp representing the date and time when the consent was updated in ISO 8601 format." - }, - "object": { - "type": "string", - "default": "consent", - "description": "Stores information about an opt-in consent." - } - } - } - }, - "total": { - "type": "integer", - "description": "Total number of consents." - } - } - } - } + "customer": { + "$ref": "#/components/schemas/10_req_orders_customer_object" }, - "20_res_list_categories": { - "type": "object", - "title": "List Categories Response Body", - "description": "Response schema for **GET** `/categories`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about categories in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of category objects.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/20_obj_category_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of categories." - } - } + "referrer": { + "$ref": "#/components/schemas/10_req_orders_referrer_object" }, - "20_obj_category_object": { - "type": "object", - "title": "Category Object", - "description": "This is an object representing a category.", - "x-tags": [ - "CATEGORIES API" - ], - "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", - "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", - "example": "2022-07-14T10:45:13.156Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-16T10:52:08.094Z", - "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "category", - "description": "The type of object represented by the JSON. This object stores information about the category." - } + "items": { + "$ref": "#/components/schemas/10_req_orders_items_array" + } + } + } + }, + "10_req_orders_customer_object": { + "type": "object", + "title": "Customer", + "description": "This is an object containing information about the customer.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer that will be linked to the order; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Customer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a customer object." + }, + "email": { + "type": "string", + "description": "Customer's email address." + }, + "phone": { + "type": "string", + "description": "Customer's phone number." + }, + "address": { + "type": "object", + "description": "Customer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" }, - "examples": [ - { - "id": "cat_0b60cfe7d0d7ddbb55", - "name": "Update", - "hierarchy": 1, - "created_at": "2022-07-14T10:45:13.156Z", - "updated_at": "2022-08-16T11:03:54.727Z", - "object": "category" - } - ] - }, - "20_req_update_categories_categoryId": { - "type": "object", - "title": "Update Category Request Body", - "description": "Request schema for updating a category using **PUT** `/categories/{categoryId}`.", - "properties": { - "name": { - "type": "string", - "description": "Category name." - }, - "hierarchy": { - "type": "integer", - "description": "Category hierarchy." - } + "state": { + "type": "string", + "description": "State" }, - "required": [ - "name", - "hierarchy" - ] - }, - "20_req_create_category": { - "type": "object", - "title": "Create Category Request Body", - "description": "Request schema for creating a category using **POST** `/categories`.", - "properties": { - "name": { - "type": "string", - "description": "Category name." - }, - "hierarchy": { - "type": "integer", - "description": "Category hierarchy." - } + "line_1": { + "type": "string", + "description": "First line of address" }, - "required": [ - "name", - "hierarchy" - ] - }, - "20_res_create_category": { - "type": "object", - "title": "Category Object", - "description": "This is an object representing a newly created 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", - "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", - "example": "2022-07-14T10:45:13.156Z", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "category", - "description": "The type of object represented by the JSON. This object stores information about the category." - } + "line_2": { + "type": "string", + "description": "Second line of address" + }, + "country": { + "type": "string", + "description": "Country" + }, + "postal_code": { + "type": "string", + "description": "Postal code" } - }, - "21_obj_metadata_schema_object": { - "type": "object", - "title": "Metadata Schema Object", - "description": "This is an object representing a metadata schema.", - "properties": { - "id": { - "type": "string", - "description": "Unique metadata schema ID.", - "example": "ms_OF36L2rk4EqhdxvZs56IW9iE" - }, - "related_object": { - "type": "string", - "description": "The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.", - "enum": [ - "campaign", - "customer", - "earning_rule", - "loyalty_tier", - "order", - "order_item", - "product", - "promotion_tier", - "publication", - "redemption", - "reward", - "voucher" - ] - }, - "properties": { - "description": "Contains the metadata definitions. There can be many properties within this object.", - "anyOf": [ - { - "properties": { - "custom_property_name": { - "type": "object", - "description": "Custom property name. This is defined in **Project Settings** > **Metadata Schema** in the Dashboard.", - "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "number", - "object", - "date", - "datetime", - "geopoint", - "boolean", - "image_url" - ] - }, - "array": { - "type": "boolean", - "description": "Indicates whether the definition is an array." - }, - "optional": { - "type": "boolean", - "description": "Indicates whether this definition is optional or not optional for the resource." - }, - "objectType": { - "type": [ - "string", - "null" - ], - "description": "Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object." - }, - "eq": { - "type": "array", - "description": "Array of possible values when the setting for `is equal to any of` in the Dashboard is defined explicitly.", - "items": {} - }, - "ne": { - "type": "array", - "description": "Array of values that are not allowed when the setting for `is not equal to any of` in the Dashboard is defined explicitly.", - "items": {} - }, - "lt": { - "type": "integer", - "description": "A property of `number` type must have `less than` this value." - }, - "lte": { - "type": "integer", - "description": "A property of `number` type must be `less than or equal` to this value." - }, - "gt": { - "type": "integer", - "description": "A property of `number` type must be `greater than` this value." - }, - "gte": { - "type": "integer", - "description": "A property of `number` type must be `greater than or equal` to this value." - }, - "deleted": { - "type": "boolean", - "description": "Indicates whether the definition was deleted from the schema." - }, - "maxLength": { - "type": "integer", - "description": "Value for maximum length when the setting for `has maximum length of` in the Dashboard is defined explicitly." - }, - "minLength": { - "type": "integer", - "description": "Value indicating minimum length when the setting for `has minimum length of` in the Dashboard is defined explicitly." - }, - "exactLength": { - "type": "integer", - "description": "Value indicating exact length when the setting for `has exact length of` in the Dashboard is defined explicitly." - } - } - } - } - } - ], - "type": "object" - }, - "allow_defined_only": { - "type": "boolean", - "description": "Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.\t" - }, - "created_at": { - "type": "string", - "example": "2021-12-03T13:33:44.556Z", - "description": "Timestamp representing the date and time when the metadata schema was created in ISO 8601 format.\t", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-08-11T08:05:30.695Z", - "description": "Timestamp representing the date and time when the metadata schema was updated in ISO 8601 format.\t", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "metadata_schema", - "description": "The type of object represented by the JSON. This object stores information about the metadata schema." - } + } + }, + "birthdate": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Customer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer." + } + } + }, + "10_req_orders_referrer_object": { + "type": "object", + "title": "Referrer", + "description": "This is an ojbect containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "description": "The unique ID of an existing customer that will be linked to the order as the referrer; this is an ID that has been assigned to the customer by Voucherify, i.e. `cust_LMY4ZylSdUYB1J4tzqNcl5VV`." + }, + "source_id": { + "type": "string", + "description": "The merchant’s customer ID if it is different from the Voucherify customer ID. It is really useful in case of an integration between multiple systems. It can be a customer ID from a CRM system, database or 3rd-party service." + }, + "name": { + "type": "string", + "description": "Referrer's first and last name." + }, + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a referrer object." + }, + "email": { + "type": "string", + "description": "Referrer's email address." + }, + "phone": { + "type": "string", + "description": "Referrer's phone number." + }, + "address": { + "type": "object", + "description": "Referrer's address.", + "properties": { + "city": { + "type": "string", + "description": "City" }, - "x-tags": [ - "METADATA SCHEMAS API" - ], - "examples": [ - { - "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", - "related_object": "earning_rule", - "properties": { - "channel_id": { - "type": "string", - "array": true, - "optional": true, - "objectType": null, - "exactLength": 5 - }, - "channel_name": { - "eq": [ - "instagram", - "facebook", - "google", - "twitter", - "linkedin", - "website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:09:59.970Z", - "updated_at": "2022-08-25T13:11:15.704Z", - "object": "metadata_schema" - }, - { - "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", - "related_object": "campaign", - "properties": { - "region": { - "eq": [ - "EMEA", - "AMER", - "APAC" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:12:58.447Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "age": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "city_id": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.889Z", - "updated_at": "2022-09-12T07:34:49.163Z", - "object": "metadata_schema" - }, - { - "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", - "related_object": "loyalty_tier", - "properties": { - "level_name": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "audience_restricted": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:14:54.954Z", - "updated_at": "2022-08-25T13:15:24.436Z", - "object": "metadata_schema" - }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "card": { - "eq": [ - "Visa", - "MasterCard", - "Other" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "currency": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "ne": [ - 1, - 2, - 18, - 22 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "store_city": { - "eq": [ - "Hampden", - "San Francisco", - "Warsaw" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:47.575Z", - "updated_at": "2022-10-25T10:05:18.978Z", - "object": "metadata_schema" - }, - { - "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", - "related_object": "order_item", - "properties": { - "manufacturer_id": { - "gte": 15, - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:03.167Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "vendor": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "category": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.298Z", - "updated_at": "2022-07-14T15:53:29.226Z", - "object": "metadata_schema" - }, - { - "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", - "related_object": "promotion_tier", - "properties": { - "level": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:04.937Z", - "updated_at": "2022-09-23T08:51:46.266Z", - "object": "metadata_schema" - }, - { - "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", - "related_object": "publication", - "properties": { - "file_uploaded": { - "type": "image_url", - "array": false, - "optional": true, - "objectType": null - }, - "publication_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:35.534Z", - "updated_at": "2022-09-12T10:26:31.135Z", - "object": "metadata_schema" - }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "redemption_location": { - "type": "object", - "array": false, - "optional": true, - "objectType": "Location" - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.794Z", - "updated_at": "2022-08-25T13:19:50.497Z", - "object": "metadata_schema" - }, - { - "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", - "related_object": "reward", - "properties": { - "reward_type": { - "eq": [ - "MATERIAL", - "PAY-WITH-POINTS", - "DISCOUNT-COUPON", - "GIFT-CARD-CREDITS", - "LOYALTY POINTS" - ], - "type": "string", - "array": false, - "optional": false, - "objectType": null - } - }, - "allow_defined_only": true, - "created_at": "2022-08-25T13:07:13.689Z", - "updated_at": "2022-08-25T13:08:26.696Z", - "object": "metadata_schema" - }, - { - "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", - "related_object": "voucher", - "properties": { - "lang": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "marketing_text": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "ProductionVoucherCodeMetaData": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:23.994Z", - "updated_at": "2022-09-19T14:13:30.590Z", - "object": "metadata_schema" - } - ] - }, - "21_res_list_metadata_shemas": { - "title": "List Metadata Schemas Response Body", - "type": "object", - "description": "Response schema for listing metadata schemas using **GET** `/metadata-schemas`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about metadata schemas in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", - "default": "schemas" - }, - "schemas": { - "type": "array", - "description": "Array of metadata schema objects.", - "items": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of metadata schemas." + "state": { + "type": "string", + "description": "State" + }, + "line_1": { + "type": "string", + "description": "First line of address" + }, + "line_2": { + "type": "string", + "description": "Second line of address" + }, + "country": { + "type": "string", + "description": "Country" + }, + "postal_code": { + "type": "string", + "description": "Postal code" + } + } + }, + "birthdate": { + "type": "string", + "description": "Referrer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "birthday": { + "type": "string", + "description": "Referrer's birthdate; format `YYYY-MM-DD`.", + "format": "date" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a referrer." + } + } + }, + "10_req_orders_items_array": { + "type": "array", + "title": "Items Array", + "description": "Array of items applied to the order.", + "items": { + "$ref": "#/components/schemas/10_req_orders_order_item" + } + }, + "10_req_orders_order_item": { + "type": "object", + "title": "Order Item", + "description": "This object represents an order line item.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "related_object": { + "type": "string", + "description": "Used along with the `source_id` property, can be set to either `sku` or `product`." + }, + "product_id": { + "type": "string", + "description": "A unique product ID assigned by Voucherify.", + "example": "prod_0a7e62db1fca8322a2" + }, + "sku_id": { + "type": "string", + "description": "A unique SKU ID assigned by Voucherify.", + "example": "sku_0a41e31c7b41c28358" + }, + "quantity": { + "type": "integer", + "description": "The quantity of the particular item in the cart." + }, + "price": { + "type": "integer", + "description": "The unit price of the item." + }, + "amount": { + "type": "integer", + "description": "The total amount of the order item (`price` * `quantity`)." + }, + "product": { + "$ref": "#/components/schemas/10_req_orders_order_item_product" + }, + "sku": { + "$ref": "#/components/schemas/10_req_orders_order_item_sku" + } + } + }, + "10_req_orders_order_item_product": { + "type": "object", + "title": "Product", + "description": "An object containing details of the related product.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s product ID (if it is different than Voucherify's product ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "name": { + "type": "string", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Product price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a product. It can be useful for storing additional information about the product in a structured format." + }, + "override": { + "type": "boolean", + "description": "The override set to true is used to store the product information in the system. If product does not exist, it will be created with the use of `source_id`; if it does exist, the provided values for the `name`, `price`, and `metadata` will replace those already stored in the system." + } + } + }, + "10_req_orders_order_item_sku": { + "type": "object", + "title": "SKU", + "description": "An object containing details of the related SKU.", + "properties": { + "source_id": { + "type": "string", + "description": "The merchant’s SKU ID (if it is different than Voucherify's SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce site, a database or a 3rd party service." + }, + "sku": { + "type": "string", + "description": "The SKU name." + }, + "price": { + "type": "integer", + "description": "SKU price. A positive integer in the smallest currency unit (that is, 100 cents for $1.00)." + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to an SKU. It can be useful for storing additional information about the SKU in a structured format." + }, + "override": { + "type": "boolean", + "description": "The override is used to store the SKU in the system. If the SKU does not exist, it will be created with the use of `source_id`. Additionally, if the SKU does not exist, you are required to set the parent `product_id` that it belongs to. Set the parent `product_id` one level above, i.e. at the item level. If the parent product does not exist in Voucherify, i.e. does not have a unique `product_id`, then define the product object one level above, i.e. at the item level and make sure to also include the override as `true` for the product." + } + } + }, + "10_obj_order_item_object": { + "title": "Order Item Object", + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." + }, + "product_id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "sku_id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." + }, + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." + }, + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." + }, + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" + }, + "product": { + "type": "object", + "description": "This object stores more information about the related product.", + "properties": { + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + }, + "sku": { + "type": "object", + "description": "This object stores more information about the related SKU.", + "properties": { + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + } + } + } + }, + "description": "This is an object representing an order item. \n\nOrder Items are always specified within the [order object](ref:get-order). They can be related either to [products](list-products) or [SKUs](ref:list-skus-in-product). \n\nProduct/SKU details sent within an order item will be used on top of Product/SKU already stored in the system during the [Redeem Voucher](ref:redeem-voucher), [Validate Voucher](ref:validate-voucher), [Validate Promotions](ref:validate-promotions) and [Redeem Promotion](ref:redeem-promotion) requests.", + "x-tags": [ + "ORDERS API" + ] + }, + "11_obj_product_object": { + "type": "object", + "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.", + "title": "Product Object", + "x-tags": [ + "PRODUCTS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0b1da8105693710357" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID from your inventory system." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the `product`.", + "default": "product" + }, + "skus": { + "$ref": "#/components/schemas/11_res_get_product_skus_object" + } + } + }, + "11_req_create_product": { + "type": "object", + "description": "Request schema for **POST** `/products`.", + "title": "Create Product Request Body", + "properties": { + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_req_update_products_metadata_in_bulk": { + "type": "object", + "description": "Request schema for **POST** `/products/metadata/async`.", + "title": "Update Products' Metadata in Bulk Request Body", + "properties": { + "source_ids": { + "type": "array", + "description": "Array of unique product source IDs.", + "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." + } + }, + "required": [ + "source_ids", + "metadata" + ] + }, + "11_req_update_product": { + "type": "object", + "description": "Request schema for **PUT** `/products/{productId}`.", + "title": "Update Product Request Body", + "properties": { + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_req_update_product_bulk": { + "type": "object", + "description": "Request schema for **POST** `/products/bulk/async`.", + "title": "Update Product Request Body", + "properties": { + "source_id": { + "type": "string", + "description": "Unique product source ID from your inventory system.", + "example": "test_prod_id_1" + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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" + } + } + }, + "11_res_list_products": { + "type": "object", + "description": "Response body schema representing **GET** `/products`.", + "title": "Product Object", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about products in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of product objects.", + "default": "products" + }, + "products": { + "type": "array", + "description": "Contains array of product objects.", + "items": { + "$ref": "#/components/schemas/11_obj_list_products_product_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of product objects." + } + } + }, + "11_obj_list_products_product_object": { + "type": "object", + "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build which reflect product-specific campaigns.", + "title": "Product Object", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID assigned by Voucherify.", + "example": "prod_0b1da8105693710357" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the product.", + "default": "product" + }, + "skus": { + "type": "object", + "description": "Contains a list of related child SKUs.", + "properties": { + "data": { + "type": "array", + "description": "Contains a list of SKU objects.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" } }, - "examples": [ - { - "object": "list", - "data_ref": "schemas", - "schemas": [ - { - "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", - "related_object": "Payment", - "properties": { - "payment_tax": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "payment_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "total": { + "type": "number", + "description": "Total number of SKUs." + } + } + } + } + }, + "11_res_get_product_skus_object": { + "type": "object", + "description": "Contains information about child SKUs.", + "title": "SKUs object", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of SKUs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of SKUs.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of SKUs in the product." + } + } + }, + "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.", + "title": "Product Object", + "properties": { + "id": { + "type": "string", + "description": "Unique product ID.", + "example": "prod_f1r5Tpr0DuC7" + }, + "source_id": { + "type": "string", + "example": "productSourceID16", + "description": "Unique product source ID." + }, + "name": { + "type": "string", + "description": "Unique user-defined product name.", + "example": "T-shirt" + }, + "price": { + "type": "integer", + "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", + "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", + "description": "Timestamp representing the date and time when the product was updated in ISO 8601 format.", + "example": "2022-05-23T09:24:07.405Z", + "format": "date-time" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about the `product`.", + "default": "product" + } + } + }, + "11_obj_sku_object": { + "title": "SKU Object", + "type": "object", + "description": "This is an object representing a product SKU. \n\nThe SKU (acronym from Stock Keeping Unit) is tightly related to the [product object](ref:get-product). It reflects its different variants. One product can have many SKUs which are characterized and differentiated by varying values of the parent product `attributes`.", + "x-tags": [ + "PRODUCTS API" + ], + "examples": [ + { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", + "price": 1300, + "currency": "USD", + "attributes": { + "size": "XS", + "color": "blue", + "ranking": 1 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" + } + ], + "properties": { + "id": { + "type": "string", + "example": "sku_0b1621b319d248b79f", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "product_id": { + "type": "string", + "example": "prod_0b15f6b9f650c16990", + "description": "The parent product's unique ID." + }, + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency.", + "example": "USD" + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + }, + "created_at": { + "type": "string", + "example": "2022-05-17T10:36:30.187Z", + "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "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" + }, + "object": { + "type": "string", + "default": "sku", + "description": "The type of object represented by JSON. This object stores information about the `SKU`." + } + } + }, + "11_req_create_sku": { + "title": "SKU Object", + "type": "object", + "description": "Request body schema for **POST** `/products/{productId}/skus", + "properties": { + "source_id": { + "type": "string", + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency.", + "example": "USD" + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + } + } + }, + "product_collections_sku_in_collection": { + "title": "SKU in Collection", + "type": "object", + "description": "This is an object representing a SKU in product collection.", + "properties": { + "id": { + "type": "string", + "example": "sku_0b1621b319d248b79f", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": [ + "string", + "null" + ], + "example": "sku_source_id_4", + "description": "A unique SKU identifier from your inventory system." + }, + "product_id": { + "type": "string", + "example": "prod_0b15f6b9f650c16990", + "description": "The parent product's unique ID." + }, + "sku": { + "type": [ + "string", + "null" + ], + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "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": { + "type": "object", + "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", + "null" + ], + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + }, + "created_at": { + "type": "string", + "example": "2022-05-17T10:36:30.187Z", + "description": "Timestamp representing the date and time when the SKU was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "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" + }, + "object": { + "type": "string", + "default": "sku", + "description": "The type of object represented by JSON. This object stores information about the `SKU`." + }, + "product": { + "type": "object", + "description": "Stores information about the parent product.", + "required": [ + "id", + "source_id", + "name", + "price", + "attributes", + "metadata", + "object" + ], + "properties": { + "id": { + "type": "string", + "example": "prod_f15Tpr0DuC7", + "description": "Unique product ID." + }, + "source_id": { + "type": [ + "string", + "null" + ], + "example": "productSourceID11", + "description": "A unique product ID from your inventory system." + }, + "name": { + "type": [ + "string", + "null" + ], + "example": "Shirts", + "description": "Unique user-defined product name." + }, + "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 SKL 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." + }, + "object": { + "type": "string", + "default": "product", + "description": "The type of object represented by the object. This object stores information about the parent `product`." + } + } + } + }, + "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", + "type": "object", + "description": "Request body schema for **PUT** `/products/{productId}/skus/{skuId}`.", + "properties": { + "sku": { + "type": "string", + "example": "Large Pink Shirt", + "description": "Unique user-defined SKU name." + }, + "price": { + "type": "integer", + "description": "SKU unit price. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." + }, + "currency": { + "type": "string", + "description": "SKU price currency." + }, + "attributes": { + "type": "object", + "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", + "description": "The HTTPS URL pointing to the .png or .jpg file that will be used to render the SKU image." + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the SKU. A set of key/value pairs that you can attach to a SKU object. It can be useful for storing additional information about the SKU in a structured format." + } + } + }, + "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", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about products and SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of products and SKUs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of products and SKUs.", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/product_collections_product_in_collection" + }, + { + "$ref": "#/components/schemas/product_collections_sku_in_collection" + } + ] + } + }, + "total": { + "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", + "description": "Response body schema for **GET** `/products/{productID}/skus`.", + "title": "List SKUs in Product Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about SKUs.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of SKUs.", + "default": "skus" + }, + "skus": { + "type": "array", + "description": "A dictionary that contains an array of SKUs.", + "items": { + "$ref": "#/components/schemas/11_obj_sku_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of SKUs in the product." + } + } + }, + "product_collections_static_collection": { + "type": "object", + "title": "Static Product Collection", + "description": "Schema model for a `STATIC` product collection.", + "properties": { + "type": { + "description": "Describes whether the product collection is dynamic (products come in and leave based on set criteria) or static (manually selected products).", + "enum": [ + "STATIC" + ] + }, + "products": { + "description": "Defines a set of products for a `STATIC` product collection type.", + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "prod_0a41bcf807c5fcaaf6", + "description": "The product ID." + }, + "product_id": { + "type": "string", + "description": "Product ID for SKUs." + }, + "object": { + "enum": [ + "sku", + "product" + ], + "description": "Denotes the type of object represented by the ID." + } + }, + "required": [ + "id", + "object" + ] + } + } + }, + "required": [ + "type", + "products" + ] + }, + "product_collections_dynamic_collection": { + "type": "object", + "title": "Dynamic Product Collection", + "description": "Schema model for an `AUTO_UPDATE` product collection.", + "properties": { + "type": { + "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" + ] + }, + "filter": { + "type": "object", + "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" + ] + }, + "product_collections_list_response_body": { + "type": "object", + "title": "List Product Collections Response Body", + "description": "Response body schema for **GET** `/product-collections`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about product collections.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the JSON property that contains the array of product collections." + }, + "data": { + "description": "A dictionary that contains an array of product collections and their details.", + "type": "array", + "items": { + "$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", + "type": "object", + "description": "This is an object representing a validation rule. \n\nThis entity stores the rules used to limit resources in Voucherify. The validation rule can be assigned to resources such as a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)\n\nYou can configure the Validation Rule to include your own custom error messages which are going to be returned from the API upon a validation / redemption failure. You can read more [here](ref:errors#custom-error-messages-with-validation-rules).", + "x-tags": [ + "VALIDATION RULES API" + ], + "properties": { + "id": { + "type": "string", + "example": "val_eR1c41hu0vUU", + "description": "Unique validation rule ID." + }, + "name": { + "type": "string", + "description": "Custom, unique name for set of validation rules.", + "example": "Business Validation Rule" + }, + "rules": { + "type": "object", + "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", + "properties": { + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
                  customer.metadata* \n**Order** |order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** | sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive | order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n\n*Requires the `property` field to be defined." + }, + "property": { + "type": [ + "string", + "null" + ], + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n customer_metadata
                  custom_event_metadata
                  order_items_metadata
                  order_metadata
                  product_metadata
                  redemption_metadata" + }, + "conditions": { + "type": "object", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n**Condition (key)** | **Definition** | **Does not support Types** \n--- | --- | ---\n $is | A property is a predefined value. | \n $is_not | A property is not a predefined value. | \n $in | A property either one value in a predefined list of values. | \n $less_than | A property is less than a predefined value. | boolean \n $less_than_or_equal | A property is less than or equal to a predefined value. | boolean \n $more_than | A property is more than a predefined value. | boolean \n $more_than_or_equal | A property is more than or equal to a predefined value. | boolean \n $starts_with | A property starts with the predefined sequence of characters. | boolean, number \n $ends_with | A property ends with the predefined sequence of characters. | boolean, number \n $contains | A property contains the predefined sequence of characters. | boolean, number \n $timeframe | | boolean, number \n $dow | | boolean, string \n $count | | boolean, string \n $count_more | | boolean, string \n $count_less | | boolean, string ", + "properties": { + "$one_of_voucherify_conditions": { + "type": "array", + "description": "Contains a set of conditions for the rule.", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] } - }, - "allow_defined_only": true, - "created_at": "2022-03-07T11:01:01.747Z", - "updated_at": "2022-03-07T11:01:44.785Z", - "object": "metadata_schema" - }, - { - "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", - "related_object": "campaign", - "properties": { - "Store": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - }, - "locale": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_tag": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_time_tag": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "deleted": true, - "optional": true, - "objectType": null - }, - "height_customer_number": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_country_string": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + } + } + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2021-12-03T13:33:44.556Z", - "updated_at": "2022-07-26T13:57:42.288Z", - "object": "metadata_schema" - }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "birth_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "CRM_created_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "customer_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.894Z", - "updated_at": "2022-07-14T15:15:34.928Z", - "object": "metadata_schema" + "logic": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + } + }, + "logic": { + "type": "string", + "example": "(1 and 2) and (3)", + "description": "Defines the logic between the rules." + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." }, - { - "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", - "related_object": "earning_rule", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "minLength": 6, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:54:07.980Z", - "updated_at": null, - "object": "metadata_schema" + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." }, - { - "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", - "related_object": "loyalty_tier", - "properties": { - "has_funds": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:22:16.685Z", - "updated_at": "2022-07-27T08:55:01.628Z", - "object": "metadata_schema" + "source_id": { + "type": "string" }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "Payment": { - "type": "object", - "array": false, - "deleted": true, - "optional": true, - "objectType": "Payment" - }, - "day_of_week": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "number_of_store_visits": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.798Z", - "updated_at": "2022-04-20T06:47:10.350Z", - "object": "metadata_schema" + "strict": { + "type": "boolean" }, - { - "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", - "related_object": "order_item", - "properties": { - "Size": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "Color": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Thickness": { - "eq": [ - "Thin", - "Medium", - "Thick" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-11T13:32:55.029Z", - "updated_at": "2022-05-23T13:46:01.463Z", - "object": "metadata_schema" + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "color": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "origin": { - "type": "string", - "array": false, - "optional": true, - "minLength": 1, - "objectType": null - }, - "product_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_date_property": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_number_property": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_boolean_property": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_datetime_property": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.880Z", - "updated_at": "2022-07-14T15:46:47.994Z", - "object": "metadata_schema" + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." }, - { - "id": "ms_th8YHt9yFYY1yAA99XOasT5W", - "related_object": "promotion_tier", - "properties": { - "has_budget": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:21.523Z", - "updated_at": "2022-07-27T08:54:42.909Z", - "object": "metadata_schema" + "source_id": { + "type": "string" }, - { - "id": "ms_Z7niydc0OpGjDRL4yB40niXn", - "related_object": "publication", - "properties": { - "year": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:23:49.715Z", - "updated_at": "2022-04-19T10:28:24.568Z", - "object": "metadata_schema" + "strict": { + "type": "boolean" }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.890Z", - "updated_at": "2022-07-26T14:58:24.546Z", - "object": "metadata_schema" + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." }, - { - "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", - "related_object": "reward", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "objectType": null, - "exactLength": 4 + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } + } + }, + "created_at": { + "type": "string", + "example": "2022-03-23T07:44:00.444Z", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-04-26T08:35:54.960Z", + "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "basic", + "advanced", + "complex" + ], + "description": "Type of validation rule." + }, + "context_type": { + "type": "string", + "enum": [ + "earning_rule.order.paid", + "earning_rule.custom_event", + "earning_rule.customer.segment.entered", + "campaign.discount_coupons", + "campaign.discount_coupons.discount.apply_to_order", + "campaign.discount_coupons.discount.apply_to_items", + "campaign.discount_coupons.discount.apply_to_items_proportionally", + "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", + "campaign.discount_coupons.discount.fixed.apply_to_items", + "campaign.gift_vouchers", + "campaign.gift_vouchers.gift.apply_to_order", + "campaign.gift_vouchers.gift.apply_to_items", + "campaign.referral_program", + "campaign.referral_program.discount.apply_to_order", + "campaign.referral_program.discount.apply_to_items", + "campaign.referral_program.discount.apply_to_items_proportionally", + "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", + "campaign.referral_program.discount.fixed.apply_to_items", + "campaign.promotion", + "campaign.promotion.discount.apply_to_order", + "campaign.promotion.discount.apply_to_items", + "campaign.promotion.discount.apply_to_items_proportionally", + "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", + "campaign.promotion.discount.fixed.apply_to_items", + "campaign.loyalty_program", + "campaign.lucky_draw", + "voucher.discount_voucher", + "voucher.discount_voucher.discount.apply_to_order", + "voucher.discount_voucher.discount.apply_to_items", + "voucher.discount_voucher.discount.apply_to_items_proportionally", + "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", + "voucher.discount_voucher.discount.fixed.apply_to_items", + "voucher.gift_voucher", + "voucher.gift_voucher.gift.apply_to_order", + "voucher.gift_voucher.gift.apply_to_items", + "voucher.loyalty_card", + "voucher.lucky_draw_code", + "distribution.custom_event", + "reward_assignment.pay_with_points", + "global" + ], + "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + }, + "object": { + "type": "string", + "default": "validation_rules", + "description": "The type of object represented by JSON. This object stores information about the validation rule." + } + } + }, + "13_req_create_validation_rule": { + "title": "Create Validation Rule Request Body", + "type": "object", + "description": "Request body schema for **POST** `/validation-rules`.", + "properties": { + "name": { + "type": "string", + "description": "Custom, unique name for the set of validation rules.", + "example": "Business Validation Rule" + }, + "rules": { + "type": "object", + "description": "Contains all the rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", + "properties": { + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n| **Name** |\n|:---|\n| **Customer** |\n| customer.segment
                  customer.metadata* |\n| **Order** |\n| order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** |\n| campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |\n| redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** |\n| product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** |\n| sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** |\n| publication.redeemable_by_linked_customer |\n| **Custom Event** |\n| custom_event.metadata* |\n| **Order items** |\n| order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive |\n| order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n*Requires the `property` field to be defined." + }, + "property": { + "type": [ + "string", + "null" + ], + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" + }, + "conditions": { + "type": "object", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", + "properties": { + "$one_of_voucherify_conditions": { + "type": "array", + "description": "Contains a set of conditions for the rule.", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] + } + } + } + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } } }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:53:32.257Z", - "updated_at": "2022-07-27T08:53:48.542Z", - "object": "metadata_schema" + "logic": { + "type": "string" + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } + } + } + }, + "logic": { + "type": "string", + "example": "(1 and 2) and (3)", + "description": "Defines the logic between the rules." + } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." }, - { - "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", - "related_object": "voucher", + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." + }, + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } + } + } + } + }, + "13_res_list_validation_rules": { + "description": "Response body schema for listing validation rules. \n\nThis entity stores the [validation rules](ref:get-validation-rule) used to limit your resources.", + "type": "object", + "title": "List Validation Rules Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about validation rules.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of validation rules.", + "default": "data" + }, + "data": { + "type": "array", + "uniqueItems": true, + "description": "An array of validation rules.", + "items": { + "type": "object", + "description": "Stores information about the validation rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique validation rule ID.", + "example": "val_F4Artfc4HQIq" + }, + "name": { + "type": "string", + "description": "Custom, unique name for the set of validation rules." + }, + "rules": { + "type": "object", + "description": "A set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the rule.", "properties": { - "unit": { - "type": "number", - "array": false, - "optional": true, - "objectType": null + "name": { + "type": "string", + "description": "Voucherify specific rule name. The list of available names is provided below. \n\n**Name** |\n---- | -----------\n**Customer** | customer.segment
                  customer.metadata* \n**Order** |order.amount
                  order.items.count
                  order.items.price_any
                  order.items.price_each
                  order.items.metadata_any
                  order.items.metadata_each
                  order.metadata* |\n| **Campaign** | campaign.orders.amount_discounted
                  campaign.orders.amount
                  campaign.redemptions.count
                  campaign.redemptions.count.daily
                  campaign.redemptions.count.monthly
                  campaign.redemptions.customers_count
                  campaign.redemptions.customers_count.daily
                  campaign.redemptions.customers_count.monthly |\n| **Redemption** |redemption.gift.amount
                  redemption.count.daily
                  redemption.count.monthly
                  redemption.count.per_customer
                  redemption.count.per_customer.daily
                  redemption.count.per_customer.monthly
                  redemption.api_key
                  redemption.count.per_api_key
                  redemption.user.login
                  redemption.count.per_user
                  redemption.metadata*
                  redemption.reward.pay_with_points.points_used |\n| **Product** | product.id
                  product.price
                  product.quantity
                  product.discount_applicable
                  product.metadata*
                  product.metadata.aggregated_quantity
                  product.metadata.aggregated_amount
                  product.metadata.discount_applicable
                  product.metadata.match_all |\n| **SKU** | sku.id
                  sku.price
                  sku.quantity
                  sku.discount_applicable |\n| **Publication** | publication.redeemable_by_linked_customer |\n| **Custom Event** | custom_event.metadata* |\n| **Order items** | order.items.every
                  order.items.any
                  order.items.none
                  order.items.cheapest
                  order.items.most_expensive | order.items.quantity
                  order.items.aggregated_quantity
                  order.items.price
                  order.items.aggregated_amount
                  order.items.metadata* | \n\n\n*Requires the `property` field to be defined." + }, + "rules": { + "type": "object", + "description": "Contains all the nested rule definitions for the validation rule. It is a set of key value pairs representing the rules and logic between the rules. The keys are numbered consequtively beginning from `1`. The values are objects containing the rule conditions.", + "properties": { + "1": { + "type": "object", + "description": "Defines the nested rule.", + "properties": { + "name": { + "type": "string" + }, + "property": { + "type": "string" + }, + "conditions": { + "type": "object" + }, + "rules": { + "type": "object" + } + } + }, + "logic": { + "type": "string" + } + } }, - "Region": { + "property": { "type": "string", - "array": false, - "optional": true, - "objectType": null + "description": "Custom name for a metadata property associated with the condition to be satisfied. **Required** if the property `name` is any of the following: \n| **Name** |\n|:---|\n| customer_metadata |\n| custom_event_metadata |\n| order_items_metadata |\n| order_metadata |\n| product_metadata |\n| redemption_metadata |" }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "CATEGORY": { - "type": "string", - "array": false, - "optional": true, - "objectType": null + "conditions": { + "type": "array", + "description": "A set of key value pairs representing the condition name and value. The list of available conditions is provided below: \n| **Condition (key)** | **Definition** | **Does not support Types** |\n|:---|:---|:---|\n| $is | A property is a predefined value. | |\n| $is_not | A property is not a predefined value. | |\n| $in | A property either one value in a predefined list of values. | |\n| $less_than | A property is less than a predefined value. | boolean |\n| $less_than_or_equal | A property is less than or equal to a predefined value. | boolean |\n| $more_than | A property is more than a predefined value. | boolean |\n| $more_than_or_equal | A property is more than or equal to a predefined value. | boolean |\n| $starts_with | A property starts with the predefined sequence of characters. | boolean, number |\n| $ends_with | A property ends with the predefined sequence of characters. | boolean, number |\n| $contains | A property contains the predefined sequence of characters. | boolean, number |\n| $timeframe | | boolean, number |\n| $dow | | boolean, string |\n| $count | | boolean, string |\n| $count_more | | boolean, string |\n| $count_less | | boolean, string |", + "items": { + "type": [ + "string", + "integer", + "boolean" + ] + } }, - "active_on_calendar_month": { - "eq": [ - 1, - 2, - 3, - 5, - 7, - 9, - 10, - 11, - 12 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rule." + } + } } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:01.281Z", - "updated_at": "2022-06-22T07:22:09.577Z", - "object": "metadata_schema" + } + }, + "logic": { + "type": "string", + "description": "Defines the logic between the rules.", + "example": "(1 and 2) and (3)" } + } + }, + "error": { + "type": "object", + "description": "Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.", + "properties": { + "message": { + "type": "string", + "description": "The error message returned from API when validation / redemption fails to meet requirements of defined rules." + } + } + }, + "applicable_to": { + "type": "object", + "properties": { + "excluded": { + "type": "array", + "description": "Defines which items are excluded from a discount.", + "items": { + "type": "object", + "description": "Defines the excluded item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being excluded from the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY" + ], + "description": "Discount effect for an excluded resource." + } + } + } + }, + "included": { + "type": "array", + "description": "Defines which items are included in a discount.", + "items": { + "type": "object", + "description": "Defines the included item.", + "properties": { + "object": { + "type": "string", + "enum": [ + "product", + "sku", + "products_collection" + ], + "description": "The type of object being included in the rule." + }, + "id": { + "type": "string", + "description": "Unique product ID, SKU ID, product collection ID i.e. `prod_0b72b00ffed198e344z`, `sku_0b7d7dfb090be5c619`, `pc_4ndRXAsTOzwSdHcQcxf489uU`." + }, + "source_id": { + "type": "string" + }, + "strict": { + "type": "boolean" + }, + "effect": { + "type": "string", + "enum": [ + "APPLY_TO_EVERY", + "APPLY_TO_CHEAPEST", + "APPLY_TO_MOST_EXPENSIVE" + ], + "description": "Discount effect for an included resource." + }, + "quantity_limit": { + "type": "integer", + "description": "A limit on the number of units that at maximum can qualify for a discount. This property is present for an AMOUNT type discount when the effect is applied to ITEMS and each unit of matched products has the same discount value." + } + } + } + }, + "included_all": { + "type": "boolean", + "description": "Indicates whether all items are included in the discount." + } + } + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the validation rule was created in ISO 8601 format.", + "example": "2022-04-07T07:42:44.442Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-05-09T07:42:44.442Z", + "description": "Timestamp representing the date and time when the validation rule was updated in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "basic", + "advanced", + "complex" ], - "total": 13 + "description": "Type of validation rule." + }, + "context_type": { + "type": "string", + "enum": [ + "earning_rule.order.paid", + "earning_rule.custom_event", + "earning_rule.customer.segment.entered", + "campaign.discount_coupons", + "campaign.discount_coupons.discount.apply_to_order", + "campaign.discount_coupons.discount.apply_to_items", + "campaign.discount_coupons.discount.apply_to_items_proportionally", + "campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity", + "campaign.discount_coupons.discount.fixed.apply_to_items", + "campaign.gift_vouchers", + "campaign.gift_vouchers.gift.apply_to_order", + "campaign.gift_vouchers.gift.apply_to_items", + "campaign.referral_program", + "campaign.referral_program.discount.apply_to_order", + "campaign.referral_program.discount.apply_to_items", + "campaign.referral_program.discount.apply_to_items_proportionally", + "campaign.referral_program.discount.apply_to_items_proportionally_by_quantity", + "campaign.referral_program.discount.fixed.apply_to_items", + "campaign.promotion", + "campaign.promotion.discount.apply_to_order", + "campaign.promotion.discount.apply_to_items", + "campaign.promotion.discount.apply_to_items_proportionally", + "campaign.promotion.discount.apply_to_items_proportionally_by_quantity", + "campaign.promotion.discount.fixed.apply_to_items", + "campaign.loyalty_program", + "campaign.lucky_draw", + "voucher.discount_voucher", + "voucher.discount_voucher.discount.apply_to_order", + "voucher.discount_voucher.discount.apply_to_items", + "voucher.discount_voucher.discount.apply_to_items_proportionally", + "voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity", + "voucher.discount_voucher.discount.fixed.apply_to_items", + "voucher.gift_voucher", + "voucher.gift_voucher.gift.apply_to_order", + "voucher.gift_voucher.gift.apply_to_items", + "voucher.loyalty_card", + "voucher.lucky_draw_code", + "distribution.custom_event", + "reward_assignment.pay_with_points", + "global" + ], + "description": "Validation rule context type. \n\n| **Context Type** | **Definition** |\n|:---|:---|\n| earning_rule.order.paid | |\n| earning_rule.custom_event | |\n| earning_rule.customer.segment.entered | |\n| campaign.discount_coupons | |\n| campaign.discount_coupons.discount.apply_to_order | |\n| campaign.discount_coupons.discount.apply_to_items | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally | |\n| campaign.discount_coupons.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.discount_coupons.discount.fixed.apply_to_items | |\n| campaign.gift_vouchers | |\n| campaign.gift_vouchers.gift.apply_to_order | |\n| campaign.gift_vouchers.gift.apply_to_items | |\n| campaign.referral_program | |\n| campaign.referral_program.discount.apply_to_order | |\n| campaign.referral_program.discount.apply_to_items | |\n| campaign.referral_program.discount.apply_to_items_proportionally | |\n| campaign.referral_program.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.referral_program.discount.fixed.apply_to_items | |\n| campaign.promotion | |\n| campaign.promotion.discount.apply_to_order | |\n| campaign.promotion.discount.apply_to_items | |\n| campaign.promotion.discount.apply_to_items_proportionally | |\n| campaign.promotion.discount.apply_to_items_proportionally_by_quantity | |\n| campaign.promotion.discount.fixed.apply_to_items | |\n| campaign.loyalty_program | |\n| campaign.lucky_draw | |\n| voucher.discount_voucher | |\n| voucher.discount_voucher.discount.apply_to_order | |\n| voucher.discount_voucher.discount.apply_to_items | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally | |\n| voucher.discount_voucher.discount.apply_to_items_proportionally_by_quantity | |\n| voucher.discount_voucher.discount.fixed.apply_to_items | |\n| voucher.gift_voucher | |\n| voucher.gift_voucher.gift.apply_to_order | |\n| voucher.gift_voucher.gift.apply_to_items | |\n| voucher.loyalty_card | |\n| voucher.lucky_draw_code | |\n| distribution.custom_event | |\n| reward_assignment.pay_with_points | |\n| global | |" + }, + "assignments_count": { + "description": "The number of instances the validation rule has been assigned to different types of redeemables.", + "type": "integer" + }, + "object": { + "type": "string", + "default": "validation_rules", + "description": "The type of object represented by each nested object in the JSON `data` array. This object stores information about the validation rules." + } + } + } + }, + "total": { + "type": "integer", + "description": "Total number of validation rules in the project." + } + } + }, + "13_obj_validation_rule_assignment_object": { + "title": "Validation Rule Assignment Object", + "type": "object", + "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", + "x-tags": [ + "VALIDATION RULES API" + ], + "properties": { + "id": { + "type": "string", + "example": "asgm_74F7QZoYbUoljwQO", + "description": "Validation rule assignment ID." + }, + "rule_id": { + "type": "string", + "example": "val_4j7DCRm2IS59", + "description": "Validation rule ID." + }, + "related_object_id": { + "type": "string", + "example": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", + "description": "The resource ID to which the validation rule was assigned." + }, + "related_object_type": { + "type": "string", + "description": "The type of resource to which the validation rule was assigned.", + "enum": [ + "voucher", + "campaign", + "earning_rule", + "reward_assignment", + "promotion_tier", + "distribution" + ] + }, + "created_at": { + "type": "string", + "example": "2022-02-17T08:18:15.085Z", + "description": "Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "validation_rules_assignment", + "description": "The type of object represented by the ID." + } + } + }, + "13_res_validation-rules_validationRuleId_assignments": { + "type": "object", + "description": "Validation Rule Assignments", + "title": "Validation Rule Assignments", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about validation rule assignments.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of validation rule assignments.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of validation rule assignments.", + "items": { + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of validation rule assignments." + } + } + }, + "13_req_create_validation_rule_assignments": { + "description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.", + "title": "Create Validation Rule Assignments Request Body", + "oneOf": [ + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_voucher" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_campaign" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_promotion_tier" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_earning_rule" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_reward" + }, + { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments_distribution" + } + ] + }, + "13_req_create_validation_rule_assignments_voucher": { + "type": "object", + "description": "Assign a validation rule to a voucher.", + "title": "Voucher", + "properties": { + "voucher": { + "type": "string", + "description": "Unique voucher ID or code to which you would like to assign the validation rule to.", + "example": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" + } + } + }, + "13_req_create_validation_rule_assignments_campaign": { + "type": "object", + "description": "Assign a validation rule to a campaign.", + "title": "Campaign", + "properties": { + "campaign": { + "type": "string", + "description": "Unique campaign ID or name to which you would like to assign the validation rule to.", + "example": "camp_HXsR22VUMC4hN4DR7eAhCalp" + } + } + }, + "13_req_create_validation_rule_assignments_promotion_tier": { + "type": "object", + "description": "Assign a validation rule to a promotion tier.", + "title": "Promotion Tier", + "properties": { + "promotion_tier": { + "type": "string", + "description": "Unique promotion tier ID to which you would like to assign the validation rule to.", + "example": "promo_Vet0vCNyyo5pOddHfu2X3FCB" + } + } + }, + "13_req_create_validation_rule_assignments_earning_rule": { + "type": "object", + "description": "Assign a validation rule to an earning rule.", + "title": "Earning Rule", + "properties": { + "earning_rule": { + "type": "string", + "description": "Unique earning rule ID to which you would like to assign the validation rule to.", + "example": "ern_CfvQ4vWEKD4kHTxghdY8YJGs" + } + } + }, + "13_req_create_validation_rule_assignments_reward": { + "type": "object", + "description": "Assign a validation rule to a reward.", + "title": "Reward", + "properties": { + "related_object_id": { + "type": "string", + "description": "Unique reward assignment ID, i.e. rewa_6VSWcXjfm5PuZlfeuZxl5JZT. This is the first parameter to be sent for a validation rule assignment to be assigned to a reward assignment. The prerequisites for assigning a validation rule to a reward assignment are: \n1. Define a loyalty campaign. \n2. Connect a reward with the campaign. \n3. Retrieve a reward assignment ID for the reward assigned to the loyalty campaign. \n4. And finally you can use this endpoint to assign a validation rule to the particular reward assignment.", + "example": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT" + }, + "related_object_type": { + "type": "string", + "description": "This is the second parameter that needs to be sent in order to properly assign a validation rule to a reward assignment.", + "example": "reward_assignment", + "default": "reward_assignment", + "enum": [ + "reward_assignment" + ] + } + } + }, + "13_req_create_validation_rule_assignments_distribution": { + "type": "object", + "description": "Assign a validation rule to a distribution.", + "title": "Distribution", + "properties": { + "distribution": { + "type": "string", + "description": "Unique distribution ID to which you would like to assign the validation rule to.", + "example": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + } + } + }, + "14_obj_segment_object": { + "title": "Customer Segment Object", + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "seg_1wc52c5z6r1kQ81brO8j9Hk2", + "description": "Unique segment ID." + }, + "name": { + "type": "string", + "description": "Segment name." + }, + "created_at": { + "type": "string", + "example": "2022-05-12T13:01:56.896Z", + "description": "Timestamp representing the date and time when the segment was created in ISO 8601 format.", + "format": "date-time" + }, + "type": { + "type": "string", + "enum": [ + "auto-update", + "static" + ], + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers)." + }, + "filter": { + "type": [ + "object", + "null" + ], + "description": "Defines a set of criteria for an `auto-update` segment type. " + }, + "initial_sync_status": { + "type": "string", + "enum": [ + "IN_PROGRESS", + "DONE" + ] + }, + "object": { + "type": "string", + "default": "segment", + "description": "The type of object represented by JSON. This object stores information about the customer segment." + } + }, + "description": "This is an object representing a customer segment.", + "x-tags": [ + "SEGMENTS API" + ] + }, + "14_req_create_segment": { + "title": "Create Customer Segment Request Body", + "description": "Request body schema for **POST** `/segments`.", + "oneOf": [ + { + "$ref": "#/components/schemas/14_req_create_segment_static" + }, + { + "$ref": "#/components/schemas/14_req_create_segment_dynamic" + } + ] + }, + "14_req_create_segment_static": { + "title": "Static Customer Segment", + "type": "object", + "description": "Request body schema for creating a static customer segment in **POST** `/segments`.", + "properties": { + "name": { + "type": "string", + "description": "Segment name." + }, + "type": { + "type": "string", + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", + "default": "static" + }, + "customers": { + "type": "array", + "description": "Array of customer IDs.", + "items": {} + } + } + }, + "14_req_create_segment_dynamic": { + "title": "Dynamic Customer Segment", + "type": "object", + "description": "Request body schema for creating a dynamic customer segment in **POST** `/segments`.", + "properties": { + "name": { + "type": "string", + "description": "Segment name." + }, + "type": { + "type": "string", + "description": "Describes whether the segment is dynamic (customers come in and leave based on set criteria) or static (manually selected customers).", + "default": "auto-update" + }, + "filter": { + "type": "object", + "description": "Defines a set of criteria for an `auto-update` segment type." + } + } + }, + "14_res_customers_customerId_segments": { + "type": "object", + "title": "List Segments for Customer Response Body", + "description": "Response body schema for `/customers/{customerId}/segments`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about customer segments.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the JSON property that contains the array of segment IDs.", + "default": "data" + }, + "data": { + "type": "array", + "description": "A dictionary that contains an array of segment IDs and names.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique segment ID.", + "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" + }, + "name": { + "type": "string", + "description": "Segment name." + }, + "object": { + "type": "string", + "description": "The type of object represented by the ID.", + "default": "segment" + } + } + } + }, + "total": { + "type": "integer", + "description": "Total number of segments the customer belongs to." + } + } + }, + "15_obj_event_object": { + "title": "Event Object", + "type": "object", + "description": "This is an object representing an event. \n\nVoucherify distinguishes two types of events - custom and internal. Both are presented in the same Event structure. \n\n## Custom Events\n\nCustom Events are actions taken by your customers. They’re best suited for tracking high-value customer interactions with your application. Logging a custom event can trigger any number of distributions, and enables the segmentation filters around the recency and frequency of that event.\n\nWith Custom Event metadata field, Voucherify allows you to set properties on custom events. These properties can then be used for further qualifying trigger conditions, increasing personalization in messaging, and generating more sophisticated analytics through raw data export.\n\nThe Custom Events are directly linked to the customers' resources from Voucherify. It means that each event gets a connection to a customer. \n\n\n> #### An example \n>\n> If an e-commerce application wanted to send a message to a user when he/she abandons their cart, the custom event could additionally improve its target audience and allow for increased distribution personalization by adding a Custom Event of the `value` of customers’ order.\n\n## Internal Voucherify Events \n\nMoreover, Events are our way of letting you know when something interesting happens in your project. When an interesting event occurs, we create a new Event object. For example, when a redemption succeeds, we create a `redemption.succeeded` event.\n\nNote that many API requests may cause multiple events to be created. For example, if you create a new redemption for a new customer not existing yet in Voucherify, you will receive both a `customer.created` event and a `redemption.succeeded` event.\n\nThe events occur when the state of another API resource changes and the state of that resource at the time of the change is embedded in the data field of the event. \n\n| **Types of internal events** |\n|:---|\n| **Campaign** |\n| campaign.validation_rules.created
                  campaign.created
                  campaign.disabled
                  campaign.export_mailchimp_scheduled
                  campaign.export_mailchimp_done
                  campaign.validation_rules.deleted
                  campaign.validation_rules.updated
                  campaign.updated
                  campaign.deleted
                  campaign.export_mailchimp_failed
                  campaign.enabled |\n| **Voucher** |\n| voucher.validation.succeeded
                  voucher.updated
                  voucher.enabled
                  voucher.gift.balance_added
                  voucher.validation_rules.updated
                  voucher.published
                  voucher.validation_rules.deleted
                  voucher.disabled
                  voucher.validation.failed
                  voucher.validation_rules.created
                  voucher.deleted
                  voucher.created |\n| **Redemption** |\n| redemption.succeeded
                  redemption.failed
                  redemption.rollback.failed
                  redemption.rollback.succeeded |\n| **Customer** |\n| customer.rewarded
                  customer.rewarded.loyalty_points
                  customer.sms.sent
                  customer.email.failed
                  customer.deleted
                  customer.created
                  customer.updated
                  customer.segment.left
                  customer.sms.failed
                  customer.segment.entered
                  customer.email.sent |\n| **Order** |\n| order.canceled
                  order.created
                  order.updated
                  order.paid |\n| **Product** |\n| product.updated
                  product.created
                  product.deleted |\n| **SKU** |\n| sku.updated
                  sku.created
                  sku.deleted |\n| **Distribution** |\n| distribution.sms.failed
                  distribution.sms.sent
                  distribution.email.sent
                  distribution.email.failed |\n| **Export** |\n| export.done
                  export.scheduled
                  export.failed
                  export.deleted | \n\n## Webhooks \n\nVoucherify also has a separate system for sending the event objects directly to an endpoint at your end (server). We called that mechanism webhooks. They are managed in your project settings. \n\n| **Attribute** | **Description** | **Example** |\n|:---|:---|:---|\n| `id`
                  string | | event_xjGas2mI2PduFFPL2NAcFeHkHfLn3H |\n| `object`
                  string | Type of the object represented by JSON. Value is `event`. | |\n| `created_at`
                  string, ISO 8601 date format | Time at which the object was created. | 2016-11-16T14:14:31Z |\n| `type`
                  string | Description of the event | view_pricing_page
                  redemption.succeeded |\n| `data.object`
                  object | The object containing data associated with the event. It can be a `customer`, `redemption` or any other type of object which is a source of the event. In this object structure, you can also find a property `related_object` which contains values presenting any other resource connected to the event.

                  For Custom Event the structure of child attributes is constant:

                  - customer (`object`) - The object presenting a profile of the related customer who performed an action.

                  - metadata (`object`) - A set of key/value pairs that you can attach to a custom event object. It can be useful for storing additional information about the event in a structured format. | \"data\": { \"object\": { \"customer\": { \"id\": \"cust_OtHDKrv5sJrjd8aYBYZ6AOIF\", \"name\": \"Gustav Purpleson\", \"object\": \"customer\", \"source_id\": \"gustav@purpleson.com\", \"created_at\": 1510834859417, \"updated_at\": 1510835106559 }, \"metadata\": { \"lang\": \"en\", \"test\": true, \"page\": \"http://main.io\" } } } |\n| `metadata`
                  object | A set of key/value pairs that Voucherify attaches to a custom event object. It is a set of additional system information about the event in a structured format. | |\n\n\n```json\n{\n \"id\": \"event_ehkvgZFgSePlb95SH3JJulkApy9Kg9\",\n \"object\": \"event\",\n \"created_at\": \"2017-11-16T14:45:34.181Z\",\n \"type\": \"redemption.succeeded\",\n \"data\": {\n \"object\": {\n \"id\": \"r_mist0IpebikTaRdxiOGI2IhL\",\n \"date\": \"2017-11-16T14:45:32.733Z\",\n \"order\": {\n \"id\": \"ord_AhDlR13vQE5ino95P2NIABBN\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"sku_id\": null,\n \"quantity\": 1,\n \"source_id\": null,\n \"product_id\": \"iphone8\"\n }\n ],\n \"amount\": 50000,\n \"object\": \"order\",\n \"status\": \"CREATED\",\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": null,\n \"referrer\": null,\n \"source_id\": null,\n \"created_at\": \"2017-11-16T14:45:32.023Z\",\n \"updated_at\": null,\n \"discount_amount\": 2000\n },\n \"object\": \"redemption\",\n \"result\": \"SUCCESS\",\n \"voucher\": {\n \"code\": \"2017-goX-aH\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"object\": \"voucher\",\n \"campaign\": \"SteffenTest\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 2000\n },\n \"is_referral_code\": false\n },\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": {\n \"city\": \"London1\"\n },\n \"customer_id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"tracking_id\": \"track_3tM7KR57bbeIRtMcvpKYr2aAOrCpYBDZ\",\n \"related_object_type\": \"voucher\"\n },\n \"previous_attributes\": {}\n },\n \"metadata\": {\n \"source\": \"API\"\n }\n}\n```\n\n## Customisable Campaign Events \n\nAs part of campaign creation, users can configure webhooks triggered when specific activities appear within a campaign's lifetime. Those webhooks get configurable names and the users implement them in Voucherify Dashboard as part of the campaign creation process.\n\nThis type of webhooks can be configured for the following actions: \n\n| **Action** |\n|:---|\n| **Referral Program** |\n| Referrer rewarded
                  Referral code assigned
                  Customer referred |\n| **Loyalty Campaign** |\n| Loyalty card assigned
                  Points earned
                  Points redeemed | \n\nPayloads of customizable webhooks:\n\n### Referral Program\n\n\n```json\n{\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:09:57.765Z\",\n \"type\": \"referral_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"is_referral_code\": true,\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 1,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:00:08.306Z\",\n \"updated_at\": \"2021-11-12T11:09:40.671Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null,\n \"last_order_date\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:09:57.749Z\",\n \"updated_at\": \"2021-11-12T11:09:58.620Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null,\n \"value\": \"$10.00\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:09:57.765Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:49.723Z\",\n \"type\": \"referrer_rewarded_webhook\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/k\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1+tdyBGQeM+ZONM/k\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 1,\n \"campaigns\": {\n \"Referral Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 1\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:09:57.749Z\",\n \"updated_at\": \"2021-01-24T11:19:41.513Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_9Y7nwUx3BaU3cHqBVbd0TEtS2ENiFZhJ\",\n \"created_at\": \"2021-01-24T11:19:40.317Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"test_referrer__01\",\n \"metadata\": {},\n \"channel\": \"Automation\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"dOzJ84Ky\",\n \"vouchers\": [\n {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/kBdZ\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BtdyBGQeM%2BZONM%2FkBdZ\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\"\n ],\n \"campaign_name\": \"Bonus Cards\",\n \"gift\": {\n \"amount\": 0,\n \"balance\": 0\n },\n \"loyalty_card\": null,\n \"discount\": null,\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"is_referral_code\": true,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_Fuzc1rngCCuKRDfBXBjUwl5j\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-01-24T11:19:43.883Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"reward_assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"source_id\": \"event_0a26b3d269013fc79e\",\n \"source_type\": \"redemption_event\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"type\": \"GIFT_VOUCHER\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"object\": \"reward\",\n \"name\": \"Credits - 5$\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"reward_id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"related_object_id\": \"rrt_NWk1WYi1sZs3Epjvvd5a9JZx\",\n \"related_object_type\": \"referral_tier\",\n \"created_at\": \"2021-01-24T11:00:08.471Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"event_0a26b3d269013fc79e\",\n \"type\": \"redemption_event\"\n },\n \"balance\": {\n \"amount\": 500\n }\n },\n \"created_at\": \"2021-01-24T11:19:49.723Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:41.101Z\",\n \"type\": \"referee_invited\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": \"2021-01-24T11:09:40.671Z\",\n \"created_at\": \"2021-01-24T11:00:08.306Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"type\": \"customer.referred\",\n \"created_at\": \"2021-01-24T11:19:34.223Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {}\n },\n \"metadata_json\": {\n \"is_rewarded\": true,\n \"source\": null\n },\n \"automation_id\": null,\n \"group_id\": \"v-0a26b3d24b032c4871\"\n }\n },\n \"metadata\": {}\n}\n```\n\n### Loyalty Campaign \n\n\n```json\n{\n \"id\": \"evcus_0a26b89763051ed721\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"type\": \"loyalty_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 0,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:40:19.724Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"value\": 0\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b89763051ed721\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:40:18.125Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b9290fc4891587\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:42:51.380Z\",\n \"type\": \"points_earned\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 220\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": \"2021-11-12T11:42:50.332Z\",\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": {\n \"distr_naR4rx0AgM1baWZkFm1kfHn7A9\": {\n \"date\": \"2021-11-12T11:40:21.957Z\"\n },\n \"distr_pnfPKLDAxUpiPi3ZsuMrygtYNN\": {\n \"date\": \"2021-11-12T11:42:50.332Z\"\n }\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n }\n },\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": null,\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": null,\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 220\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 220,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 220,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:47.393Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b9290fc4891587\",\n \"type\": \"customer.rewarded.loyalty_points\",\n \"created_at\": \"2021-11-12T11:42:47.359Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:40.635Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n },\n \"balance\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n }\n },\n \"metadata_json\": {\n \"source\": \"Automation\"\n },\n \"automation_id\": \"auto_McXM3rjWcPwaNU5ndIIP13jX\",\n \"group_id\": \"v-0a26b921779d7eebcb\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json \n{\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:53:09.910Z\",\n \"type\": \"points_redeemed\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 1,\n \"total_failed\": 0,\n \"total_succeeded\": 1,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 218,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 218,\n \"referred_customers\": 0\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:53:07.582Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_aFszQ4kOtT1Hori8Wl1i0az1sFQN3CRv\",\n \"created_at\": \"2021-11-12T11:53:03.172Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"Loyal_customer__01\",\n \"metadata\": {},\n \"channel\": \"API\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"xUgBLQck\",\n \"vouchers\": [\n {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\"\n ],\n \"campaign_name\": \"20% discount\",\n \"gift\": null,\n \"loyalty_card\": null,\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 218\n },\n \"type\": \"LOYALTY_CARD\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_uATcoUjIp3VJNgT5TZT5NMaT\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-11-12T11:53:06.025Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"reward_assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"source_id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"source_type\": \"redemption\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"object\": \"reward\",\n \"name\": \"20% discount\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"reward_id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"related_object_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"related_object_type\": \"campaign\",\n \"parameters\": {\n \"loyalty\": {\n \"points\": 2\n }\n },\n \"created_at\": \"2021-11-12T11:39:05.504Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"type\": \"redemption\"\n },\n \"balance\": null\n },\n \"created_at\": \"2021-11-12T11:53:09.910Z\"\n }\n },\n \"metadata\": {}\n}\n```", + "x-tags": [ + "EVENTS API" + ] + }, + "15_req_track_custom_event": { + "title": "Track Custom Event Request Body", + "type": "object", + "description": "Request schema for tracking a custom event.", + "properties": { + "event": { + "type": "string", + "description": "Event name. This is the same name that you used to define a custom event in the **Dashboard** > **Project Settings** > **Event Schema**." + }, + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_id" + }, + { + "$ref": "#/components/schemas/6_req_validate_voucher_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" + } + ], + "type": "object" + }, + "referral": { + "type": "object", + "description": "If a **conversion event** for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event. ", + "properties": { + "code": { + "type": "string", + "description": "A code through which a new visitor has been referred to a service." + }, + "referrer_id": { + "type": "string", + "description": "Unique ID of the referring person - it is optional and not required if the referral **code** is provided.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } + } + }, + "loyalty": { + "type": "object", + "description": "If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.", + "properties": { + "code": { + "type": "string", + "description": "Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the `event` parameter of the request payload gets sent along with this loyalty card code." + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the **Dashboard** > **Project Settings** > **Event Schema** > **Edit particular event** > **Metadata property definition**." + } + } + }, + "15_res_track_custom_event": { + "title": "Track Custom Event Request Body", + "type": "object", + "description": "Request schema for tracking a custom event.", + "properties": { + "object": { + "type": "string", + "default": "event", + "description": "The object represented is an `event`." + }, + "type": { + "type": "string", + "description": "The event name." + }, + "customer": { + "type": "object", + "description": "An empty customer object." + }, + "referral": { + "type": "null", + "description": "A `null` referral object." + }, + "loyalty": { + "type": "null", + "description": "A `null` loyalty object." + } + } + }, + "16_obj_export_object": { + "title": "Export Object", + "type": "object", + "description": "This is an object representing an export. \n\nThe `/exports` endpoint allows you to retrieve Voucherify objects such as [vouchers](ref:get-voucher), [redemptions](ref:list-redemptions), [publications](ref:list-publications), [customers](ref:get-customer), and [orders](ref:get-order) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can [get](ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported and `filter` out the relevant data\n\n\n```json\n{\n \"fields\": [\n \"code\",\n \"voucher_type\"\n ],\n \"filters\": {\n \"categories\": {\n \"conditions\": {\n \"$in\": [\n \"postman\"\n ]\n }\n }\n }\n}\n```\n\n\n## Fields values\nHere is a list of the fields you can export for particular objects. \n| **Object** | **Fields** |\n|:---|:---|\n| voucher | 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
                  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
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| redemption | 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
                  metadata.X *where X is the name of a particular metadata property* |\n| publication | voucher_code
                  customer_id
                  customer_source_id
                  date
                  channel
                  campaign
                  is_winner
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| customer | 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
                  birthdate
                  birthday
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| order | id
                  source_id
                  status
                  created_at
                  updated_at
                  amount
                  discount_amount
                  items_discount_amount
                  total_discount_amount
                  total_amount
                  customer_id
                  referrer_id
                  metadata
                  metadata.X *where X is the name of a particular metadata property* |\n| points expiration | id
                  campaign_id
                  voucher_id
                  expires_at
                  status
                  points |\n\n\n## Pagination and example request\nVoucherify allows you to specify the timeframe for the records you want to retrieve. Thanks to this mechanism it should be easy to implement a pagination mechanism. See the example of request body: \n\n\n```json Export Redemption Example\n{\n \"exported_object\": \"redemption\",\n \"parameters\": {\n \"order\": \"-created_at\",\n \"fields\": [\n \"id\",\n \"object\",\n \"date\",\n \"voucher_code\",\n \"customer_id\",\n \"result\"\n ],\n \"filters\": {\n \"junction\": \"and\",\n \"created_at\": {\n \"conditions\": {\n \"$after\": [\n \"2018-05-30T22:00:00.000Z\"\n ],\n \"$before\": [\n \"2018-06-29T22:00:00.000Z\"\n ]\n }\n }\n }\n }\n}\n```\n\nAn export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "x-tags": [ + "EXPORTS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique export ID.", + "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" + }, + "object": { + "type": "string", + "default": "export", + "description": "The type of object being represented. This object stores information about the `export`." + }, + "created_at": { + "type": "string", + "example": "2022-04-28T11:23:20.922Z", + "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", + "format": "date-time" + }, + "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", + "IN_PROGRESS", + "DONE", + "ERROR" + ] + }, + "channel": { + "type": "string", + "description": "The channel through which the export was triggered.", + "enum": [ + "API", + "WEBSITE" + ] + }, + "exported_object": { + "type": "string", + "description": "The type of exported object.", + "enum": [ + "order", + "voucher", + "publication", + "redemption", + "customer", + "points_expiration", + "voucher_transactions" + ] + }, + "parameters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_export_order" + }, + { + "$ref": "#/components/schemas/16_obj_export_voucher" + }, + { + "$ref": "#/components/schemas/16_obj_export_publication" + }, + { + "$ref": "#/components/schemas/16_obj_export_redemption" + }, + { + "$ref": "#/components/schemas/16_obj_export_customer" + }, + { + "$ref": "#/components/schemas/16_obj_export_points_expiration" + }, + { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + } + ] + }, + "result": { + "type": "object", + "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](ref:download-export) method." + } + } + }, + "user_id": { + "type": "string", + "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", + "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" + } + } + }, + "16_res_list_exports": { + "description": "Response schema for listing exports.", + "type": "object", + "title": "List Exports Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about exports.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of exports.", + "default": "exports" + }, + "exports": { + "type": "array", + "uniqueItems": true, + "description": "An array of export objects.", + "items": { + "$ref": "#/components/schemas/16_obj_export_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of exports." + } + } + }, + "16_req_create_export_POST": { + "description": "Request schema for creating an export.", + "type": "object", + "title": "Create Export Request Body", + "properties": { + "exported_object": { + "type": "string", + "description": "The type of object to be exported.", + "enum": [ + "order", + "voucher", + "publication", + "redemption", + "customer", + "points_expiration", + "voucher_transactions" + ] + }, + "parameters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_export_order" + }, + { + "$ref": "#/components/schemas/16_obj_export_voucher" + }, + { + "$ref": "#/components/schemas/16_obj_export_publication" + }, + { + "$ref": "#/components/schemas/16_obj_export_redemption" + }, + { + "$ref": "#/components/schemas/16_obj_export_customer" + }, + { + "$ref": "#/components/schemas/16_obj_export_points_expiration" + }, + { + "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + }, + { + "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" + } + ] + } + } + }, + "16_obj_export_order": { + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data.", + "title": "order", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at", + "updated_at", + "-updated_at", + "status", + "-status" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |", + "items": { + "type": "string" + } + }, + "filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_order_status" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_source_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_total_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_discount_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_total_discount_amount" + }, + { + "$ref": "#/components/schemas/16_obj_filter_order_items_discount_amount" + } + ] + } + } + }, + "16_obj_export_voucher": { + "description": "List of available fields and filters that can be exported with a voucher along with the sorting order of the returned data.", + "title": "voucher", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] + }, + "fields": { + "type": "array", + "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", + "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", + "metadata" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                  `GIFT_VOUCHER`: amount left to spend
                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| metadata | Returns all voucher metadata. | Response will include all voucher metadata. |\n| metadata.X | Where X is the name of a particular voucher metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Voucher. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata). |\n", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `categories`\n\n - `vouchers`\n\n - `type`\n\n - `holder_id`\n\n - `is_referral_code`\n\n - `published_for_customer_id`\n\n - `validity_timeframe`\n\n - `category_ids`" + } + } + }, + "16_obj_export_publication": { + "description": "List of available fields and filters that can be exported with a publication along with the sorting order of the returned data.", + "title": "publication", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at", + "channel", + "-channel" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "voucher_code", + "customer_id", + "customer_source_id", + "date", + "channel", + "campaign", + "is_winner", + "metadata" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Returns all publication metadata. | Response will include all publication metadata. |\n| metadata.X | Where X is the name of a particular publication metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Publication. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `failure_code`\n\n - `result`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `voucher_type`\n\n - `is_referral_code`\n\n - `parent_object_id`\n\n - `related_object_id`\n\n - `source_id`", + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_publication_failure_code" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_result" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_customer_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_campaign_name" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_voucher_type" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_is_referral_code" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_parent_object_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_related_object_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_publication_source_id" + } + ] + } + } + }, + "16_obj_export_redemption": { + "description": "List of available fields and filters that can be exported with a redemption along with the sorting order of the returned data.", + "title": "redemption", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Returns all redemption metadata. | Response will include all redemption metadata. |\n| metadata.X | Where X is the name of a particular redemption metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Redemption. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `voucher_code`\n\n - `related_object_id`\n\n - `related_object_parent_id`\n\n - `parent_redemption_id`\n\n - `failure_code`\n\n - `result`\n\n - `object`\n\n - `customer_id`\n\n - `campaign_name`\n\n - `user_login`" + } + } + }, + "16_obj_export_customer": { + "description": "List of available fields and filters that can be exported with a customer along with the sorting order of the returned data.", + "title": "customer", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "name", + "-name", + "id", + "-id", + "email", + "-email", + "source_id", + "-source_id", + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "fields": { + "type": "array", + "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" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 50 |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | |\n| loyalty_referred_customers | How many customers were referred by this customer. | |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| birthdate | Customer's birthdate. | 2022-04-29 |\n| metadata | Returns all customer metadata. | Response will include all customer metadata. |\n| metadata.X | Where X is the name of a particular customer metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Customer. [Read more here](https://support.voucherify.io/article/99-schema-validation-metadata) |", + "items": { + "type": "string" + } + }, + "filters": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `name` (string)\n\n - `email` (string)\n\n - `phone` (string)\n\n - `metadata` (json)\n\n - `metadata.X` (?)\n\n - `address` (json)\n\n - `address.state` (string)\n\n - `address.country` (string)\n\n - `address.postal_code` (string)\n\n - `birthday` (string - date-time)\n\n - `birthdate` (string date-time)\n\n - `created_at` (date)\n\n - `source_id` (string)\n\n - `system.metadata` (json)\n\n - `system.metadata.source` (string)\n\n - `system.metadata.consents.unsubscribed` (boolean)\n\n - `loyalty_points` (json)\n\n - `loyalty` (json)\n\n - `summary.orders.total_amount` (json)\n\n - `summary.orders.last_order_date` (date)\n\n - `summary.orders.last_order_amount` (json)\n\n - `summary.redemptions.gift.redeemed_amount` (integer)\n\n - `summary.redemptions.total_succeeded` (integer)\n\n - `events.cart_abandoned.last_occurred` (integer)\n\n - `events.newsletter_subscribed.count` (integer)\n\n - `events.sign_up.last_occurred` (integer)" + } + } + }, + "16_obj_export_points_expiration": { + "description": "List of available fields and filters that can be exported with points expirations along with the sorting order of the returned data.", + "title": "points expiration", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "expires_at", + "-expires_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ] + ], + "description": "Array of strings containing the data that was exported. These fields define the headers in the CSV file. \n\n The array can be a combintation of any of the following available fields: \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |", + "items": { + "type": "string" + } + }, + "filters": { + "description": "Data filters used to narrow the data records to be returned in the export. You can filter the following parameters: \n\n - `campaign_id`\n\n - `voucher_id`", + "anyOf": [ + { + "$ref": "#/components/schemas/16_obj_filter_points_expiration_campaign_id" + }, + { + "$ref": "#/components/schemas/16_obj_filter_points_expiration_voucher_id" + } + ] + } + } + }, + "16_obj_export_gift_card_transactions": { + "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.", + "title": "gift card transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "source", + "details" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "items": { + "type": "string" + } + }, + "filters": { + "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id" + } + } + }, + "16_obj_export_loyalty_card_transactions": { + "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", + "title": "loyalty card transactions", + "type": "object", + "properties": { + "order": { + "type": "string", + "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", + "enum": [ + "-created_at", + "created_at" + ] + }, + "fields": { + "type": "array", + "enum": [ + [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + ], + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "items": { + "type": "string" + } + }, + "filters": { + "$ref": "#/components/schemas/16_obj_filter_loyalty_card_transactions_voucher_id" + } + } + }, + "16_obj_filter_publication_failure_code": { + "description": "Filter conditions set on the publication `failure_code`. Available options are:\n\n - `not_found`,\n\n - `no_voucher_suitable_for_publication`\n\n - `voucher_already_published`\n\n - `duplicate_source_id`\n\n - `too_many_vouchers_requested`", + "title": "Filter by failure code", + "type": "object", + "properties": { + "failure_code": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_result": { + "description": "Filter conditions set on the publication `result`. Available options are:\n\n - `SUCCESS`\n\n - `FAILURE`", + "title": "Filter by result", + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_customer_id": { + "description": "Filter conditions set on the publication `customer_id`.", + "title": "Filter by customer ID", + "type": "object", + "properties": { + "customer_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_campaign_name": { + "description": "Filter conditions set on the publication `campaign_name`.", + "title": "Filter by campaign name", + "type": "object", + "properties": { + "campaign_name": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_voucher_type": { + "description": "Filter conditions set on the publication `voucher_type`.", + "title": "Filter by voucher type", + "type": "object", + "properties": { + "voucher_type": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_is_referral_code": { + "description": "Filter conditions set on the publication `is_referral_code`.", + "title": "Filter if the code is a referral code", + "type": "object", + "properties": { + "is_referral_code": { + "$ref": "#/components/schemas/16_filter_conditions_boolean" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_parent_object_id": { + "description": "Filter conditions set on the publication `parent_object_id`, which is the parent campaigns unique ID assigned by Voucherify.", + "title": "Filter by parent object ID", + "type": "object", + "properties": { + "parent_object_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_related_object_id": { + "description": "Filter conditions set on the publication `related_object_id`.", + "title": "Filter by related object ID", + "type": "object", + "properties": { + "related_object_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_publication_source_id": { + "description": "Filter conditions set on the publication `source_id`.", + "title": "Filter by publication source ID", + "type": "object", + "properties": { + "source_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_status": { + "description": "Filter conditions set on the order `status`.", + "title": "Filter by status", + "type": "object", + "properties": { + "status": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_source_id": { + "description": "Filter conditions set on the order `source_id`.", + "title": "Filter by order source ID", + "type": "object", + "properties": { + "source_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_amount": { + "description": "Filter conditions set on the order `amount`.", + "title": "Filter by order amount", + "type": "object", + "properties": { + "amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_total_amount": { + "description": "Filter conditions set on the order `total_amount`.", + "title": "Filter by order total amount", + "type": "object", + "properties": { + "total_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_discount_amount": { + "description": "Filter conditions set on the order `discount_amount`.", + "title": "Filter by order discount amount", + "type": "object", + "properties": { + "discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_total_discount_amount": { + "description": "Filter conditions set on the order `total_discount_amount`.", + "title": "Filter by order total discount amount", + "type": "object", + "properties": { + "total_discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_order_items_discount_amount": { + "description": "Filter conditions set on the order `items_discount_amount`.", + "title": "Filter by order items discount amount", + "type": "object", + "properties": { + "items_discount_amount": { + "$ref": "#/components/schemas/16_filter_conditions_number" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_points_expiration_campaign_id": { + "description": "Filter conditions set on`the `campaign_id`.", + "title": "Filter by campaign ID", + "type": "object", + "properties": { + "campaign_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_points_expiration_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_gift_card_transactions_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_obj_filter_loyalty_card_transactions_voucher_id": { + "description": "Filter conditions set on`the `voucher_id`.", + "title": "Filter by voucher ID", + "type": "object", + "properties": { + "voucher_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "16_filter_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.", + "title": "Logical Operator Between Filters", + "type": "string", + "enum": [ + "AND", + "OR" + ] + }, + "16_filter_conditions_string": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" } - ] - }, - "22_res_list_locations": { - "title": "List Locations Response Body", + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + } + } + } + } + }, + "16_filter_conditions_number": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "integer" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "integer" + } + }, + "$is": { + "type": "integer", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "integer", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$more_than": { + "type": "integer", + "description": "Value is more than the specified number." + }, + "$more_than_equal": { + "type": "integer", + "description": "Value is more than or equal to the specified number." + }, + "$less_than": { + "type": "integer", + "description": "Value is less than the specified number." + }, + "$less_than_equal": { + "type": "integer", + "description": "Value is less than or equal to the specified number." + } + } + } + } + }, + "16_filter_conditions_array": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$not_in": { + "type": "array", + "description": "Array of resource values that should be included in the results. (multiple values)", + "items": { + "type": "string" + } + }, + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + }, + "$starts_with": { + "type": "string", + "description": "Value starts with the specified string." + }, + "$ends_with": { + "type": "string", + "description": "Value ends with the specified string." + }, + "$count": { + "type": "integer", + "description": "Value has exactly this number of elements." + }, + "$count_less": { + "type": "integer", + "description": "Value has less than this number of elements." + }, + "$count_more": { + "type": "integer", + "description": "Value has more than this number of elements." + }, + "$contains": { + "type": "string", + "description": "Array contains this element." + } + } + } + } + }, + "16_filter_conditions_boolean": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$is": { + "type": "string", + "description": "Value is exactly this value. (single value)" + }, + "$is_not": { + "type": "string", + "description": "Results omit this value. (single value)" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "16_filter_conditions_date": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$after": { + "type": "string", + "description": "Value is after this date. Value for this parameter is in ISO 8601 format." + }, + "$before": { + "type": "string", + "description": "Value is before this date. Value for this parameter is in ISO 8601 format." + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "16_filter_conditions_date_time": { + "title": "Filter by conditions", + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "conditions": { + "type": "object", + "description": "Data filters used to narrow the data records to be returned in the result.", + "properties": { + "$after": { + "type": "string", + "description": "Value is after this date. Value for this parameter is in ISO 8601 format.", + "format": "date-time" + }, + "$before": { + "type": "string", + "description": "Value is before this date. Value for this parameter is in ISO 8601 format.", + "format": "date-time" + }, + "$has_value": { + "type": "string", + "description": "Value is NOT null. The value for this parameter is an empty string." + }, + "$is_unknown": { + "type": "string", + "description": "Value is null. The value for this parameter is an empty string." + } + } + } + } + }, + "17_obj_async_action_object": { + "title": "Async Action Object", + "type": "object", + "description": "This is an object representing an asynchronous action.", + "x-tags": [ + "ASYNC ACTIONS API" + ], + "properties": { + "id": { + "type": "string", + "example": "aa_0adad13d6f057f088e", + "description": "Async action unique ID." + }, + "type": { + "type": "string", + "description": "Type of async action.", + "enum": [ + "CAMPAIGN.VOUCHERS_IMPORT", + "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "CAMPAIGN.VOUCHERS_UPDATE", + "CAMPAIGN.VOUCHERS_DELETE", + "CAMPAIGN.VOUCHERS_GENERATE", + "CAMPAIGNS.METADATA_KEY_PURGE", + "CUSTOMERS.IMPORT_CSV", + "CUSTOMERS.BULK_UPDATE", + "CUSTOMERS.METADATA_UPDATE", + "CUSTOMERS.METADATA_KEY_PURGE", + "PRODUCTS.BULK_UPDATE", + "PRODUCTS.METADATA_UPDATE", + "PRODUCTS.METADATA_KEY_PURGE", + "PRODUCTS.IMPORT_CSV", + "SKUS.IMPORT_CSV", + "VOUCHERS.IMPORT", + "VOUCHERS.IMPORT_CSV", + "VOUCHERS.BULK_UPDATE", + "VOUCHERS.METADATA_UPDATE", + "VOUCHERS.METADATA_KEY_PURGE", + "ORDERS.IMPORT", + "ORDERS.METADATA_KEY_PURGE" + ] + }, + "status": { + "type": "string", + "description": "Status of async action. Informs you whether the async action has already been completed.", + "enum": [ + "ENQUEUED", + "IN_PROGRESS", + "DONE", + "FAILED" + ] + }, + "result": { + "anyOf": [ + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_delete" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_vouchers_generate" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_campaign_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_customers_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_skus_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_products_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_import_csv" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_bulk_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_update" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_vouchers_metadata_key_purge" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_import" + }, + { + "$ref": "#/components/schemas/17_res_obj_get_async_action_result_orders_metadata_key_purge" + } + ] + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", + "example": "2022-06-23T11:21:45.578Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-06-23T11:21:46.795Z", + "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", + "format": "date-time" + }, + "request_id": { + "type": "string", + "example": "v-0b45cee140c3c9b5ca", + "description": "Unique request ID." + }, + "processing_time": { + "type": "integer", + "example": 1217, + "description": "The length of time it took to process the request in milliseconds." + }, + "progress": { + "type": "integer", + "description": "% progress to completion of the asynchronous action.", + "minimum": 0, + "maximum": 100 + }, + "object": { + "type": "string", + "default": "async_action", + "description": "The type of object represented by JSON. This object stores information about the `async_action`." + } + } + }, + "17_res_list_async_actions_GET": { + "description": "Response body schema for listing asynchronous actions. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action.\n\n| **Types by Context** |\n|:---|\n| **CAMPAIGN** |\n| CAMPAIGN.VOUCHERS_IMPORT
                  CAMPAIGN.VOUCHERS_IMPORT_CSV
                  CAMPAIGN.VOUCHERS_UPDATE
                  CAMPAIGN.VOUCHERS_DELETE
                  CAMPAIGN.VOUCHERS_GENERATE |\n| **CUSTOMERS** |\n| CUSTOMERS.IMPORT_CSV
                  CUSTOMERS.BULK_UPDATE
                  CUSTOMERS.METADATA_UPDATE
                  CUSTOMERS.METADATA_KEY_PURGE |\n| **PRODUCTS** |\n| PRODUCTS.BULK_UPDATE
                  PRODUCTS.METADATA_UPDATE
                  PRODUCTS.METADATA_KEY_PURGE
                  PRODUCTS.IMPORT_CSV
                  SKUS.IMPORT_CSV |\n| **VOUCHERS** |\n| VOUCHERS.IMPORT
                  VOUCHERS.IMPORT_CSV
                  VOUCHERS.BULK_UPDATE
                  VOUCHERS.METADATA_UPDATE
                  VOUCHERS.METADATA_KEY_PURGE |", + "type": "object", + "examples": [ + { + "object": "list", + "data_ref": "async_actions", + "async_actions": [ + { + "id": "aa_0ae2af6a38161f8c79", + "type": "CAMPAIGN.VOUCHERS_DELETE", + "status": "DONE", + "created_at": "2022-04-07T11:34:39.072Z", + "object": "async_action" + }, + { + "id": "aa_0ae27a55b696a4e0f0", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "created_at": "2022-04-07T07:42:44.442Z", + "object": "async_action" + }, + { + "id": "aa_0adad13d6f057f088e", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "created_at": "2022-04-01T08:54:35.196Z", + "object": "async_action" + }, + { + "id": "aa_0adacc81de057f084c", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "created_at": "2022-04-01T08:33:54.552Z", + "object": "async_action" + } + ] + } + ], + "title": "List Async Actions Response Body", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about asynchronous actions.", + "default": "list" + }, + "data_ref": { + "type": "string", + "default": "async_actions", + "description": "Identifies the name of the JSON property that contains the array of asynchronous actions." + }, + "async_actions": { + "type": "array", + "description": "An array of async actions.", + "items": { "type": "object", - "description": "Response schema for listing locations using **GET** `/locations`.", + "additionalProperties": false, + "description": "Contains an async action definition.", "properties": { - "object": { + "id": { + "type": "string", + "description": "Async action unique ID.", + "example": "aa_0ae2af6a38161f8c79" + }, + "type": { + "type": "string", + "description": "Type of async action.", + "enum": [ + "CAMPAIGN.VOUCHERS_IMPORT", + "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "CAMPAIGN.VOUCHERS_UPDATE", + "CAMPAIGN.VOUCHERS_DELETE", + "CAMPAIGN.VOUCHERS_GENERATE", + "CUSTOMERS.IMPORT_CSV", + "CUSTOMERS.BULK_UPDATE", + "CUSTOMERS.METADATA_UPDATE", + "CUSTOMERS.METADATA_KEY_PURGE", + "PRODUCTS.BULK_UPDATE", + "PRODUCTS.METADATA_UPDATE", + "PRODUCTS.METADATA_KEY_PURGE", + "PRODUCTS.IMPORT_CSV", + "SKUS.IMPORT_CSV", + "VOUCHERS.IMPORT", + "VOUCHERS.IMPORT_CSV", + "VOUCHERS.BULK_UPDATE", + "VOUCHERS.METADATA_UPDATE", + "VOUCHERS.METADATA_KEY_PURGE" + ] + }, + "status": { + "type": "string", + "description": "Status of async action. Informs you whether the async action has already been completed.", + "enum": [ + "ENQUEUED", + "IN_PROGRESS", + "DONE", + "FAILED" + ] + }, + "created_at": { "type": "string", - "description": "The type of object represented by JSON. This object stores information about locations in a dictionary.", - "default": "list" + "description": "Timestamp representing the date and time when the async action was scheduled in ISO 8601 format.", + "example": "2022-04-07T07:42:44.442Z", + "format": "date-time" }, - "data_ref": { + "updated_at": { "type": "string", - "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", - "default": "data" + "description": "Timestamp representing the date and time when the async action was updated in ISO 8601 format.", + "example": "2022-06-22T07:58:21.703Z", + "format": "date-time" }, - "data": { - "type": "array", - "description": "Array of location objects.", - "items": { - "$ref": "#/components/schemas/22_obj_location_object" - } + "request_id": { + "type": "string", + "example": "v-0ba50a7feb4998490", + "description": "Unique request ID." }, - "total": { + "progress": { "type": "integer", - "description": "Total number of locations." + "minimum": 0, + "maximum": 100, + "description": "% progress to completion of the asynchronous action." }, - "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 end date filter) to get more records returned in the results." + "object": { + "type": "string", + "default": "async_action", + "description": "The type of object represented by each nested object in the JSON async_actions array. This object stores information about the `async_action`." } - }, - "examples": [ - { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } - }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - }, - { - "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", - "object": "location", - "name": "New York", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - -74.016167, - 40.703186 - ], - [ - -74.008687, - 40.750656 - ], - [ - -73.943597, - 40.851838 - ], - [ - -73.928559, - 40.845285 - ], - [ - -73.936152, - 40.8356 - ], - [ - -73.934298, - 40.810015 - ], - [ - -73.92711, - 40.795145 - ], - [ - -73.978623, - 40.710432 - ], - [ - -74.013201, - 40.701619 - ], - [ - -74.016167, - 40.703186 - ] - ] - ] - } - }, - "created_at": "2022-07-15T05:37:45.299Z", - "updated_at": null - }, - { - "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", - "object": "location", - "name": "Germany", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:51.303908897065064,10.222253628401518", - "radius": "192.37 km" - } - }, - "created_at": "2022-07-14T15:51:39.265Z", - "updated_at": null - }, - { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], - [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 - ] - ] - ] - } - }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null - } - ], - "total": 4, - "has_more": false + } + } + } + } + }, + "17_res_obj_get_async_action_result_message": { + "title": "Message", + "type": "object", + "description": "Result schema with message.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + } + } + }, + "17_res_obj_get_async_action_result_message_failed": { + "title": "Message with Failed Array", + "type": "object", + "description": "Result schema with message and failed array.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": {} + } + } + }, + "17_res_obj_get_async_action_result_code_updated_found": { + "title": "Code Updated and Found", + "type": "object", + "description": "Result schema with an array of code, updated, and found parameters.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." + }, + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." + }, + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." } - ] - }, - "22_obj_location_object": { - "title": "Location object", + } + } + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_import": { + "title": "CAMPAIGN.VOUCHERS_IMPORT", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { "type": "object", - "description": "This is an object representing a location.", - "x-tags": [ - "LOCATIONS API" - ], "properties": { - "id": { + "code": { "type": "string", - "description": "Unique location ID, assigned by the Voucherify API.", - "example": "loc_NoMGXmHO9OUs7iz9mGWpamma" + "description": "Unique voucher code." }, - "object": { + "reason": { "type": "string", - "description": "The type of object represented by JSON. This object stores information about a `location`.", - "default": "location" - }, - "name": { + "description": "Detailed failure cause for the voucher code import." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_import_csv": { + "title": "CAMPAIGN.VOUCHERS_IMPORT_CSV", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "code": { "type": "string", - "description": "Location name." + "description": "Unique voucher code." }, - "shape": { - "type": "object", - "description": "Defines the shape and boundaries of the location.", - "anyOf": [ - { - "$ref": "#/components/schemas/22_obj_location_object_shape_circle" - }, - { - "$ref": "#/components/schemas/22_obj_location_object_shape_polygon" - } - ] + "row": { + "type": "integer", + "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." }, - "created_at": { + "reason": { "type": "string", - "example": "2022-02-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the location was created in ISO 8601 format.", - "format": "date-time" + "description": "Detailed failure cause for the voucher code import." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_update": { + "title": "CAMPAIGN.VOUCHERS_UPDATE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_UPDATE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_delete": { + "title": "CAMPAIGN.VOUCHERS_DELETE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_DELETE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_vouchers_generate": { + "title": "CAMPAIGN.VOUCHERS_GENERATE", + "type": "object", + "description": "Result schema for a CAMPAIGN.VOUCHERS_GENERATE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_campaign_metadata_key_purge": { + "title": "CAMPAIGNS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a CAMPAIGNS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_import_csv": { + "title": "CUSTOMERS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a CUSTOMERS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique customer ID from your inventory system as indicated in the CSV file." }, - "updated_at": { + "row": { + "type": "integer", + "description": "The CSV file row number where the customer is recorded. The row counter excludes the file headers row." + }, + "reason": { "type": "string", - "example": "2022-03-14T15:12:06.817Z", - "description": "Timestamp representing the date and time when the location was updated in ISO 8601 format.", - "format": "date-time" + "description": "Detailed failure cause for the customer import." } } - }, - "22_obj_location_object_shape_circle": { - "title": "Circle", + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_customers_bulk_update": { + "title": "CUSTOMERS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a CUSTOMERS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { "type": "object", - "description": "This is an object representing a circular shape.", "properties": { - "type": { + "source_id": { "type": "string", - "description": "The type of shape being defined is a `circle`.", - "default": "circle" + "description": "Unique customer `source_id`." }, - "format": { - "type": "string", - "description": "The location is defined in terms of a `distance` object.", - "default": "distance" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "distance": { - "type": "object", - "title": "Distance", - "description": "Defines the parameters for the circle.", - "properties": { - "center": { - "type": "string", - "description": "Center of the circle identified by GPS coordinates in decimal degrees.", - "example": "geo:40.79372699823857,-74.15092132694554" - }, - "radius": { - "type": "string", - "description": "Defines the radius of the circle." - } - } + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." } } - }, - "22_obj_location_object_shape_polygon": { - "title": "Polygon", + } + }, + "done_count": { + "type": "integer", + "description": "Number or resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_metadata_update": { + "title": "CUSTOMERS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a CUSTOMERS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { "type": "object", - "description": "This is an object representing a polygon.", "properties": { - "type": { + "source_id": { "type": "string", - "description": "The type of shape being defined is a `polygon`.", - "default": "polygon" + "description": "Unique customer `source_id`." }, - "format": { - "type": "string", - "description": "The location is defined in terms of a `geojson` object.", - "default": "geojson" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "distance": { - "type": "object", - "title": "Geojson", - "description": "Defines the parameters for the polygon.", - "properties": { - "type": { - "type": "string", - "description": "Type of geojson coordinates, i.e. `Polygon`.", - "default": "Polygon" - }, - "coordinates": { - "type": "array", - "description": "Contains array of GeoJSON coordinate arrays.", - "items": { - "$ref": "#/components/schemas/22_geojson_array" - } - } - } + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." } } - }, - "22_geojson_array": { - "title": "GeoJSON coordinate array.", - "type": "array", - "description": "GeoJSON coordinate array.", - "items": { - "$ref": "#/components/schemas/22_geojson_coordinates" - } - }, - "22_geojson_coordinates": { - "title": "GeoJSON coordinate.", - "type": "array", - "description": "GeoJSON coordinate.", - "items": { - "type": "integer" - } - }, - "22_filter_updated_at": { + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_customers_metadata_key_purge": { + "title": "CUSTOMERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a CUSTOMERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_bulk_update": { + "title": "PRODUCTS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a PRODUCTS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { "type": "object", - "title": "Updated at", "properties": { - "updated_at": { - "$ref": "#/components/schemas/16_filter_conditions_date_time" + "source_id": { + "type": "string", + "description": "Unique product `source_id`." + }, + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." + }, + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." } - }, - "description": "A filter on the list based on the object `updated_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[updated_at][before]=2017-09-08T13:52:18.227Z`" - }, - "22_filter_created_at": { + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_metadata_update": { + "title": "PRODUCTS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a PRODUCTS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { "type": "object", - "title": "Created at", "properties": { - "created_at": { - "$ref": "#/components/schemas/16_filter_conditions_date_time" + "source_id": { + "type": "string", + "description": "Unique product `source_id`." + }, + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." + }, + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." } - }, - "description": "A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`" - }, - "22_filter_name": { + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_metadata_key_purge": { + "title": "PRODUCTS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a PRODUCTS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources updated successfully." + } + } + }, + "17_res_obj_get_async_action_result_products_import_csv": { + "title": "PRODUCTS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a PRODUCTS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { "type": "object", - "title": "Name", + "description": "Contains the details regarding a CSV file line item failed import.", "properties": { - "name": { - "$ref": "#/components/schemas/16_filter_conditions_string" + "row": { + "type": "integer", + "description": "The CSV file row number where the product definition is recorded. The row counter excludes the file headers row." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the product import." } - }, - "description": "A filter on the list based on the name field." - }, - "22_filter_id": { + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_skus_import_csv": { + "title": "SKUS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a SKUS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result.", + "example": "2 sku(s) imported successfully, 6 failed." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { "type": "object", - "title": "ID", + "description": "Contains the details regarding a CSV file line item failed import.", "properties": { - "id": { - "$ref": "#/components/schemas/16_filter_conditions_string" + "row": { + "type": "integer", + "description": "The CSV file row number where the SKU definition is recorded. The row counter excludes the file headers row.", + "example": 2 + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the SKU import.", + "example": "Resource sku with id size-small is in use by products with ids [prod_0b0e3441c2462eff2c]" } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_import": { + "title": "VOUCHERS.IMPORT", + "type": "object", + "description": "Result schema for a VOUCHERS.IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "description": "If any records failed during the process, this array shows the failure details.", + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "Unique voucher code." }, - "description": "A filter on the list based on the id of the location." - }, - "23_obj_qualification_object": { - "title": "Qualification object", + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_import_csv": { + "title": "VOUCHERS.IMPORT_CSV", + "type": "object", + "description": "Result schema for a VOUCHERS.IMPORT_CSV async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "type": "array", + "description": "If any records failed during the process, this array shows the failure details.", + "items": { "type": "object", - "description": "This is an object representing a qualification.", - "x-tags": [ - "QUALIFICATIONS API" - ], "properties": { - "redeemables": { - "$ref": "#/components/schemas/23_obj_qualification_redeemables" - }, - "tracking_id": { + "code": { "type": "string", - "description": "This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID." + "description": "Unique voucher code." }, - "order": { - "type": "object", - "description": "The order object sent in the request.", - "$ref": "#/components/schemas/23_obj_order_object" + "row": { + "type": "integer", + "description": "The CSV file row number where the code definition is recorded. The row counter excludes the file headers row." }, - "stacking_rules": { - "$ref": "#/components/schemas/23_obj_qualification_object_stacking_rules" + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." } } - }, - "23_obj_order_object": { + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_bulk_update": { + "title": "VOUCHERS.BULK_UPDATE", + "type": "object", + "description": "Result schema for a VOUCHERS.BULK_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { "type": "object", - "title": "Order object", - "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", - "x-tags": [ - "ORDERS API" - ], "properties": { - "id": { - "type": "string", - "description": "Unique order ID, assigned by Voucherify.", - "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" - }, - "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." - }, - "created_at": { + "code": { "type": "string", - "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", - "example": "2022-03-09T11:19:04.819Z", - "format": "date-time" + "description": "Unique voucher code." }, - "updated_at": { - "type": "string", - "example": "2022-08-12T13:34:10.681Z", - "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", - "format": "date-time" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "status": { + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_metadata_update": { + "title": "VOUCHERS.METADATA_UPDATE", + "type": "object", + "description": "Result schema for a VOUCHERS.METADATA_UPDATE async action type.", + "properties": { + "results": { + "type": "array", + "description": "An array of statuses for each record.", + "items": { + "type": "object", + "properties": { + "code": { "type": "string", - "description": "Order status.", - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "amount": { - "type": "integer", - "description": "Order amount before applying any discount." - }, - "discount_amount": { - "type": "integer", - "description": "Sum of all order-level discounts applied to the order." + "description": "Unique voucher code." }, - "items_discount_amount": { - "type": "integer", - "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + "updated": { + "type": "boolean", + "description": "Indicates whether the record was updated." }, - "total_discount_amount": { - "type": "integer", - "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + "found": { + "type": "boolean", + "description": "Indicates whether the record was found." + } + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_vouchers_metadata_key_purge": { + "title": "VOUCHERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a VOUCHERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "17_res_obj_get_async_action_result_orders_import": { + "title": "ORDERS.IMPORT", + "type": "object", + "description": "Result schema for a ORDERS.IMPORT async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "failed": { + "description": "If any records failed during the process, this array shows the failure details.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique order source ID." + }, + "reason": { + "type": "string", + "description": "Detailed failure cause for the voucher code import." + } + } + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + }, + "failed_count": { + "type": "integer", + "description": "Number of resources failed to process." + } + } + }, + "17_res_obj_get_async_action_result_orders_metadata_key_purge": { + "title": "ORDERS.METADATA_KEY_PURGE", + "type": "object", + "description": "Result schema for a ORDERS.METADATA_KEY_PURGE async action type.", + "properties": { + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the result." + }, + "done_count": { + "type": "integer", + "description": "Number of resources processed successfully." + } + } + }, + "18_res_list_consents_GET": { + "description": "Response body schema for listing consents.", + "type": "object", + "examples": [ + { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" }, - "total_amount": { - "type": "integer", - "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" + } + ], + "total": 2 + }, + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" }, + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" + } + ], + "total": 2 + } + } + ], + "title": "List Consents Response Body", + "properties": { + "groups": { + "type": "object", + "description": "Contains marketing permission groups' definitions.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "Stores information about marketing permission groups." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of marketing permission groups." + }, + "data": { + "type": "array", + "description": "An array of marketing permission groups.", "items": { - "type": "array", - "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", - "items": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - } - } - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." - }, - "customer": { "type": "object", - "description": "Object containing information about the customer that is making the purchase.", + "additionalProperties": false, + "description": "Contains a marketing permission group's definition.", "properties": { "id": { "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique customer ID of the customer making the purchase." + "example": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "description": "Unique group ID." + }, + "name": { + "type": "string", + "description": "Marketing permission group name." + }, + "description": { + "type": "string", + "description": "Marketing permission group category." + }, + "consents": { + "type": "array", + "description": "List of consents that are assigned to the group.", + "items": { + "type": "string" + } + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-04-13T09:12:47.743Z", + "description": "Timestamp representing the date and time when the group was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-05-14T09:11:27.037Z", + "description": "Timestamp representing the date and time when the group was updated in ISO 8601 format." }, "object": { "type": "string", - "default": "customer", - "description": "Type of object represented by the `customer` object." + "default": "consent_group", + "description": "Stores information about a marketing permission group." } } - }, - "referrer": { + } + }, + "total": { + "type": "integer", + "description": "Total number of groups." + } + } + }, + "consents": { + "type": "object", + "description": "Contains opt-in consents' definitions.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "Stores information about opt-in consents." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of opt-in consents." + }, + "data": { + "type": "array", + "description": "An array of consents.", + "items": { "type": "object", - "description": "Object containing information about the referrer.", + "additionalProperties": false, + "description": "Contains an opt-in consent definition.", "properties": { "id": { "type": "string", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", - "description": "Unique referrer ID, who referred the customer making the purchase." + "example": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "description": "Unique consent ID." }, - "object": { + "name": { "type": "string", - "default": "customer", - "description": "Type of object represented by the referrer object." - } - } - }, - "customer_id": { - "type": "string", - "description": "Unique customer ID of the customer making the purchase.", - "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" - }, - "referrer_id": { - "type": "string", - "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "description": "Unique referrer ID." - }, - "object": { - "type": "string", - "default": "order", - "description": "The type of object represented by JSON. This object stores information about the `order`." - } - } - }, - "23_obj_qualification_object_stacking_rules": { - "type": "object", - "title": "Examine Qualification Stacking Rules", - "description": "Defines stacking rules for the redeemables.", - "properties": { - "redeemables_limit": { - "type": "integer", - "description": "Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is `30`.", - "default": 30 - }, - "applicable_redeemables_limit": { - "type": "integer", - "description": "Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is `5`.", - "default": 5 - } - } - }, - "23_req_create_qualification": { - "type": "object", - "title": "Examine Qualification Request Body", - "description": "Request body schema for examining a qualification`.", - "properties": { - "customer": { - "anyOf": [ - { - "$ref": "#/components/schemas/23_req_create_qualification_customer_id" + "description": "Consent name." }, - { - "$ref": "#/components/schemas/23_req_create_qualification_customer_source_id" + "description": { + "type": "string", + "description": "Consent description." }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ], - "description": "Customer's information." - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/23_req_create_qualification_order_id" + "category": { + "type": "string", + "description": "Consent category." }, - { - "$ref": "#/components/schemas/23_req_create_qualification_order_source_id" + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-04-13T09:11:27.037Z", + "description": "Timestamp representing the date and time when the consent was created in ISO 8601 format." }, - { - "$ref": "#/components/schemas/10_req_create_order" + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-05-14T09:11:27.037Z", + "description": "Timestamp representing the date and time when the consent was updated in ISO 8601 format." + }, + "object": { + "type": "string", + "default": "consent", + "description": "Stores information about an opt-in consent." } - ], - "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." - }, - "options": { - "type": "object", - "description": "Configure parameters returned in the response.", - "properties": { - "expand": { - "type": "array", - "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"redeemable\"] | - Returns the redeemables' metadata. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "items": { + } + } + }, + "total": { + "type": "integer", + "description": "Total number of consents." + } + } + } + } + }, + "20_res_list_categories": { + "type": "object", + "title": "List Categories Response Body", + "description": "Response schema for **GET** `/categories`.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. This object stores information about categories in a dictionary." + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of category objects.", + "default": "data" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/20_obj_category_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of categories." + } + } + }, + "20_obj_category_object": { + "type": "object", + "title": "Category Object", + "description": "This is an object representing a category.", + "x-tags": [ + "CATEGORIES API" + ], + "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", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-16T10:52:08.094Z", + "description": "Timestamp representing the date and time when the category was updated in ISO 8601 format.", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "category", + "description": "The type of object represented by the JSON. This object stores information about the category." + } + }, + "examples": [ + { + "id": "cat_0b60cfe7d0d7ddbb55", + "name": "Update", + "hierarchy": 1, + "created_at": "2022-07-14T10:45:13.156Z", + "updated_at": "2022-08-16T11:03:54.727Z", + "object": "category" + } + ] + }, + "20_req_update_categories_categoryId": { + "type": "object", + "title": "Update Category Request Body", + "description": "Request schema for updating a category using **PUT** `/categories/{categoryId}`.", + "properties": { + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + } + }, + "required": [ + "name", + "hierarchy" + ] + }, + "20_req_create_category": { + "type": "object", + "title": "Create Category Request Body", + "description": "Request schema for creating a category using **POST** `/categories`.", + "properties": { + "name": { + "type": "string", + "description": "Category name." + }, + "hierarchy": { + "type": "integer", + "description": "Category hierarchy." + } + }, + "required": [ + "name", + "hierarchy" + ] + }, + "20_res_create_category": { + "type": "object", + "title": "Category Object", + "description": "This is an object representing a newly created 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", + "description": "Timestamp representing the date and time when the category was created in ISO 8601 format.", + "example": "2022-07-14T10:45:13.156Z", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "category", + "description": "The type of object represented by the JSON. This object stores information about the category." + } + } + }, + "21_obj_metadata_schema_object": { + "type": "object", + "title": "Metadata Schema Object", + "description": "This is an object representing a metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID.", + "example": "ms_OF36L2rk4EqhdxvZs56IW9iE" + }, + "related_object": { + "type": "string", + "description": "The resource type. There is an infinite number of possibilities for the resource type because you can define custom metadata schemas. Some examples are included here to show you the standard metadata schema resource types.", + "enum": [ + "campaign", + "customer", + "earning_rule", + "loyalty_tier", + "order", + "order_item", + "product", + "promotion_tier", + "publication", + "redemption", + "reward", + "voucher" + ] + }, + "properties": { + "description": "Contains the metadata definitions. There can be many properties within this object.", + "anyOf": [ + { + "properties": { + "custom_property_name": { + "type": "object", + "description": "Custom property name. This is defined in **Project Settings** > **Metadata Schema** in the Dashboard.", + "properties": { + "type": { "type": "string", "enum": [ - "redeemable", - "category" + "string", + "number", + "object", + "date", + "datetime", + "geopoint", + "boolean", + "image_url" ] + }, + "array": { + "type": "boolean", + "description": "Indicates whether the definition is an array." + }, + "optional": { + "type": "boolean", + "description": "Indicates whether this definition is optional or not optional for the resource." + }, + "objectType": { + "type": [ + "string", + "null" + ], + "description": "Returns the name of the custom resource if the resource was previously defined in the Dashboard as a custom (non-standard) Nested object." + }, + "eq": { + "type": "array", + "description": "Array of possible values when the setting for `is equal to any of` in the Dashboard is defined explicitly.", + "items": {} + }, + "ne": { + "type": "array", + "description": "Array of values that are not allowed when the setting for `is not equal to any of` in the Dashboard is defined explicitly.", + "items": {} + }, + "lt": { + "type": "integer", + "description": "A property of `number` type must have `less than` this value." + }, + "lte": { + "type": "integer", + "description": "A property of `number` type must be `less than or equal` to this value." + }, + "gt": { + "type": "integer", + "description": "A property of `number` type must be `greater than` this value." + }, + "gte": { + "type": "integer", + "description": "A property of `number` type must be `greater than or equal` to this value." + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the definition was deleted from the schema." + }, + "maxLength": { + "type": "integer", + "description": "Value for maximum length when the setting for `has maximum length of` in the Dashboard is defined explicitly." + }, + "minLength": { + "type": "integer", + "description": "Value indicating minimum length when the setting for `has minimum length of` in the Dashboard is defined explicitly." + }, + "exactLength": { + "type": "integer", + "description": "Value indicating exact length when the setting for `has exact length of` in the Dashboard is defined explicitly." } - }, - "limit": { - "type": "integer", - "description": "The maximum number of redeemables to be returned in the API request. The actual number of returned redeemables will be determined by the API. The default value is set to 5, and the maximum value is 50.", - "maximum": 50 - }, - "starting_after": { - "type": "string", - "example": "2021-09-08T13:52:18.227Z", - "format": "date-time", - "description": "Curser used for paging." - }, - "filters": { - "description": "A set of fiters to return only a specific category or type of redeemable.", - "anyOf": [ - { - "$ref": "#/components/schemas/23_obj_filter_resource_type" - }, - { - "$ref": "#/components/schemas/23_obj_filter_category_id" - } - ] } } - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "mode": { - "type": "string", - "description": "Defines which resources Voucherify will use. Currently, `BASIC` is supported." - }, - "scenario": { - "type": "string", - "description": "Defines the scenario Voucherify should consider during the qualification process.\n\n- `ALL` - Scenario that returns all redeemables available for the customer in one API request.\n- `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile.\n- `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only.\n- `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s).\n- `PROMOTION_STACKS` - returns the applicable promotion stacks.\n- `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s).", - "enum": [ - "ALL", - "CUSTOMER_WALLET", - "AUDIENCE_ONLY", - "PRODUCTS", - "PRODUCTS_DISCOUNT", - "PROMOTION_STACKS", - "PRODUCTS_BY_CUSTOMER", - "PRODUCTS_DISCOUNT_BY_CUSTOMER" - ] } } + ], + "type": "object" + }, + "allow_defined_only": { + "type": "boolean", + "description": "Restricts the creation of metadata fields when set to `true`. In other words, it indicates whether or not you are allowed to create new metadata definitions; for example, in the campaign manager or publication manager. If it is set to true, then only the defined fields will be available for assigning values.\t" + }, + "created_at": { + "type": "string", + "example": "2021-12-03T13:33:44.556Z", + "description": "Timestamp representing the date and time when the metadata schema was created in ISO 8601 format.\t", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-11T08:05:30.695Z", + "description": "Timestamp representing the date and time when the metadata schema was updated in ISO 8601 format.\t", + "format": "date-time" + }, + "object": { + "type": "string", + "default": "metadata_schema", + "description": "The type of object represented by the JSON. This object stores information about the metadata schema." + } + }, + "x-tags": [ + "METADATA SCHEMAS API" + ], + "examples": [ + { + "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", + "related_object": "earning_rule", + "properties": { + "channel_id": { + "type": "string", + "array": true, + "optional": true, + "objectType": null, + "exactLength": 5 + }, + "channel_name": { + "eq": [ + "instagram", + "facebook", + "google", + "twitter", + "linkedin", + "website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - "23_req_create_qualification_customer_id": { - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to redemption in this request.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - } + "allow_defined_only": false, + "created_at": "2022-08-25T13:09:59.970Z", + "updated_at": "2022-08-25T13:11:15.704Z", + "object": "metadata_schema" + }, + { + "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", + "related_object": "campaign", + "properties": { + "region": { + "eq": [ + "EMEA", + "AMER", + "APAC" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "23_req_create_qualification_customer_source_id": { - "title": "Customer Source ID", - "description": "You can send the source ID that you used to create the customer in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." - } + "allow_defined_only": false, + "created_at": "2022-08-25T13:12:58.447Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "age": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "city_id": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null } }, - "23_req_create_qualification_order_id": { - "title": "Order ID", - "description": "You can pass the unique order ID that was assigned by Voucherify.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." - } + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.889Z", + "updated_at": "2022-09-12T07:34:49.163Z", + "object": "metadata_schema" + }, + { + "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", + "related_object": "loyalty_tier", + "properties": { + "level_name": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "audience_restricted": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null } }, - "23_req_create_qualification_order_source_id": { - "title": "Order Source ID", - "description": "You can send the source ID that you used to create the order in Voucherify.", - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Unique source ID of an existing order that will be linked to the redemption of this request." - } + "allow_defined_only": false, + "created_at": "2022-08-25T13:14:54.954Z", + "updated_at": "2022-08-25T13:15:24.436Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "card": { + "eq": [ + "Visa", + "MasterCard", + "Other" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "currency": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "ne": [ + 1, + 2, + 18, + 22 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "store_city": { + "eq": [ + "Hampden", + "San Francisco", + "Warsaw" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null } }, - "23_obj_filter_resource_type": { - "description": "Filter conditions set on the resource `type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", - "title": "Filter by type", - "type": "object", - "properties": { - "resource_type": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:47.575Z", + "updated_at": "2022-10-25T10:05:18.978Z", + "object": "metadata_schema" + }, + { + "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", + "related_object": "order_item", + "properties": { + "manufacturer_id": { + "gte": 15, + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:03.167Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "vendor": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "category": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null } }, - "23_obj_filter_category_id": { - "description": "Filter conditions set on the resource `category_id`.", - "title": "Filter by category ID", - "type": "object", - "properties": { - "category_id": { - "$ref": "#/components/schemas/16_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.298Z", + "updated_at": "2022-07-14T15:53:29.226Z", + "object": "metadata_schema" + }, + { + "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", + "related_object": "promotion_tier", + "properties": { + "level": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "23_obj_qualification_redeemables": { - "title": "Redeemables", - "type": "object", - "description": "List or redeemables for examine qualification.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. Default is `list`." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of qualified redeemables." - }, - "data": { - "type": "array", - "description": "Array of qualified redeemables.", - "items": { - "allOf": [] - } - }, - "total": { - "type": "integer", - "example": 5, - "description": "The number of redeemables returned in the API request." - }, - "has_more": { - "type": "boolean", - "description": "As results are always limited, the `has_more` flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results." - } + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:04.937Z", + "updated_at": "2022-09-23T08:51:46.266Z", + "object": "metadata_schema" + }, + { + "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", + "related_object": "publication", + "properties": { + "file_uploaded": { + "type": "image_url", + "array": false, + "optional": true, + "objectType": null + }, + "publication_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } }, - "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." - }, - "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." - } - }, - "required": [ - "id", - "voucher_id", - "campaign_id", - "bucket", - "created_at", - "status", - "expires_at", - "object" - ] - } - }, - "total": { - "type": "integer", - "description": "Total number of point expiration buckets." - } + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:35.534Z", + "updated_at": "2022-09-12T10:26:31.135Z", + "object": "metadata_schema" + }, + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] + "redemption_location": { + "type": "object", + "array": false, + "optional": true, + "objectType": "Location" + } }, - "LoyaltiesGetEarningRuleResponseBody": { - "$ref": "#/components/schemas/EarningRule" + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.794Z", + "updated_at": "2022-08-25T13:19:50.497Z", + "object": "metadata_schema" + }, + { + "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", + "related_object": "reward", + "properties": { + "reward_type": { + "eq": [ + "MATERIAL", + "PAY-WITH-POINTS", + "DISCOUNT-COUPON", + "GIFT-CARD-CREDITS", + "LOYALTY POINTS" + ], + "type": "string", + "array": false, + "optional": false, + "objectType": null + } }, - "LoyaltiesEnableEarningRulesResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" + "allow_defined_only": true, + "created_at": "2022-08-25T13:07:13.689Z", + "updated_at": "2022-08-25T13:08:26.696Z", + "object": "metadata_schema" + }, + { + "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", + "related_object": "voucher", + "properties": { + "lang": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "marketing_text": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "ProductionVoucherCodeMetaData": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:23.994Z", + "updated_at": "2022-09-19T14:13:30.590Z", + "object": "metadata_schema" + } + ] + }, + "21_res_list_metadata_shemas": { + "title": "List Metadata Schemas Response Body", + "type": "object", + "description": "Response schema for listing metadata schemas using **GET** `/metadata-schemas`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about metadata schemas in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", + "default": "schemas" + }, + "schemas": { + "type": "array", + "description": "Array of metadata schema objects.", + "items": { + "$ref": "#/components/schemas/21_obj_metadata_schema_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of metadata schemas." + } + }, + "examples": [ + { + "object": "list", + "data_ref": "schemas", + "schemas": [ + { + "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", + "related_object": "Payment", + "properties": { + "payment_tax": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "payment_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - { - "type": "object", - "properties": { - "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", - "default": true, - "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." - } + "allow_defined_only": true, + "created_at": "2022-03-07T11:01:01.747Z", + "updated_at": "2022-03-07T11:01:44.785Z", + "object": "metadata_schema" + }, + { + "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", + "related_object": "campaign", + "properties": { + "Store": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + }, + "locale": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_tag": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_time_tag": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "deleted": true, + "optional": true, + "objectType": null + }, + "height_customer_number": { + "type": "number", + "array": false, + "optional": true, + "objectType": null }, - "required": [ - "updated_at", - "active" - ] - } - ] - }, - "LoyaltiesDisableEarningRulesResponseBody": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" + "location_country_string": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - { - "type": "object", - "properties": { - "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", - "default": false, - "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." - } + "allow_defined_only": false, + "created_at": "2021-12-03T13:33:44.556Z", + "updated_at": "2022-07-26T13:57:42.288Z", + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "birth_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null }, - "required": [ - "updated_at", - "active" - ] - } - ] - }, - "EarningRuleBase": { - "title": "EarningRuleBase", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format." + "CRM_created_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "customer_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } }, - "loyalty": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleFixed" - }, - { - "$ref": "#/components/schemas/EarningRuleProportional" - } - ] + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.894Z", + "updated_at": "2022-07-14T15:15:34.928Z", + "object": "metadata_schema" + }, + { + "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", + "related_object": "earning_rule", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "minLength": 6, + "objectType": null + } }, - "event": { - "$ref": "#/components/schemas/EarningRuleEvent", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card." + "allow_defined_only": false, + "created_at": "2022-07-27T08:54:07.980Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", + "related_object": "loyalty_tier", + "properties": { + "has_funds": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } }, - "custom_event": { - "type": "object", - "properties": { - "schema_id": { - "type": "string" - } + "allow_defined_only": false, + "created_at": "2022-03-30T06:22:16.685Z", + "updated_at": "2022-07-27T08:55:01.628Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "Payment": { + "type": "object", + "array": false, + "deleted": true, + "optional": true, + "objectType": "Payment" }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } + "day_of_week": { + "type": "number", + "array": false, + "optional": true, + "objectType": null }, - "required": [ - "id" - ] - }, - "source": { - "type": "object", - "required": [ - "object_id", - "object_type" - ], - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", - "enum": [ - "campaign" - ] - } + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "number_of_store_visits": { + "type": "number", + "array": false, + "optional": true, + "objectType": null } }, - "object": { - "type": "string", - "enum": [ - "earning_rule" - ], - "description": "The type of object represented by JSON. Default is earning_rule." + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.798Z", + "updated_at": "2022-04-20T06:47:10.350Z", + "object": "metadata_schema" + }, + { + "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", + "related_object": "order_item", + "properties": { + "Size": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Color": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Thickness": { + "eq": [ + "Thin", + "Medium", + "Thick" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify." + "allow_defined_only": false, + "created_at": "2022-03-11T13:32:55.029Z", + "updated_at": "2022-05-23T13:46:01.463Z", + "object": "metadata_schema" + }, + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "color": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "origin": { + "type": "string", + "array": false, + "optional": true, + "minLength": 1, + "objectType": null + }, + "product_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_date_property": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_number_property": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_boolean_property": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_datetime_property": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + } }, - "start_date": { - "type": "string", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.880Z", + "updated_at": "2022-07-14T15:46:47.994Z", + "object": "metadata_schema" + }, + { + "id": "ms_th8YHt9yFYY1yAA99XOasT5W", + "related_object": "promotion_tier", + "properties": { + "has_budget": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } }, - "expiration_date": { - "type": "string", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:21.523Z", + "updated_at": "2022-07-27T08:54:42.909Z", + "object": "metadata_schema" + }, + { + "id": "ms_Z7niydc0OpGjDRL4yB40niXn", + "related_object": "publication", + "properties": { + "year": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." - } + "allow_defined_only": false, + "created_at": "2022-03-30T06:23:49.715Z", + "updated_at": "2022-04-19T10:28:24.568Z", + "object": "metadata_schema" + }, + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "required": [ - "duration", - "interval" - ] + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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 + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.890Z", + "updated_at": "2022-07-26T14:58:24.546Z", + "object": "metadata_schema" + }, + { + "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", + "related_object": "reward", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "objectType": null, + "exactLength": 4 } }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } + "allow_defined_only": false, + "created_at": "2022-07-27T08:53:32.257Z", + "updated_at": "2022-07-27T08:53:48.542Z", + "object": "metadata_schema" }, - "required": [ - "id", - "created_at", - "loyalty", - "source", - "object", - "automation_id", - "metadata" - ] - }, - "EarningRuleEvent": { - "title": "EarningRuleEvent", - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged", - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left" - ] - }, - "EarningRuleFixed": { - "title": "Define fixed amount of points", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "FIXED" - ], - "description": "The number of points to be added to the loyalty card." + { + "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", + "related_object": "voucher", + "properties": { + "unit": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Region": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "CATEGORY": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "active_on_calendar_month": { + "eq": [ + 1, + 2, + 3, + 5, + 7, + 9, + 10, + 11, + 12 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + } }, - "points": { - "type": "integer", - "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." - } + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:01.281Z", + "updated_at": "2022-06-22T07:22:09.577Z", + "object": "metadata_schema" } - }, - "EarningRuleProportionalOrder": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" - } - ], - "title": "Order" - }, - "EarningRuleProportionalOrderAmount": { - "title": "Order Amount", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_AMOUNT" - ], - "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" - }, - "order": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } + ], + "total": 13 + } + ] + }, + "22_res_list_locations": { + "title": "List Locations Response Body", + "type": "object", + "description": "Response schema for listing locations using **GET** `/locations`.", + "properties": { + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about locations in a dictionary.", + "default": "list" + }, + "data_ref": { + "type": "string", + "description": "Identifies the name of the attribute that contains the array of metadata schema objects.", + "default": "data" + }, + "data": { + "type": "array", + "description": "Array of location objects.", + "items": { + "$ref": "#/components/schemas/22_obj_location_object" + } + }, + "total": { + "type": "integer", + "description": "Total number of locations." + }, + "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 end date filter) to get more records returned in the results." + } + }, + "examples": [ + { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" } - } - }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderTotalAmount": { - "title": "Order Total Amount", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_TOTAL_AMOUNT" - ], - "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" }, - "order": { - "type": "object", - "required": [ - "total_amount" - ], - "properties": { - "total_amount": { - "type": "object", - "required": [ - "every", - "points" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - } - } - } - } - } + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderMetadata": { - "title": "Order Metadata", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + { + "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", + "object": "location", + "name": "New York", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + -74.016167, + 40.703186 + ], + [ + -74.008687, + 40.750656 + ], + [ + -73.943597, + 40.851838 + ], + [ + -73.928559, + 40.845285 + ], + [ + -73.936152, + 40.8356 + ], + [ + -73.934298, + 40.810015 + ], + [ + -73.92711, + 40.795145 + ], + [ + -73.978623, + 40.710432 + ], + [ + -74.013201, + 40.701619 + ], + [ + -74.016167, + 40.703186 + ] + ] + ] + } }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_METADATA" - ], - "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" + "created_at": "2022-07-15T05:37:45.299Z", + "updated_at": null + }, + { + "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", + "object": "location", + "name": "Germany", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:51.303908897065064,10.222253628401518", + "radius": "192.37 km" + } }, - "order": { - "type": "object", - "required": [ - "metadata" - ], - "description": "Defines the formula for calculating points proportionally.", - "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the order metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "Order metadata property." - } - } - } + "created_at": "2022-07-14T15:51:39.265Z", + "updated_at": null + }, + { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], + [ + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 + ] + ] + ] } - } + }, + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null + } + ], + "total": 4, + "has_more": false + } + ] + }, + "22_obj_location_object": { + "title": "Location object", + "type": "object", + "description": "This is an object representing a location.", + "x-tags": [ + "LOCATIONS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique location ID, assigned by the Voucherify API.", + "example": "loc_NoMGXmHO9OUs7iz9mGWpamma" + }, + "object": { + "type": "string", + "description": "The type of object represented by JSON. This object stores information about a `location`.", + "default": "location" + }, + "name": { + "type": "string", + "description": "Location name." + }, + "shape": { + "type": "object", + "description": "Defines the shape and boundaries of the location.", + "anyOf": [ + { + "$ref": "#/components/schemas/22_obj_location_object_shape_circle" }, - "required": [ - "type", - "calculation_type", - "order" - ] - }, - "EarningRuleProportionalOrderItemsQuantity": { - "title": "Order Items Quantity", + { + "$ref": "#/components/schemas/22_obj_location_object_shape_polygon" + } + ] + }, + "created_at": { + "type": "string", + "example": "2022-02-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the location was created in ISO 8601 format.", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-03-14T15:12:06.817Z", + "description": "Timestamp representing the date and time when the location was updated in ISO 8601 format.", + "format": "date-time" + } + } + }, + "22_obj_location_object_shape_circle": { + "title": "Circle", + "type": "object", + "description": "This is an object representing a circular shape.", + "properties": { + "type": { + "type": "string", + "description": "The type of shape being defined is a `circle`.", + "default": "circle" + }, + "format": { + "type": "string", + "description": "The location is defined in terms of a `distance` object.", + "default": "distance" + }, + "distance": { + "type": "object", + "title": "Distance", + "description": "Defines the parameters for the circle.", + "properties": { + "center": { + "type": "string", + "description": "Center of the circle identified by GPS coordinates in decimal degrees.", + "example": "geo:40.79372699823857,-74.15092132694554" + }, + "radius": { + "type": "string", + "description": "Defines the radius of the circle." + } + } + } + } + }, + "22_obj_location_object_shape_polygon": { + "title": "Polygon", + "type": "object", + "description": "This is an object representing a polygon.", + "properties": { + "type": { + "type": "string", + "description": "The type of shape being defined is a `polygon`.", + "default": "polygon" + }, + "format": { + "type": "string", + "description": "The location is defined in terms of a `geojson` object.", + "default": "geojson" + }, + "distance": { + "type": "object", + "title": "Geojson", + "description": "Defines the parameters for the polygon.", + "properties": { + "type": { + "type": "string", + "description": "Type of geojson coordinates, i.e. `Polygon`.", + "default": "Polygon" + }, + "coordinates": { + "type": "array", + "description": "Contains array of GeoJSON coordinate arrays.", + "items": { + "$ref": "#/components/schemas/22_geojson_array" + } + } + } + } + } + }, + "22_geojson_array": { + "title": "GeoJSON coordinate array.", + "type": "array", + "description": "GeoJSON coordinate array.", + "items": { + "$ref": "#/components/schemas/22_geojson_coordinates" + } + }, + "22_geojson_coordinates": { + "title": "GeoJSON coordinate.", + "type": "array", + "description": "GeoJSON coordinate.", + "items": { + "type": "integer" + } + }, + "22_filter_updated_at": { + "type": "object", + "title": "Updated at", + "properties": { + "updated_at": { + "$ref": "#/components/schemas/16_filter_conditions_date_time" + } + }, + "description": "A filter on the list based on the object `updated_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[updated_at][before]=2017-09-08T13:52:18.227Z`" + }, + "22_filter_created_at": { + "type": "object", + "title": "Created at", + "properties": { + "created_at": { + "$ref": "#/components/schemas/16_filter_conditions_date_time" + } + }, + "description": "A filter on the list based on the object `created_at` field. The value is a dictionary with the following options: `before`, `after`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`" + }, + "22_filter_name": { + "type": "object", + "title": "Name", + "properties": { + "name": { + "$ref": "#/components/schemas/16_filter_conditions_string" + } + }, + "description": "A filter on the list based on the name field." + }, + "22_filter_id": { + "type": "object", + "title": "ID", + "properties": { + "id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + } + }, + "description": "A filter on the list based on the id of the location." + }, + "23_obj_qualification_object": { + "title": "Qualification object", + "type": "object", + "description": "This is an object representing a qualification.", + "x-tags": [ + "QUALIFICATIONS API" + ], + "properties": { + "redeemables": { + "$ref": "#/components/schemas/23_obj_qualification_redeemables" + }, + "tracking_id": { + "type": "string", + "description": "This identifier is generated during voucher qualification based on your internal id (e.g., email, database ID). This is a hashed customer source ID." + }, + "order": { + "type": "object", + "description": "The order object sent in the request.", + "$ref": "#/components/schemas/23_obj_order_object" + }, + "stacking_rules": { + "$ref": "#/components/schemas/23_obj_qualification_object_stacking_rules" + } + } + }, + "23_obj_order_object": { + "type": "object", + "title": "Order object", + "description": "This is an object representing an order. \n\nThe purchase transactions can be tracked in Voucherify by the creation of an order object. You can create, retrieve, and pay individual orders, as well as list and export all of them in a CSV format. Orders are identified by a unique ID.\n\nOrders are automatically created during the [redeem voucher](ref:redeem-voucher) and [redeem promotion](redeem-promotion) call.\n\n\n> #### order.id and order session\n>\n> If you use the same order.id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order.\n> \n> Each time you use particular order in your requests, the API will automatically trigger a new session linked to the order.id. The session is active during the request and ends asynchronously after the request is completed. The session mechanism ensures that the particular order.id can be used in one API request at once.", + "x-tags": [ + "ORDERS API" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique order ID, assigned by Voucherify.", + "example": "ord_GFDbbv2I0wnO0sFUBOOOXPj2" + }, + "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." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the order was created in ISO 8601 format.", + "example": "2022-03-09T11:19:04.819Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "example": "2022-08-12T13:34:10.681Z", + "description": "Timestamp representing the date and time when the order was updated in ISO 8601 format.", + "format": "date-time" + }, + "status": { + "type": "string", + "description": "Order status.", + "enum": [ + "CREATED", + "PAID", + "CANCELED", + "FULFILLED" + ] + }, + "amount": { + "type": "integer", + "description": "Order amount before applying any discount." + }, + "discount_amount": { + "type": "integer", + "description": "Sum of all order-level discounts applied to the order." + }, + "items_discount_amount": { + "type": "integer", + "description": "Sum of all product-specific discounts applied to the order. \n`sum(items, i => i.discount_amount)`" + }, + "total_discount_amount": { + "type": "integer", + "description": "Sum of all order-level AND all product-specific discounts applied to the order. \n`total_discount_amount` = `discount_amount` + `items_discount_amount`\t" + }, + "total_amount": { + "type": "integer", + "description": "Order amount after applying all the discounts. \n`total_amount` = `amount` - `total_discount_amount`" + }, + "items": { + "type": "array", + "description": "Array of order items that have been applied to the order. Each order item can show the effects of particular discounts on the item-level.", + "items": { "type": "object", "properties": { - "type": { + "object": { "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "default": "order_item", + "description": "The type of object represented by JSON. This object stores information about the `order_item`." }, - "calculation_type": { + "product_id": { "type": "string", - "enum": [ - "ORDER_ITEMS_QUANTITY" - ], - "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." }, - "order_items": { - "type": "object", - "required": [ - "quantity" - ], - "properties": { - "quantity": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." - } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalOrderItemsAmount": { - "title": "Order Items Amount", - "type": "object", - "properties": { - "type": { + "sku_id": { "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_AMOUNT" - ], - "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" + "quantity": { + "type": "integer", + "description": "Quantity of the item in the cart." }, - "order_items": { - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." - } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalOrderItemsSubtotalAmount": { - "title": "Order Items Subtotal Amount", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "amount": { + "type": "integer", + "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." }, - "calculation_type": { - "type": "string", - "enum": [ - "ORDER_ITEMS_SUBTOTAL_AMOUNT" - ], - "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)" + "discount_amount": { + "type": "integer", + "description": "The item-level discount applied to the item." }, - "order_items": { - "type": "object", - "required": [ - "subtotal_amount" - ], - "properties": { - "subtotal_amount": { - "type": "object", - "required": [ - "every", - "points", - "object", - "id" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", - "properties": { - "every": { - "type": "integer", - "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "object": { - "type": "string", - "description": "Type of object taken under consideration.", - "enum": [ - "products_collection", - "product", - "sku" - ] - }, - "id": { - "type": "string", - "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." - } - } - } - } - } - }, - "required": [ - "type", - "calculation_type", - "order_items" - ] - }, - "EarningRuleProportionalCustomerMetadata": { - "title": "Customer Metadata", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + "price": { + "type": "integer", + "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOMER_METADATA" - ], - "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)" + "subtotal_amount": { + "type": "integer", + "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" }, - "customer": { + "product": { "type": "object", - "required": [ - "metadata" - ], + "description": "This object stores more information about the related product.", "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "Customer metadata property." - } - } + "id": { + "type": "string", + "example": "prod_5h0wc453_1", + "description": "A unique identifier that represents the product and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "description": "A unique product identifier from your inventory system.", + "example": "illy-arabica" + }, + "name": { + "type": "string", + "example": "Brewing System", + "description": "Product name." + }, + "price": { + "type": "integer", + "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } - } - }, - "required": [ - "type", - "calculation_type", - "customer" - ] - }, - "EarningRuleProportionalCustomEvent": { - "title": "Custom Event", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "PROPORTIONAL" - ], - "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." - }, - "calculation_type": { - "type": "string", - "enum": [ - "CUSTOM_EVENT_METADATA" - ], - "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." }, - "custom_event": { + "sku": { "type": "object", - "required": [ - "metadata" - ], + "description": "This object stores more information about the related SKU.", "properties": { - "metadata": { - "type": "object", - "required": [ - "every", - "points", - "property" - ], - "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", - "properties": { - "every": { - "type": "integer", - "description": "For how many increments of the customer metadata property to grant points for." - }, - "points": { - "type": "integer", - "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." - }, - "property": { - "type": "string", - "description": "\nCustom event metadata property." - } - } + "id": { + "type": "string", + "example": "sku_prod_5h0wc453_1_1", + "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + }, + "source_id": { + "type": "string", + "example": "illy-arabica-250g", + "description": "A unique SKU identifier from your inventory system." + }, + "sku": { + "type": "string", + "description": "SKU name." + }, + "price": { + "type": "integer", + "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." } } } + } + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format." + }, + "customer": { + "type": "object", + "description": "Object containing information about the customer that is making the purchase.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique customer ID of the customer making the purchase." }, - "required": [ - "type", - "calculation_type", - "custom_event" - ] - }, - "EarningRuleProportional": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrder" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" - } - ], - "title": "Calculate points proportionally" - }, - "EarningRuleProportionalOrderItems": { - "anyOf": [ - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" - }, - { - "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" - } - ], - "title": "Order Items" - }, - "LoyaltiesListMemberRewardsRequestQuery": { - "title": "Loyalties List Member Rewards Request Query", - "type": "object", - "properties": { - "affordable_only": { - "type": "string" - }, - "limit": { - "type": "integer" - }, - "page": { - "type": "integer" - } + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the `customer` object." } - }, - "LoyaltiesGetPointsExpirationRequestQuery": { - "title": "Loyalties Get Points Expiration Request Query", - "type": "object", - "properties": { - "limit": { - "type": "integer", - "minimum": 1, - "multipleOf": 100 - }, - "page": { - "type": "integer" - } + } + }, + "referrer": { + "type": "object", + "description": "Object containing information about the referrer.", + "properties": { + "id": { + "type": "string", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1", + "description": "Unique referrer ID, who referred the customer making the purchase." + }, + "object": { + "type": "string", + "default": "customer", + "description": "Type of object represented by the referrer object." } - }, - "LoyaltiesListCardTransactionsRequestQuery": { - "title": "Loyalties List Card Transactions Request Query", - "type": "object", - "properties": { - "limit": { - "type": "integer", - "minimum": 1, - "multipleOf": 100 - }, - "page": { - "type": "integer" - } + } + }, + "customer_id": { + "type": "string", + "description": "Unique customer ID of the customer making the purchase.", + "example": "cust_7iUa6ICKyU6gH40dBU25kQU1" + }, + "referrer_id": { + "type": "string", + "example": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "description": "Unique referrer ID." + }, + "object": { + "type": "string", + "default": "order", + "description": "The type of object represented by JSON. This object stores information about the `order`." + } + } + }, + "23_obj_qualification_object_stacking_rules": { + "type": "object", + "title": "Examine Qualification Stacking Rules", + "description": "Defines stacking rules for the redeemables.", + "properties": { + "redeemables_limit": { + "type": "integer", + "description": "Defines how many redeemables can be sent with one stacking request. We have extended the maximum value from 5 to 30 (comment: but more redeemables means more processing time!). Default limit is `30`.", + "default": 30 + }, + "applicable_redeemables_limit": { + "type": "integer", + "description": "Defines how many of sent redeemables will be actually applied to the order (e.g. user can select 30 discounts but only 5 will be applied to the order, the remaining will be marked as SKIPPED). Default limit is `5`.", + "default": 5 + } + } + }, + "23_req_create_qualification": { + "type": "object", + "title": "Examine Qualification Request Body", + "description": "Request body schema for examining a qualification`.", + "properties": { + "customer": { + "anyOf": [ + { + "$ref": "#/components/schemas/23_req_create_qualification_customer_id" + }, + { + "$ref": "#/components/schemas/23_req_create_qualification_customer_source_id" + }, + { + "$ref": "#/components/schemas/9_req_create_customer" } - }, - "LoyaltiesListCardTransactionsResponseBody": { - "title": "Loyalties List Card Transactions Response Body", - "type": "object", - "properties": { - "object": { - "type": "string", - "pattern": "list", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON." - }, - "data_ref": { - "type": "string", - "pattern": "data", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of transaction objects." - }, - "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." - } + ], + "description": "Customer's information." + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/23_req_create_qualification_order_id" }, - "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" - }, - "balance": { - "type": "string" - }, - "next_expiration_date": { - "type": "string" - }, - "next_expiration_points": { - "type": "string" - } - } - }, - "type": { - "type": "string", - "enum": [ - "LOYALTY_CARD" - ] - }, - "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": { + { + "$ref": "#/components/schemas/23_req_create_qualification_order_source_id" + }, + { + "$ref": "#/components/schemas/10_req_create_order" + } + ], + "description": "Order information. This object enables you to pass purchase transaction data. Read what properties you can use in the [Order object](ref:get-order)." + }, + "options": { + "type": "object", + "description": "Configure parameters returned in the response.", + "properties": { + "expand": { + "type": "array", + "description": "Expand array lets you configure params included in the response. Depending on the strings included in the array, the response will contain different details. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"redeemable\"] | - Returns the redeemables' metadata. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "items": { "type": "string", - "pattern": "voucher", "enum": [ - "voucher" + "redeemable", + "category" ] } }, - "required": [ - "id", - "code", - "loyalty_card", - "type", - "campaign", - "campaign_id", - "object" - ] - }, - "LoyaltyCardTransaction": { - "title": "Loyalty Card Transaction", + "limit": { + "type": "integer", + "description": "The maximum number of redeemables to be returned in the API request. The actual number of returned redeemables will be determined by the API. The default value is set to 5, and the maximum value is 50.", + "maximum": 50 + }, + "starting_after": { + "type": "string", + "example": "2021-09-08T13:52:18.227Z", + "format": "date-time", + "description": "Curser used for paging." + }, + "filters": { + "description": "A set of fiters to return only a specific category or type of redeemable.", + "anyOf": [ + { + "$ref": "#/components/schemas/23_obj_filter_resource_type" + }, + { + "$ref": "#/components/schemas/23_obj_filter_category_id" + } + ] + } + } + }, + "metadata": { + "type": "object", + "description": "A set of key/value pairs that you can send in the request body to check against redeemables requiring **redemption** metadata validation rules to be satisfied. The validation runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + }, + "mode": { + "type": "string", + "description": "Defines which resources Voucherify will use. Currently, `BASIC` is supported." + }, + "scenario": { + "type": "string", + "description": "Defines the scenario Voucherify should consider during the qualification process.\n\n- `ALL` - Scenario that returns all redeemables available for the customer in one API request.\n- `CUSTOMER_WALLET` - returns vouchers applicable to the customer’s cart based on the vouchers assigned to the customer’s profile.\n- `AUDIENCE_ONLY` - returns all vouchers, promotion tiers, and campaigns available to the customer. Voucherify validates the rules based on the customer profile only.\n- `PRODUCTS` - returns all promotions available for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT` - returns all promotions available for products when a discount is defined as applicable to specific item(s).\n- `PROMOTION_STACKS` - returns the applicable promotion stacks.\n- `PRODUCTS_BY_CUSTOMER` - returns all promotions available for a customer for the products (when a discount is defined to be applied to the item or when the item is required in the validation rule).\n- `PRODUCTS_DISCOUNT_BY_CUSTOMER` - returns all promotions available for a customer for products when a discount is defined as applicable to specific item(s).", + "enum": [ + "ALL", + "CUSTOMER_WALLET", + "AUDIENCE_ONLY", + "PRODUCTS", + "PRODUCTS_DISCOUNT", + "PROMOTION_STACKS", + "PRODUCTS_BY_CUSTOMER", + "PRODUCTS_DISCOUNT_BY_CUSTOMER" + ] + } + } + }, + "23_req_create_qualification_customer_id": { + "title": "Customer ID", + "description": "You can pass the unique customer ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of an existing customer that will be linked to redemption in this request.", + "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + } + } + }, + "23_req_create_qualification_customer_source_id": { + "title": "Customer Source ID", + "description": "You can send the source ID that you used to create the customer in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "A unique identifier of a customer. It can be a customer ID or email from a CRM system, database or 3rd-party service. If you also pass a customer ID (unique ID assigned by Voucherify), the source ID will be ignored." + } + } + }, + "23_req_create_qualification_order_id": { + "title": "Order ID", + "description": "You can pass the unique order ID that was assigned by Voucherify.", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique ID assigned by Voucherify of an existing order that will be linked to the redemption of this request." + } + } + }, + "23_req_create_qualification_order_source_id": { + "title": "Order Source ID", + "description": "You can send the source ID that you used to create the order in Voucherify.", + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Unique source ID of an existing order that will be linked to the redemption of this request." + } + } + }, + "23_obj_filter_resource_type": { + "description": "Filter conditions set on the resource `type`. The resource types include: `voucher`, `promotion_tier`, `campaign`.", + "title": "Filter by type", + "type": "object", + "properties": { + "resource_type": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "23_obj_filter_category_id": { + "description": "Filter conditions set on the resource `category_id`.", + "title": "Filter by category ID", + "type": "object", + "properties": { + "category_id": { + "$ref": "#/components/schemas/16_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "23_obj_qualification_redeemables": { + "title": "Redeemables", + "type": "object", + "description": "List or redeemables for examine qualification.", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "The type of object represented by JSON. Default is `list`." + }, + "data_ref": { + "type": "string", + "default": "data", + "description": "Identifies the name of the attribute that contains the array of qualified redeemables." + }, + "data": { + "type": "array", + "description": "Array of qualified redeemables.", + "items": { + "allOf": [] + } + }, + "total": { + "type": "integer", + "example": 5, + "description": "The number of redeemables returned in the API request." + }, + "has_more": { + "type": "boolean", + "description": "As results are always limited, the `has_more` flag indicates whether there are more records for given parameters. This let's you know if you are able to run another request (with different options) to get more records returned in the results." + } + } + }, + "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." + }, + "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 transaction ID." - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." + "description": "Unique loyalty points bucket ID." }, "voucher_id": { "type": "string", - "description": "Unique voucher ID." + "description": "Unique parent loyalty card 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": [ - "string", - "null" - ], - "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." - }, - "reason": { - "type": [ - "string", - "null" - ], - "description": "Reason why the transaction occurred. In case of a redemption, this value is null." + "description": "\nUnique parent campaign ID." }, - "type": { - "$ref": "#/components/schemas/LoyaltyCardTransactionsType", - "description": "Type of transaction." - }, - "details": { + "bucket": { "type": "object", - "description": "Contains the detailed information about the transaction.", + "required": [ + "total_points" + ], + "description": "Defines the number of points stored in the given loyalty points bucket.", "properties": { - "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" - ] - }, - "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." + "total_points": { + "type": "integer", + "description": "Total number of points in the loyalty points bucket." } } }, - "related_transaction_id": { - "type": [ - "string", - "null" - ], - "description": "The related transaction ID on the receiving card." - }, "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 transaction was created in ISO 8601 format.\n\n" + "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." } }, "required": [ "id", - "source_id", "voucher_id", "campaign_id", - "source", - "reason", - "type", - "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", + "bucket", "created_at", - "details" + "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": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "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", + "default": true, + "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." + } }, - "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" + "required": [ + "updated_at", + "active" + ] + } + ] + }, + "LoyaltiesDisableEarningRulesResponseBody": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "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", + "default": false, + "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." + } + }, + "required": [ + "updated_at", + "active" + ] + } + ] + }, + "EarningRuleBase": { + "title": "EarningRuleBase", + "x-stoplight": { + "id": "w4ci1ljqva0r1" + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format." + }, + "loyalty": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleFixed" + }, + { + "$ref": "#/components/schemas/EarningRuleProportional" + } + ] + }, + "event": { + "$ref": "#/components/schemas/EarningRuleEvent", + "description": "Defines the event which triggers the earning rule to add points to a loyalty card." + }, + "custom_event": { + "type": "object", + "properties": { + "schema_id": { + "type": "string" + } + }, + "required": [ + "schema_id" + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. Required for the customer.segment.entered option in event.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + }, + "required": [ + "id" + ] + }, + "source": { + "type": "object", + "required": [ + "object_id", + "object_type" + ], + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`.", + "enum": [ + "campaign" + ] + } + } + }, + "object": { + "type": "string", + "enum": [ + "earning_rule" + ], + "description": "The type of object represented by JSON. Default is earning_rule." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify." + }, + "start_date": { + "type": "string", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is inactive before this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." + }, + "expiration_date": { + "type": "string", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is inactive after this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a duration of PT1H will be valid for a duration of one hour." + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an interval of P2D will be valid every other day." + } + }, + "required": [ + "duration", + "interval" + ] + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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 + } + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + }, + "required": [ + "id", + "created_at", + "loyalty", + "source", + "object", + "automation_id", + "metadata" + ] + }, + "EarningRuleEvent": { + "title": "EarningRuleEvent", + "x-stoplight": { + "id": "6vxql7fnzg2zp" + }, + "type": "string", + "enum": [ + "order.paid", + "customer.segment.entered", + "custom_event", + "customer.loyalty.tier.upgraded", + "customer.loyalty.tier.downgraded", + "customer.loyalty.tier.prolonged", + "customer.loyalty.tier.joined", + "customer.loyalty.tier.left" + ] + }, + "EarningRuleFixed": { + "title": "Define fixed amount of points", + "x-stoplight": { + "id": "r5o8m0sdli7fq" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "FIXED" + ], + "description": "The number of points to be added to the loyalty card." + }, + "points": { + "type": "integer", + "description": "Defines how the points will be added to the loyalty card. FIXED adds a fixed number of points." + } + } + }, + "EarningRuleProportionalOrder": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderTotalAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderMetadata" + } + ], + "title": "Order" + }, + "EarningRuleProportionalOrderAmount": { + "title": "Order Amount", + "x-stoplight": { + "id": "1z7lk7z1lp5af" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_AMOUNT" + ], + "description": "`ORDER_AMOUNT`: Pre-discount order amount (X points for every Y spent excluding discounts)" + }, + "order": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + } + } + } + } + } + }, + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderTotalAmount": { + "title": "Order Total Amount", + "x-stoplight": { + "id": "ekudxr430edgk" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_TOTAL_AMOUNT" + ], + "description": "`ORDER_TOTAL_AMOUNT`: Total order amount (X points for every Y spent including discount)" + }, + "order": { + "type": "object", + "required": [ + "total_amount" + ], + "properties": { + "total_amount": { + "type": "object", + "required": [ + "every", + "points" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + } + } + } + } + } + }, + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderMetadata": { + "title": "Order Metadata", + "x-stoplight": { + "id": "4ccw4gz8b47u5" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_METADATA" + ], + "description": "`ORDER_METADATA`: Order Metadata (X points for every Y in metadata attribute, defined in the property key under the order.metadata object)" + }, + "order": { + "type": "object", + "required": [ + "metadata" + ], + "description": "Defines the formula for calculating points proportionally.", + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the order metadata property to grant points for." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "property": { + "type": "string", + "description": "Order metadata property." + } + } + } + } + } + }, + "required": [ + "type", + "calculation_type", + "order" + ] + }, + "EarningRuleProportionalOrderItemsQuantity": { + "title": "Order Items Quantity", + "x-stoplight": { + "id": "pqsn9otpzyot9" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_QUANTITY" + ], + "description": "`ORDER_ITEMS_QUANTITY`: Quantity of items defined in order_items.quantity.object & .id (X points for every Y items excluding free items)" + }, + "order_items": { + "type": "object", + "required": [ + "quantity" + ], + "properties": { + "quantity": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } } } - }, - "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 - } - } - } - } - } - } - } - } + } + } + }, + "required": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalOrderItemsAmount": { + "title": "Order Items Amount", + "x-stoplight": { + "id": "8pg4o23daepkb" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_AMOUNT" + ], + "description": "ORDER_ITEMS_AMOUNT; Pre-discount amount spent on items defined in the order_items.amount.object & .id (X points for every Y spent on items excluding discounts)" + }, + "order_items": { + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } - }, - "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" - ] - } + } + } + } + }, + "required": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalOrderItemsSubtotalAmount": { + "title": "Order Items Subtotal Amount", + "x-stoplight": { + "id": "duxy5qw36h5ph" + }, + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "ORDER_ITEMS_SUBTOTAL_AMOUNT" + ], + "description": "ORDER_ITEMS_SUBTOTAL_AMOUNT; Amount spent on items defined in the order_items.subtotal_amount.object & .id (X points for every Y spent on items including discounts)" + }, + "order_items": { + "type": "object", + "required": [ + "subtotal_amount" + ], + "properties": { + "subtotal_amount": { + "type": "object", + "required": [ + "every", + "points", + "object", + "id" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every set of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every calculation_type, give points.", + "properties": { + "every": { + "type": "integer", + "description": "Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "object": { + "type": "string", + "description": "Type of object taken under consideration.", + "enum": [ + "products_collection", + "product", + "sku" + ] + }, + "id": { + "type": "string", + "description": "Unique ID of the resource, i.e. pc_75U0dHlr7u75BJodrW1AE3t6, prod_0bae32322150fd0546, or sku_0b7d7dfb090be5c619." } - }, - "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": [ + "type", + "calculation_type", + "order_items" + ] + }, + "EarningRuleProportionalCustomerMetadata": { + "title": "Customer Metadata", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOMER_METADATA" + ], + "description": "CUSTOMER_METADATA: Customer Metadata (X points for every Y in metadata attribute, defined in the property key under the customer.metadata object)" + }, + "customer": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for." }, - "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" + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "property": { + "type": "string", + "description": "Customer metadata property." + } } - ] - }, - "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", + "calculation_type", + "customer" + ] + }, + "EarningRuleProportionalCustomEvent": { + "title": "Custom Event", + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "PROPORTIONAL" + ], + "description": "Defines how the points will be added to the loyalty card.PROPORTIONAL adds points based on a pre-defined ratio." + }, + "calculation_type": { + "type": "string", + "enum": [ + "CUSTOM_EVENT_METADATA" + ], + "description": "CUSTOM_EVENT_METADATA: Custom event metadata (X points for every Y in metadata attribute)." + }, + "custom_event": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "type": "object", + "required": [ + "every", + "points", + "property" + ], + "description": "Defines the ratio based on the property defined in the calculation_type parameter. For every given increment of value (1, 10, etc) defined in the every parameter for the property defined in calculation_type, give the customer the number of points defined in the points parameter. In other words, for every order metadata property value, give points.", + "properties": { + "every": { + "type": "integer", + "description": "For how many increments of the customer metadata property to grant points for." + }, + "points": { + "type": "integer", + "description": "Number of points to be awarded, i.e. how many points to be added to the loyalty card." + }, + "property": { + "type": "string", + "description": "\nCustom event metadata property." } } + } + } + } + }, + "required": [ + "type", + "calculation_type", + "custom_event" + ] + }, + "EarningRuleProportional": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrder" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItems" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomerMetadata" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalCustomEvent" + } + ], + "title": "Calculate points proportionally" + }, + "EarningRuleProportionalOrderItems": { + "anyOf": [ + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsQuantity" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsAmount" + }, + { + "$ref": "#/components/schemas/EarningRuleProportionalOrderItemsSubtotalAmount" + } + ], + "title": "Order Items" + }, + "LoyaltiesListMemberRewardsRequestQuery": { + "title": "Loyalties List Member Rewards Request Query", + "type": "object", + "properties": { + "affordable_only": { + "type": "string" + }, + "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", + "pattern": "list", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON." + }, + "data_ref": { + "type": "string", + "pattern": "data", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of transaction objects." + }, + "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" }, - "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." - } + "balance": { + "type": "string" + }, + "next_expiration_date": { + "type": "string" + }, + "next_expiration_points": { + "type": "string" + } + } + }, + "type": { + "type": "string", + "enum": [ + "LOYALTY_CARD" + ] + }, + "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": [ + "string", + "null" + ], + "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." + }, + "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": [ + "string", + "null" + ], + "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." + }, + "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": "Contains the detailed information about the transaction.", + "properties": { + "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", - "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", + "total", + "object", + "points", + "balance", + "related_object" + ] }, - "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." - } + "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." } }, - "operation_type": { - "type": "string", - "enum": [ - "MANUAL", - "AUTOMATIC" - ] - } + "required": [ + "id", + "source_id" + ] }, - "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" - } + "event": { + "type": "object", + "description": "Contains information about the event that triggers the point accrual.", + "properties": { + "id": { + "type": "string", + "description": "Unique event ID." }, - "required": [ - "object" - ] + "type": { + "type": "string", + "description": "Type of event." + } }, - "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": [ + "id", + "type" + ] + }, + "earning_rule": { + "type": "object", + "description": "Contains information about the earning rule.", + "properties": { + "id": { + "type": "string", + "description": "Unique earning rule ID." }, - "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`" - } + "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." } } } }, - "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", + "source" + ] }, - "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." + "segment": { + "type": "object", + "description": "Contains information about the segment.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } }, - "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": [ + "id", + "name" + ] }, - "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." + "loyalty_tier": { + "type": "object", + "description": "Contains information about the loyalty tier.", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } }, - "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": [ + "id", + "name" + ] }, - "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." + "redemption": { + "type": "object", + "description": "Contains information about the original redemption.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption ID." + } }, - "object": { - "type": "string", - "enum": [ - "category" - ], - "description": "The type of object represented by the JSON. This object stores information about the category." - } + "required": [ + "id" + ] }, - "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" - ] + "rollback": { + "type": "object", + "description": "Contains information about the redemption rollback.", + "properties": { + "id": { + "type": "string", + "description": "Unique redemption rollback ID." + } }, - { - "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": [ + "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." }, - "required": [ - "exported_object" - ] + "type": { + "type": "string", + "description": "Type of custom event." + } }, - { - "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": [ + "id", + "type" + ] + }, + "event_schema": { + "type": "object", + "description": "Contains information about the custom event metadata schema.", + "properties": { + "id": { + "type": "string", + "description": "Unique metadata schema ID." }, - "required": [ - "exported_object" - ] + "name": { + "type": "string", + "description": "Type of custom event." + } }, - { - "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": [ + "id", + "name" + ] + }, + "reward": { + "type": "object", + "description": "Contains information about the pay with points reward.", + "properties": { + "id": { + "type": "string", + "description": "Unique reward ID." }, - "required": [ - "exported_object" - ] + "name": { + "type": "string", + "description": "Reward name." + } }, - { - "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" + "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." + } + } + }, + "related_transaction_id": { + "type": [ + "string", + "null" + ], + "description": "The related transaction ID on the receiving card." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format.\n\n" + } + }, + "required": [ + "id", + "source_id", + "voucher_id", + "campaign_id", + "source", + "reason", + "type", + "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 + } } - }, - "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." + } } + } + } + } + } + }, + "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." }, - "required": [ - "exported_object" - ] + "description": { + "type": "string", + "description": "An arbitrary string that you can attach to a material reward." + } } - ], - "type": "object" + }, + "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." + } }, - "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." - } + "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." } - }, - "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": [ + "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" } }, - "required": [ - "id", - "object", - "created_at", - "status", - "result", - "user_id" - ] + "url": { + "type": "string", + "description": "The endpoint where this list of publications can be accessed using a GET method. /v1/vouchers/{voucher_code}/publications" + } }, - "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" - } - ] + "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" + } }, - "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": [ + "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." }, - "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." - } + "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`" } } }, - "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." + "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`" + } } } - }, - "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" + } + }, + "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." + } }, - "$count_more": { - "$ref": "#/components/schemas/Any" - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, - "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" + "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." + } }, - "customer_source_id": { - "$ref": "#/components/schemas/FieldConditions" - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, - "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." + "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" } }, - "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" + "filters": { + "$ref": "#/components/schemas/ExportCustomerFilters", + "description": "Filter conditions." + } }, - "metadata": { - "$ref": "#/components/schemas/FieldConditions" - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, - "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." + "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" } }, - "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" + "filters": { + "$ref": "#/components/schemas/ExportPublicationFilters", + "description": "Filter conditions." + } }, - "birthdate": { - "$ref": "#/components/schemas/FieldConditions" - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, - "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." + "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" } }, - "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" + "filters": { + "$ref": "#/components/schemas/ExportOrderFilters", + "description": "Filter conditions." + } }, - "metadata": { - "$ref": "#/components/schemas/FieldConditions" - } + "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." } }, - "ExportOrder": { - "title": "Export Orders", - "type": "object", - "properties": { - "exported_object": { - "type": "string", - "enum": [ - "order" - ], - "description": "The type of object to be exported." + "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." + } }, - "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 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" } }, - "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data." - } + "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" }, - "required": [ - "exported_object", - "parameters" - ] + { + "$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." + } }, - "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" + "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." } }, - "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." + "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" } }, - "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" + "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." } }, - "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." - } + "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." }, - "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" + "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." } }, - "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." + "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" } }, - "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" - ] + "filters": { + "$ref": "#/components/schemas/ExportPointsExpirationFilters", + "description": "Filter conditions." + } }, - "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" - ] + "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." + } }, - "Any": { + "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": "array", - "type": "array", - "items": { - "anyOf": [ - { - "title": "string", - "type": "string" - }, - { - "title": "number", - "type": "number" - }, - { - "title": "object", - "type": "object" - } - ] - } - }, { "title": "string", "type": "string" @@ -43334,1708 +43353,4304 @@ "title": "object", "type": "object" } - ], - "title": "Any" - }, - "LoyaltiesCreateTiersRequestBody": { - "title": "Loyalties Create Tiers Request Body", - "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", - "type": "array", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "LoyaltiesGetRewardAssignmentResponseBody": { - "$ref": "#/components/schemas/RewardAssignment" - }, - "LoyaltiesGetRewardDetailsResponseBody": { - "$ref": "#/components/schemas/Reward" - }, - "LoyaltiesListTiersRequestQuery": { - "title": "Loyalties List Tiers Request Query", - "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." - } - } + ] + } + }, + { + "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" }, - "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { - "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", + { "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." + "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" } } - }, - "LoyaltiesGetTierResponseBody": { + } + ] + } + }, + "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" - }, - "LoyaltiesListTiersResponseBody": { - "title": "Loyalties List Tiers Response Body", - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "description": "This is an object representing a loyalty tier. Loyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "LoyaltiesListMemberLoyaltyTiersResponseBody": { - "title": "Loyalties List Member Loyalty Tiers Response Body", - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/LoyaltyTier" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "EarningRule": { - "allOf": [ - { - "$ref": "#/components/schemas/EarningRuleBase" - }, - { - "type": "object", - "properties": { - "validation_rule_id": { - "type": [ - "string", - "null" - ], - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format." - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.\n\n- `true` indicates an active earning rule\n- `false` indicates an inactive earning rule" - } - }, - "required": [ - "validation_rule_id", - "updated_at", - "active" - ] - } - ] - }, - "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { - "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", - "type": "object", - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." - }, - "data_ref": { - "type": "string", - "enum": [ - "data" - ], - "description": "Identifies the name of the attribute that contains the array of earning rule objects." - }, - "data": { - "type": "array", - "description": "Contains array of earning rule objects.", - "items": { - "$ref": "#/components/schemas/EarningRule" - } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltiesListMemberLoyaltyTiersResponseBody": { + "title": "Loyalties List Member Loyalty Tiers Response Body", + "x-stoplight": { + "id": "s3zpgud510xl6" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoyaltyTier" + } + }, + "total": { + "type": "integer", + "description": "Total number of loyalty tier objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "EarningRule": { + "allOf": [ + { + "$ref": "#/components/schemas/EarningRuleBase" + }, + { + "type": "object", + "properties": { + "validation_rule_id": { + "type": [ + "string", + "null" + ], + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." }, - "required": [ - "object", - "data_ref", - "data", - "total" - ] - }, - "LoyaltyTierBase": { - "title": "Loyalty Tier Base", - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "earning_rules": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MappingPoints" - }, - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule." - }, - "rewards": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/MappingPoints" - }, - "description": "Contains a list of reward IDs and their points mapping for the given reward." - }, - "points": { - "type": "object", - "description": "Defines range of loyalty tier in points.", - "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." - }, - "to": { - "type": "integer", - "description": "Top points threshold value." - } - } - } + "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." }, - "required": [ - "name", - "points" - ] + "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" + } }, - "LoyaltyTier": { - "allOf": [ - { - "$ref": "#/components/schemas/LoyaltyTierBase" - }, - { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID." - }, - "campaign_id": { - "type": "string", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in points.", - "required": [ - "points" - ], - "properties": { - "points": { - "type": "object", - "description": "Defines range of loyalty tier in points.", - "properties": { - "from": { - "type": "integer", - "description": "Bottom points threshold value." - }, - "to": { - "type": "integer", - "description": "Top points threshold value." - } - } - } - } - }, - "expiration": { - "type": "object", - "description": "Defines loyalty tier expiration date.", - "properties": { - "customer_id": { - "type": "string" - }, - "campaign_id": { - "type": "string" - }, - "tier_id": { - "type": "string" - }, - "start_date": { - "type": "string", - "format": "date-time" - }, - "expiration_date": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } + "required": [ + "validation_rule_id", + "updated_at", + "active" + ] + } + ] + }, + "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { + "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", + "x-stoplight": { + "id": "i180zbh3ffwaa" + }, + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object represented by JSON. This object stores information about earning rules in a dictionary." + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ], + "description": "Identifies the name of the attribute that contains the array of earning rule objects." + }, + "data": { + "type": "array", + "description": "Contains array of earning rule objects.", + "items": { + "$ref": "#/components/schemas/EarningRule" + } + }, + "total": { + "type": "integer", + "description": "Total number of earning rule objects." + } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] + }, + "LoyaltyTierBase": { + "title": "Loyalty Tier Base", + "x-stoplight": { + "id": "3af9422223696" + }, + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Loyalty Tier name." + }, + "earning_rules": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule." + }, + "rewards": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/MappingPoints" + }, + "description": "Contains a list of reward IDs and their points mapping for the given reward." + }, + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." + }, + "to": { + "type": "integer", + "description": "Top points threshold value." + } + } + } + }, + "required": [ + "name", + "points" + ] + }, + "LoyaltyTier": { + "allOf": [ + { + "$ref": "#/components/schemas/LoyaltyTierBase" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique loyalty tier ID." + }, + "campaign_id": { + "type": "string", + "description": "Unique parent campaign ID." + }, + "metadata": { + "type": [ + "object", + "null" + ], + "description": "The metadata object stores all custom attributes assigned to the loyalty tier. A set of key/value pairs that you can attach to a loyalty tier object. It can be useful for storing additional information about the loyalty tier in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." + }, + "updated_at": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in points.", + "required": [ + "points" + ], + "properties": { + "points": { + "type": "object", + "description": "Defines range of loyalty tier in points.", + "properties": { + "from": { + "type": "integer", + "description": "Bottom points threshold value." }, - "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." + "to": { + "type": "integer", + "description": "Top points threshold value." + } } - }, - "required": [ - "id", - "campaign_id", - "metadata", - "created_at", - "config", - "object" - ] + } } - ] - }, - "MappingMultiply": { - "title": "MappingMultiply", - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "MULTIPLY" - ], - "description": "Type of calculation." + }, + "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" + } }, - "multiplier": { - "type": "number", - "description": "Multiplication factor used to multiply the points to obtain the mapped points." - } + "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", + "description": "Request body schema for importing data using a CSV file.", + "format": "binary", + "properties": { + "file": { + "type": "string", + "format": "binary", + "description": "File path." + } + }, + "required": [ + "file" + ] + }, + "a_res_async_actions": { + "type": "object", + "title": "Asynchronous Actions", + "description": "Response to requests that are processed asynchronously.", + "additionalProperties": false, + "examples": [ + { + "async_action_id": "aa_0a875d56c805df6601" + } + ], + "properties": { + "async_action_id": { + "type": "string", + "example": "aa_0a875d56c805df6601", + "description": "The ID of the scheduled asynchronous action." + } + }, + "required": [ + "async_action_id" + ] + }, + "error": { + "title": "error", + "type": "object", + "properties": {}, + "discriminator": { + "propertyName": "key", + "mapping": { + "not_enough_codes": "not_enough_codes" + } + }, + "description": "Short error response", + "examples": [] + }, + "e_error": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "error": { + "type": "object", + "description": "Contains custom user-defined error message translation.", + "properties": { + "message": { + "type": "string", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + } + } + } + } + }, + "e_error_expanded": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Unique resource ID that can be used in another endpoint to get more details.", + "example": "rf_0c5d710a87c8a31f86" + }, + "resource_type": { + "type": "string", + "description": "The resource type.", + "example": "redemption" + }, + "error": { + "type": "object", + "description": "Contains custom user-defined error message translation.", + "properties": { + "message": { + "type": "string", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + } + } + } + } + }, + "e_error_no_translation": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_integration_key": { + "title": "Error Object", + "type": "object", + "description": "Error details", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "key": { + "type": "string", + "description": "Short string describing the kind of error which occurred." + } + } + }, + "e_400_missing_param": { + "description": "Error: Bad Request → Missing Parameters", + "type": "object", + "title": "Missing Parameters", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "missing_param", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Missing required parameter", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Parameter 'custom_event.schema_id' is required", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96c19b1a41c03999", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_not_enough_source_ids": { + "description": "Error: Bad Request → Missing Parameters", + "type": "object", + "title": "Not Enough Source ID's", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "not_enought_source_ids", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Not enough source_ids", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Specify at least 1 source_id", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96c19b1a41c03999", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_invalid_payload": { + "title": "Invalid Payload", + "type": "object", + "description": "Error: Bad Request → Invalid Payload", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_payload", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid payload", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_invalid_balance": { + "title": "Invalid Balance", + "type": "object", + "description": "Error: Bad Request → Invalid Balance", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_balance", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_resource_in_use": { + "title": "Resource in use", + "type": "object", + "description": "Error: Bad Request - Resource in use", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "resource_in_use", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Resource in use", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "related_object_ids": { + "type": "array", + "description": "Name or ID of the resources that are related.", + "items": { + "type": "string", + "example": "rewa_5WV7H3y2lT3GGl03Xjw29IEc" + } + }, + "related_object_type": { + "type": "string", + "description": "Specifies the type of resource that is related." + } + } + }, + "e_400_invalid_export_fields": { + "title": "Invalid Export Fields", + "type": "object", + "description": "Error: Bad Request → Invalid Export Fields", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_export_fields", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid Export", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_invalid_voucher": { + "title": "Invalid Voucher", + "type": "object", + "description": "Error: Bad Request → Invalid Voucher", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "invalid_voucher", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Invalid Voucher", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a884c6be8c3756f42", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_invalid_validation_rules": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "Error's HTTP status code.", + "default": 400 + }, + "key": { + "type": "string", + "default": "invalid_validation_rules", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + } + }, + "title": "Invalid Validation Rules", + "description": "Error: Bad Request → Invalid Validation Rules" + }, + "e_400_not_enough_codes": { + "title": "Not Enough Codes", + "type": "object", + "description": "Error: Bad Request → Not enough codes", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "not_enough_codes", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Not enough codes", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Specify at least 1 code in codes.", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_metadata_validation_failed": { + "title": "Metadata Validation Failed", + "type": "object", + "description": "Error: Bad Request → Metadata validation failed", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "metadata_validation_failed", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Metadata validation failed", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Ranking: must be a number (actual value is 'true')", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_missing_reward": { + "title": "Missing Reward", + "type": "object", + "description": "Error: Bad Request → Missing Reward", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "missing_reward", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Missing reward", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "A reward is required when redeeming a LOYALTY_CARD", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." + }, + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." + }, + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "Missing reward = please add one.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + } + } + } + } + }, + "e_400_missing_order": { + "title": "Missing Order", + "type": "object", + "description": "Error: Bad Request → Missing Order", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "missing_order", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Missing order", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "An order is required when redeeming a LOYALTY_CARD", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." + }, + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." + }, + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "Missing order = please add one.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + } + } + } + } + }, + "e_400_loyalty_card_points_exceeded": { + "title": "Loyalty Card Points Exceeded", + "type": "object", + "description": "Error: Bad Request → Loyalty Card Points Exceeded", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "loyalty_card_points_exceeded", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "loyalty card points exceeded", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "SoAm6kbC", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a885062c80375740f", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "example": "rf_0b3a1814550e5aaa34", + "description": "Unique resource ID that can be used in another endpoint to get more details." + }, + "resource_type": { + "type": "string", + "example": "redemption", + "description": "The resource type." + }, + "error": { + "type": "object", + "description": "Contains error message translation.", + "properties": { + "message": { + "type": "string", + "example": "There are not enough loyalty points on the card.", + "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + } + } + } + } + }, + "e_403_wrong_api_endpoint": { + "title": "Wrong API Endpoint", + "type": "object", + "description": "Error: Forbidden → Wrong API Endpoint", + "properties": { + "code": { + "type": "integer", + "default": 403, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "wrong_api_endpoint", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Wrong API endpoint", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "example": "Given project is bound to different API endpoint, you should use: https://api.voucherify.io", + "description": "A human-readable message providing more details about the error." + } + } + }, + "e_404_not_found": { + "description": "Error: Not Found", + "type": "object", + "title": "Not Found", + "properties": { + "code": { + "type": "integer", + "default": 404, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "not_found", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Resource not found", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0a96cd820301c0483a", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Name or ID of the resource that was not found." + }, + "resource_type": { + "type": "string", + "description": "Specifies the type of resource that was not found." + } + } + }, + "e_409_duplicate_found": { + "title": "Duplicated Resource", + "type": "object", + "description": "Error: Conflict → Duplicated resource found", + "properties": { + "code": { + "type": "integer", + "default": 409, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_found", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicated resource found", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + }, + "resource_id": { + "type": "string", + "description": "Name or ID of the resource that already exists." + }, + "resource_type": { + "type": "string", + "description": "Specifies the type of resource that already exists." + } + } + }, + "e_400_duplicate_key": { + "title": "Duplicated Key", + "type": "object", + "description": "Error: Conflict → Duplicated key found", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_key", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicate codes", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + } + } + }, + "e_400_duplicate_source_id": { + "title": "Duplicate Source ID", + "type": "object", + "description": "Error: Conflict → Duplicate source_id found", + "properties": { + "code": { + "type": "integer", + "default": 400, + "description": "Error's HTTP status code." + }, + "key": { + "type": "string", + "default": "duplicate_source_id", + "description": "Short string describing the kind of error which occurred." + }, + "message": { + "type": "string", + "default": "Duplicate source_id", + "description": "A human-readable message providing a short description about the error." + }, + "details": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "request_id": { + "type": "string", + "example": "v-0aa36e570e44cb3bdd", + "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" } - }, - "MappingFixed": { - "title": "MappingFixed", + ] + } + ] + }, + "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": { - "type": { - "type": "string", - "enum": [ - "CUSTOM" - ], - "description": "Type of calculation.\n\n" + "id": { + "type": "string" }, - "points": { - "type": "integer", - "description": "Fixed number of points to be applied." - } - } - }, - "MappingPoints": { - "anyOf": [ - { - "$ref": "#/components/schemas/MappingMultiply" + "product_id": { + "type": "string" }, - { - "$ref": "#/components/schemas/MappingFixed" - } - ] - }, - "a_req_importCSV": { - "type": "object", - "title": "Import CSV file", - "description": "Request body schema for importing data using a CSV file.", - "format": "binary", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "File path." + "object": { + "enum": [ + "sku", + "product" + ] } }, "required": [ - "file" + "id", + "object" ] - }, - "a_res_async_actions": { - "type": "object", - "title": "Asynchronous Actions", - "description": "Response to requests that are processed asynchronously.", - "additionalProperties": false, - "examples": [ - { - "async_action_id": "aa_0a875d56c805df6601" - } - ], - "properties": { - "async_action_id": { - "type": "string", - "example": "aa_0a875d56c805df6601", - "description": "The ID of the scheduled asynchronous action." - } + } + } + }, + "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" }, - "required": [ - "async_action_id" - ] - }, - "error": { - "title": "error", - "type": "object", - "properties": {}, - "discriminator": { - "propertyName": "key", - "mapping": { - "not_enough_codes": "not_enough_codes" - } + "id": { + "$ref": "#/components/schemas/FieldConditions" }, - "description": "Short error response", - "examples": [] - }, - "e_error": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "error": { - "type": "object", - "description": "Contains custom user-defined error message translation.", - "properties": { - "message": { - "type": "string", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" - } - } - } - } - }, - "e_error_expanded": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Unique resource ID that can be used in another endpoint to get more details.", - "example": "rf_0c5d710a87c8a31f86" - }, - "resource_type": { - "type": "string", - "description": "The resource type.", - "example": "redemption" - }, - "error": { - "type": "object", - "description": "Contains custom user-defined error message translation.", - "properties": { - "message": { - "type": "string", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" - } - } - } - } - }, - "e_error_no_translation": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_integration_key": { - "title": "Error Object", - "type": "object", - "description": "Error details", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "key": { - "type": "string", - "description": "Short string describing the kind of error which occurred." - } - } - }, - "e_400_missing_param": { - "description": "Error: Bad Request → Missing Parameters", - "type": "object", - "title": "Missing Parameters", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_param", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing required parameter", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Parameter 'custom_event.schema_id' is required", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96c19b1a41c03999", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_not_enough_source_ids": { - "description": "Error: Bad Request → Missing Parameters", - "type": "object", - "title": "Not Enough Source ID's", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_enought_source_ids", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Not enough source_ids", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Specify at least 1 source_id", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96c19b1a41c03999", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_payload": { - "title": "Invalid Payload", - "type": "object", - "description": "Error: Bad Request → Invalid Payload", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_payload", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid payload", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_balance": { - "title": "Invalid Balance", - "type": "object", - "description": "Error: Bad Request → Invalid Balance", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_balance", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_resource_in_use": { - "title": "Resource in use", - "type": "object", - "description": "Error: Bad Request - Resource in use", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "resource_in_use", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Resource in use", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "related_object_ids": { - "type": "array", - "description": "Name or ID of the resources that are related.", - "items": { - "type": "string", - "example": "rewa_5WV7H3y2lT3GGl03Xjw29IEc" - } - }, - "related_object_type": { - "type": "string", - "description": "Specifies the type of resource that is related." - } - } - }, - "e_400_invalid_export_fields": { - "title": "Invalid Export Fields", - "type": "object", - "description": "Error: Bad Request → Invalid Export Fields", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_export_fields", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid Export", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_voucher": { - "title": "Invalid Voucher", - "type": "object", - "description": "Error: Bad Request → Invalid Voucher", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "invalid_voucher", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Invalid Voucher", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a884c6be8c3756f42", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, - "e_400_invalid_validation_rules": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "description": "Error's HTTP status code.", - "default": 400 - }, - "key": { - "type": "string", - "default": "invalid_validation_rules", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - } + "product_id": { + "$ref": "#/components/schemas/FieldConditions" }, - "title": "Invalid Validation Rules", - "description": "Error: Bad Request → Invalid Validation Rules" - }, - "e_400_not_enough_codes": { - "title": "Not Enough Codes", - "type": "object", - "description": "Error: Bad Request → Not enough codes", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_enough_codes", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Not enough codes", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Specify at least 1 code in codes.", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + "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": { + "req_vouchers_metadata_1": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726" + ], + "metadata": { + "lang": "en", + "authorized_internally": true + } + } + }, + "req_vouchers_metadata_2": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726", + "PROMO-CODE888" + ], + "metadata": { + "lang": "en", + "authorized_internally": true + } + } + }, + "res_async_actions": { + "value": { + "async_action_id": "aa_0ab2df092385be5ca5" + } + } + } + }, + "paths": { + "/v1/voucher-object": { + "get": { + "operationId": "voucher-object", + "tags": [ + "VOUCHERS API" + ], + "summary": "Voucher Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Voucher Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" } } + } + } + } + } + }, + "/v1/vouchers": { + "get": { + "operationId": "list-vouchers", + "tags": [ + "VOUCHERS API" + ], + "summary": "List Vouchers", + "description": "Returns a list of your vouchers. By default, the vouchers are returned sorted by creation date, with the most recent vouchers appearing first. A maximum of 10 vouchers are returned in the response.\n\nWhen you get a list of vouchers, you can optionally specify query parameters to customize the amount of vouchers returned per call using `limit`, which page of vouchers to return using `page`, sort the vouchers using the `order` query parameter and more.\n\nThis method will return an error when trying to return a limit of more than 100 vouchers.\n", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/category" + }, + { + "in": "query", + "name": "campaign_id", + "description": "Limit search results to vouchers within the specified campaign", + "schema": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3" + } + }, + { + "$ref": "#/components/parameters/customer" + }, + { + "$ref": "#/components/parameters/campaign" + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] }, - "e_400_metadata_validation_failed": { - "title": "Metadata Validation Failed", - "type": "object", - "description": "Error: Bad Request → Metadata validation failed", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "metadata_validation_failed", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Metadata validation failed", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Ranking: must be a number (actual value is 'true')", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary that contains an array of vouchers. Each entry in the array is a separate voucher object. If no more vouchers are available (query parameter `page` incremented over and above the voucher count), the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_GET" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "vouchers", + "vouchers": [ + { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + }, + { + "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "code": "AmountDiscount", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 400, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-01T00:00:00.000Z", + "expiration_date": "2022-10-31T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-12T07:51:02.145Z", + "updated_at": "2022-09-19T08:29:12.566Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/AmountDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AmountDiscount/publications?page=1&limit=10" + }, + "object": "voucher" + } + ], + "total": 2 + } + } } } - }, - "e_400_missing_reward": { - "title": "Missing Reward", - "type": "object", - "description": "Error: Bad Request → Missing Reward", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_reward", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing reward", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "A reward is required when redeeming a LOYALTY_CARD", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." - }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." + } + } + } + } + }, + "/v1/vouchers/{code}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "7fjWdr" + }, + "in": "path", + "name": "code", + "description": "A unique **code** that identifies the voucher.", + "required": true + } + ], + "get": { + "operationId": "get-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Get Voucher", + "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "Missing reward = please add one.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + "examples": { + "Loyalty Card": { + "value": { + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 10, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Card": { + "value": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": null, + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 55000, + "balance": 44700, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" + }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2022-08-29T09:37:20.185Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount": { + "value": { + "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "code": "AMOUNTDISCOUNTUSINGFORMULA", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 400, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-01T00:00:00.000Z", + "expiration_date": "2022-10-31T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-12T07:51:02.145Z", + "updated_at": "2022-09-19T08:29:12.566Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_tO5AuzXIkkNPTC50", + "rule_id": "val_5h0wc453_2", + "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "related_object_type": "voucher", + "created_at": "2022-09-19T08:27:59.160Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Percent Discount": { + "value": { + "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "code": "PercentDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 3, + "percent_off_formula": "CUSTOMER_METADATA(\"age\")", + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T10:20:46.467Z", + "updated_at": "2022-09-15T10:43:51.116Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_EuYasM5fyDR9G2r4", + "rule_id": "val_0k19OQHjNZRT", + "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "related_object_type": "voucher", + "created_at": "2022-09-15T10:20:46.460Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 3, + "object": "list", + "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Fixed Discount": { + "value": { + "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", + "code": "FixedDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ORDER", + "fixed_amount": 200, + "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T12:46:55.818Z", + "updated_at": "2022-09-16T10:03:25.057Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 5, + "object": "list", + "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount": { + "value": { + "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", + "code": "UnitDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", + "unit_type": "sku_0b661e41eccd35a8e9", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" + }, + "barcode": { + "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-15T13:36:27.838Z", + "updated_at": "2022-09-16T10:03:25.057Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 5, + "object": "list", + "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Multiple Unit Discount": { + "value": { + "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", + "code": "UnitDiscountUsingFormulaForMultipleProductVariants", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 3, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "unit_type": "sku_0b661e41fc8d35a8f7", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 4, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", + "unit_type": "sku_0b661e41fc8d35a8f6", + "effect": "ADD_NEW_ITEMS" + } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-16T05:44:50.722Z", + "updated_at": "2022-09-19T09:25:17.303Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 3, + "object": "list", + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Free Shipping": { + "value": { + "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", + "code": "FreeShipping", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" + }, + "barcode": { + "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-16T07:19:53.945Z", + "updated_at": "2022-09-16T07:26:35.361Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" + }, + "object": "voucher" } } } } - }, - "e_400_missing_order": { - "title": "Missing Order", - "type": "object", - "description": "Error: Bad Request → Missing Order", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "missing_order", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Missing order", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "An order is required when redeeming a LOYALTY_CARD", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." - }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." + } + }, + "404": { + "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "Missing order = please add one.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", + "request_id": "v-0bb3403b9a158c87b2", + "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", + "resource_type": "voucher" } } } } - }, - "e_400_loyalty_card_points_exceeded": { - "title": "Loyalty Card Points Exceeded", - "type": "object", - "description": "Error: Bad Request → Loyalty Card Points Exceeded", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "loyalty_card_points_exceeded", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "loyalty card points exceeded", - "description": "A human-readable message providing a short description about the error." + } + } + } + }, + "put": { + "operationId": "update-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Voucher", + "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_PUT" + }, + "examples": { + "Percent Discount": { + "value": { + "category": "Second", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "amount_limit": 1800, + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-02-01T00:00:00Z", + "expiration_date": "2023-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT2H", + "interval": "P3D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": false, + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", + "metadata": { + "Season": "Winter" + } + } }, - "details": { - "type": "string", - "example": "SoAm6kbC", - "description": "A human-readable message providing more details about the error." + "Gift Card": { + "value": { + "category": "Existing Customers", + "gift": { + "amount": 20000, + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z", + "active": false, + "additional_info": "This gift card is disabled.", + "metadata": { + "test": false, + "locale": "de-en-pl" + } + } }, - "request_id": { - "type": "string", - "example": "v-0a885062c80375740f", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + "Loyalty Card": { + "value": { + "category": "Existing Customers", + "loyalty_card": { + "points": 20000 + }, + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", + "metadata": { + "test": false, + "locale": "de-en-pl" + } + } }, - "resource_id": { - "type": "string", - "example": "rf_0b3a1814550e5aaa34", - "description": "Unique resource ID that can be used in another endpoint to get more details." + "Amount Discount": { + "value": { + "category": "Existing Customers", + "discount": { + "amount_off": 2000, + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z" + } }, - "resource_type": { - "type": "string", - "example": "redemption", - "description": "The resource type." + "Fixed Discount": { + "value": { + "category": "Existing Customers", + "discount": { + "type": "FIXED", + "fixed_amount": 2000, + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z" + } }, - "error": { - "type": "object", - "description": "Contains error message translation.", - "properties": { - "message": { - "type": "string", - "example": "There are not enough loyalty points on the card.", - "description": "Error message translation defined in Dashboard → Project Settings → Error Messages" + "Unit Discount": { + "value": { + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] } } } } - }, - "e_403_wrong_api_endpoint": { - "title": "Wrong API Endpoint", - "type": "object", - "description": "Error: Forbidden → Wrong API Endpoint", - "properties": { - "code": { - "type": "integer", - "default": 403, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "wrong_api_endpoint", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Wrong API endpoint", - "description": "A human-readable message providing a short description about the error." + } + } + }, + "responses": { + "200": { + "description": "Returns the voucher object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" }, - "details": { - "type": "string", - "example": "Given project is bound to different API endpoint, you should use: https://api.voucherify.io", - "description": "A human-readable message providing more details about the error." + "examples": { + "Percent Discount": { + "value": { + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", + "campaign": null, + "campaign_id": null, + "category": "Second", + "category_id": "cat_0bb81a481615a37b5e", + "categories": [ + { + "id": "cat_0bb81a481615a37b5e", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-09-20T05:58:01.561Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 1800, + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-02-01T00:00:00.000Z", + "expiration_date": "2023-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "PT2H" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": false, + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", + "metadata": { + "Season": "Winter" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:41:30.976Z", + "updated_at": "2022-09-20T06:00:50.202Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 101, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Card": { + "value": { + "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", + "code": "welcomegiftcard", + "campaign": null, + "campaign_id": null, + "category": "Existing Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 20000, + "balance": 20000, + "effect": "APPLY_TO_ITEMS" + }, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This gift card is disabled.", + "metadata": { + "test": false, + "locale": "de-en-pl" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:09:49.665Z", + "updated_at": "2022-02-17T11:11:48.071Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Loyalty Card": { + "value": { + "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", + "code": "welcomeloyalty", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "Existing Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 20000, + "balance": 20000 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", + "metadata": { + "test": false, + "locale": "de-en-pl" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:12:01.428Z", + "updated_at": "2022-02-17T11:20:12.447Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount": { + "value": { + "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "code": "WelcomeDiscountAmount", + "campaign": null, + "campaign_id": null, + "category": "Existing Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T11:41:05.236Z", + "updated_at": "2022-02-17T11:45:29.269Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_tDN7MJNayjrf1wyn", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "related_object_type": "voucher", + "created_at": "2022-02-17T11:41:05.210Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Fixed Discount": { + "value": { + "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", + "code": "wou4w1Og", + "campaign": "Fixed", + "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", + "category": "Existing Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS", + "fixed_amount": 2000 + }, + "gift": null, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T11:54:37.766Z", + "updated_at": "2022-02-17T12:04:53.346Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount": { + "value": { + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": "2022-02-18T06:31:08.630Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 5, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + }, + "object": "voucher" + } + } } } - }, - "e_404_not_found": { - "description": "Error: Not Found", - "type": "object", - "title": "Not Found", - "properties": { - "code": { - "type": "integer", - "default": 404, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_found", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Resource not found", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96cd820301c0483a", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Name or ID of the resource that was not found." + } + }, + "400": { + "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "resource_type": { - "type": "string", - "description": "Specifies the type of resource that was not found." + "examples": { + "Invalid Voucher": { + "value": { + "code": 400, + "key": "invalid_voucher", + "message": "Invalid Voucher", + "details": "It is not possible to change Voucher discount type", + "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" + } + } } } + } + } + } + }, + "delete": { + "operationId": "delete-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Delete Voucher", + "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", + "parameters": [ + { + "schema": { + "type": "string" }, - "e_409_duplicate_found": { - "title": "Duplicated Resource", - "type": "object", - "description": "Error: Conflict → Duplicated resource found", - "properties": { - "code": { - "type": "integer", - "default": 409, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_found", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicated resource found", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - }, - "resource_id": { - "type": "string", - "description": "Name or ID of the resource that already exists." + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the voucher with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "resource_type": { - "type": "string", - "description": "Specifies the type of resource that already exists." + "examples": { + "Voucher Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id 10OFF", + "request_id": "v-0ae28d3cec96bb1b7e", + "resource_id": "10OFF", + "resource_type": "voucher" + } + } } } - }, - "e_400_duplicate_key": { - "title": "Duplicated Key", - "type": "object", - "description": "Error: Conflict → Duplicated key found", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." + } + } + } + }, + "post": { + "operationId": "create-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Create Voucher", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the voucher that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_POST" + }, + "examples": { + "Percentage Discount": { + "value": { + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "percent_off": 10, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2022-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 10 + }, + "metadata": { + "test": true, + "locale": "de-en" + }, + "validation_rules": [ + "val_4j7DCRm2IS59" + ] + } }, - "key": { - "type": "string", - "default": "duplicate_key", - "description": "Short string describing the kind of error which occurred." + "Gift Card": { + "value": { + "category": "New Customers", + "type": "GIFT_VOUCHER", + "gift": { + "amount": 10000, + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2022-01-01T00:00:00Z", + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + } + } }, - "message": { - "type": "string", - "default": "Duplicate codes", - "description": "A human-readable message providing a short description about the error." + "Loyalty Card": { + "value": { + "category": "New Customers", + "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 10000 + }, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + } + } }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." + "Amount Discount with Formula": { + "value": { + "category": "First", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "redemption": { + "quantity": 100 + }, + "metadata": { + "Season": "Spring" + } + } }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + "Percent Discount with Formula": { + "value": { + "category": "First", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "amount_limit": 1700, + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 0, + 1 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "redemption": { + "quantity": 101 + }, + "metadata": { + "Season": "Fall" + } + } } } - }, - "e_400_duplicate_source_id": { - "title": "Duplicate Source ID", - "type": "object", - "description": "Error: Conflict → Duplicate source_id found", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_source_id", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicate source_id", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." + "examples": { + "Percentage Discount": { + "value": { + "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "code": "welcome", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:05:34.668Z", + "updated_at": null, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_74F7QZoYbUoljwQO", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "related_object_type": "voucher", + "created_at": "2022-02-17T09:05:34.642Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcome/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Card": { + "value": { + "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", + "code": "welcomegiftcard", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 10000, + "balance": 10000, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:09:49.665Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Loyalty Card": { + "value": { + "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", + "code": "welcomeloyalty", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "New Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 10000, + "balance": 10000 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T09:12:01.428Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Amount Discount with Formula": { + "value": { + "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", + "code": "amount1", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "metadata": { + "Season": "Spring" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:22:50.552Z", + "updated_at": null, + "redemption": { + "quantity": 100, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/amount1/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Percent Discount with Formula": { + "value": { + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", + "campaign": null, + "campaign_id": null, + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 1700, + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 0, + 1 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "metadata": { + "Season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T14:41:30.976Z", + "updated_at": null, + "redemption": { + "quantity": 101, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + }, + "object": "voucher" + } + } } } - }, - "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" + } + }, + "409": { + "description": "Returns an error if a voucher code already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" }, - { - "anyOf": [ - { - "$ref": "#/components/schemas/product_collections_static_collection" - }, - { - "$ref": "#/components/schemas/product_collections_dynamic_collection" + "examples": { + "Duplicate Code": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated voucher exists with id CODE", + "request_id": "v-0ae786a8f786b73dfa", + "resource_id": "CODE", + "resource_type": "voucher" } - ] - } - ] - }, - "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" - ] } } + } + } + } + } + } + }, + "/v1/vouchers/": { + "post": { + "operationId": "generate-random-code", + "tags": [ + "VOUCHERS API" + ], + "summary": "Generate Random Code", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the voucher that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers__POST" }, - "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" + "examples": { + "Percentage Discount": { + "value": { + "category": "New Customers", + "code": "NEW-WELCOME-COUPON", + "type": "DISCOUNT_VOUCHER", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "discount": { + "percent_off": 10, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" }, - "source_id": { - "$ref": "#/components/schemas/FieldConditions" + "start_date": "2016-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 10 }, - "name": { - "$ref": "#/components/schemas/FieldConditions" + "metadata": { + "test": true, + "locale": "de-en" }, - "price": { - "$ref": "#/components/schemas/FieldConditions" + "validation_rules": [ + "val_4j7DCRm2IS59" + ] + } + }, + "Gift Card": { + "value": { + "category": "New Customers", + "type": "GIFT_VOUCHER", + "gift": { + "amount": 10000, + "effect": "APPLY_TO_ORDER" }, - "object": { - "$ref": "#/components/schemas/FieldConditions" + "start_date": "2022-01-01T00:00:00Z", + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" }, - "attributes": { - "$ref": "#/components/schemas/FieldConditions" + "code_config": { + "pattern": "GIFT-CARD-##########", + "prefix": "New-", + "postfix": "0", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + } + } + }, + "Loyalty Card": { + "value": { + "category": "New Customers", + "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 10000 }, + "additional_info": "This loyalty card is enabled immediately upon creation.", "metadata": { - "$ref": "#/components/schemas/FieldConditions" + "test": true, + "locale": "de-en" }, - "image_url": { - "$ref": "#/components/schemas/FieldConditions" - }, - "skus": { - "$ref": "#/components/schemas/FieldConditions" + "code_config": { + "pattern": "LOYALTY-CARD-##", + "prefix": "New-", + "postfix": "1", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + } + } + }, + "Unit Discount Multiple Items": { + "value": { + "category": "New Customers", + "code": "MultipleUnitTypesUnitDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] }, - "created_at": { - "$ref": "#/components/schemas/FieldConditions" + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 5 }, - "updated_at": { - "$ref": "#/components/schemas/FieldConditions" + "metadata": { + "test": true, + "locale": "de-en" + } + } + }, + "Unit Discount Single Item": { + "value": { + "category": "New Customers", + "code": "AddMissingItemDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 3 } } } - }, - "required": [ - "type", - "name", - "filter" - ] + } } - }, - "examples": { - "req_vouchers_metadata_1": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726" - ], - "metadata": { - "lang": "en", - "authorized_internally": true + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Percentage Discount": { + "value": { + "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "code": "NEW-WELCOME-COUPON", + "campaign": "Bug fix", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2016-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T07:14:40.096Z", + "updated_at": null, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_COu5PJAsWmAwuCqR", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "related_object_type": "voucher", + "created_at": "2022-02-17T07:14:40.280Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Gift Voucher": { + "value": { + "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", + "code": "New-GIFT-CARD-8tqB6FcyhE0", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 10000, + "balance": 10000, + "effect": "APPLY_TO_ORDER" + }, + "loyalty_card": null, + "start_date": "2022-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T07:49:10.834Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Loyalty Card": { + "value": { + "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", + "code": "New-LOYALTY-CARD-UC1", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "New Customers", + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 10000, + "balance": 10000 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" + }, + "barcode": { + "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T08:06:41.091Z", + "updated_at": null, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount Multiple Items": { + "value": { + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": null, + "redemption": { + "quantity": 5, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Unit Discount Single Item": { + "value": { + "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", + "code": "AddMissingItemDiscount", + "campaign": null, + "campaign_id": null, + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T06:46:44.536Z", + "updated_at": null, + "redemption": { + "quantity": 3, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" + }, + "object": "voucher" + } + } } } - }, - "req_vouchers_metadata_2": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726", - "PROMO-CODE888" - ], - "metadata": { - "lang": "en", - "authorized_internally": true + } + } + } + } + }, + "/v1/vouchers/{code}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "2CpRCE2c" + }, + "name": "code", + "in": "path", + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.", + "required": true + } + ], + "post": { + "operationId": "enable-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Enable Voucher", + "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThe method sets the voucher state to **active**. The voucher can be redeemed - only if the redemption occurs after the start date and the voucher is not expired.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2022-09-19T11:54:17.248Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "created_at": "2022-09-19T10:06:07.934Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" + } + } } } - }, - "res_async_actions": { - "value": { - "async_action_id": "aa_0ab2df092385be5ca5" + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } } } } - }, - "paths": { - "/v1/voucher-object": { - "get": { - "operationId": "voucher-object", - "tags": [ - "VOUCHERS API" - ], - "summary": "Voucher Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Voucher Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - } + } + } + }, + "/v1/vouchers/{code}/disable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "2CpRCE2c" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "disable-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Disable Voucher", + "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThis method sets the voucher state to **inactive**. The voucher cannot be redeemed.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": false, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2022-09-19T11:53:23.452Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "created_at": "2022-09-19T10:06:07.934Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" } } } } } }, - "/v1/vouchers": { - "get": { - "operationId": "list-vouchers", - "tags": [ - "VOUCHERS API" - ], - "summary": "List Vouchers", - "description": "Returns a list of your vouchers. By default, the vouchers are returned sorted by creation date, with the most recent vouchers appearing first. A maximum of 10 vouchers are returned in the response.\n\nWhen you get a list of vouchers, you can optionally specify query parameters to customize the amount of vouchers returned per call using `limit`, which page of vouchers to return using `page`, sort the vouchers using the `order` query parameter and more.\n\nThis method will return an error when trying to return a limit of more than 100 vouchers.\n", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/category" + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - { - "in": "query", - "name": "campaign_id", - "description": "Limit search results to vouchers within the specified campaign", - "schema": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3" + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } } - }, - { - "$ref": "#/components/parameters/customer" - }, - { - "$ref": "#/components/parameters/campaign" - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/vouchers/{code}/balance": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "add-remove-gift-voucher-balance", + "tags": [ + "VOUCHERS API" + ], + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "Add or Remove Gift Card Balance", + "description": "Add balance to an existing gift card.", + "requestBody": { + "required": true, + "description": "Provide the amount to be added to/subtracted from the gift card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_code_balance" + }, + "examples": { + "Example": { + "value": { + "amount": 10000 + } } - ], - "responses": { - "200": { - "description": "Returns a dictionary that contains an array of vouchers. Each entry in the array is a separate voucher object. If no more vouchers are available (query parameter `page` incremented over and above the voucher count), the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_GET" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "vouchers", - "vouchers": [ - { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - }, - { - "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "code": "AmountDiscount", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 400, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-01T00:00:00.000Z", - "expiration_date": "2022-10-31T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-12T07:51:02.145Z", - "updated_at": "2022-09-19T08:29:12.566Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/AmountDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AmountDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - ], - "total": 2 - } - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a balance object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_code_balance" + }, + "examples": { + "Example": { + "value": { + "amount": 10000, + "total": 20100, + "balance": 20100, + "type": "gift_voucher", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" } } } @@ -45043,6319 +47658,5452 @@ } } }, - "/v1/vouchers/{code}": { - "parameters": [ - { + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "7fjWdr" + "$ref": "#/components/schemas/e_404_not_found" }, - "in": "path", - "name": "code", - "description": "A unique **code** that identifies the voucher.", - "required": true - } - ], - "get": { - "operationId": "get-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Get Voucher", - "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } } - ], - "responses": { - "200": { - "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Card": { - "value": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": null, - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 55000, - "balance": 44700, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + } + } + } + } + }, + "/v1/vouchers/{code}/transactions": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "get": { + "operationId": "list-gift-card-transactions", + "tags": [ + "VOUCHERS API" + ], + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "List Gift Card Transactions", + "description": "List transactions that are associated with credit movements on a gift card.", + "responses": { + "200": { + "description": "Returns a dictionary of transaction objects", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_code_transactions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dccc4d5813e71bd", + "source_id": "20230317_subtract_1", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "API", + "reason": "Subtracting credits from card", + "type": "CREDITS_REMOVAL", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128020, + "amount": -2000, + "object": "balance", + "balance": 121020, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2022-08-29T09:37:20.185Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T15:50:00.786Z" }, - "Amount Discount": { - "value": { - "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "code": "AMOUNTDISCOUNTUSINGFORMULA", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 400, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-01T00:00:00.000Z", - "expiration_date": "2022-10-31T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-12T07:51:02.145Z", - "updated_at": "2022-09-19T08:29:12.566Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_tO5AuzXIkkNPTC50", - "rule_id": "val_5h0wc453_2", - "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "related_object_type": "voucher", - "created_at": "2022-09-19T08:27:59.160Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" - }, - "object": "voucher" - } + { + "id": "vtx_0c9dcc920ac0e9ef82", + "source_id": "20230317_add_1", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "API", + "reason": "Adding more points to card", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130020, + "amount": 20, + "object": "balance", + "balance": 123020, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T15:49:08.768Z" }, - "Percent Discount": { - "value": { - "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "code": "PercentDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 3, - "percent_off_formula": "CUSTOMER_METADATA(\"age\")", - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" + { + "id": "vtx_0c94f018d30bef6689", + "source_id": "HRwc0oHz_reward", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "cash reward", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": 2000, + "object": "balance", + "balance": 123000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } - }, - "is_referral_code": false, - "created_at": "2022-09-15T10:20:46.467Z", - "updated_at": "2022-09-15T10:43:51.116Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_EuYasM5fyDR9G2r4", - "rule_id": "val_0k19OQHjNZRT", - "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "related_object_type": "voucher", - "created_at": "2022-09-15T10:20:46.460Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 3, - "object": "list", - "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" - }, - "object": "voucher" - } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:38:02.055Z" }, - "Fixed Discount": { - "value": { - "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", - "code": "FixedDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ORDER", - "fixed_amount": 200, - "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" + { + "id": "vtx_0c94edbbaccbef5db6", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REFUND", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": 44, + "object": "balance", + "balance": 121000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } }, - "is_referral_code": false, - "created_at": "2022-09-15T12:46:55.818Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "order": { + "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", + "source_id": null }, "redemption": { - "quantity": null, - "redeemed_quantity": 5, - "object": "list", - "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" + "id": "r_0c94ed583fcafc31c1" }, - "object": "voucher" - } + "rollback": { + "id": "rr_0c94edbb8d0bef5d9e" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:27:42.389Z" }, - "Unit Discount": { - "value": { - "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", - "code": "UnitDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", - "unit_type": "sku_0b661e41eccd35a8e9", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" - }, - "barcode": { - "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" + { + "id": "vtx_0c94ed584f4afc31da", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REDEMPTION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": -44, + "object": "balance", + "balance": 120956, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } }, - "is_referral_code": false, - "created_at": "2022-09-15T13:36:27.838Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "order": { + "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", + "source_id": null }, "redemption": { - "quantity": null, - "redeemed_quantity": 5, - "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" - }, - "object": "voucher" - } + "id": "r_0c94ed583fcafc31c1" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:26:00.640Z" }, - "Multiple Unit Discount": { - "value": { - "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", - "code": "UnitDiscountUsingFormulaForMultipleProductVariants", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 3, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "unit_type": "sku_0b661e41fc8d35a8f7", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 4, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", - "unit_type": "sku_0b661e41fc8d35a8f6", - "effect": "ADD_NEW_ITEMS" - } - ] - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" + { + "id": "vtx_0c94e9432c4afc2134", + "source_id": "HRwc0oHz_removal", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "removal", + "type": "CREDITS_REMOVAL", + "details": { + "balance": { + "type": "gift_voucher", + "total": 128000, + "amount": -2000, + "object": "balance", + "balance": 121000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } - }, - "is_referral_code": false, - "created_at": "2022-09-16T05:44:50.722Z", - "updated_at": "2022-09-19T09:25:17.303Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 3, - "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" - }, - "object": "voucher" - } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:08:10.413Z" }, - "Free Shipping": { - "value": { - "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", - "code": "FreeShipping", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" - }, - "barcode": { - "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" + { + "id": "vtx_0c94e8100f8afc1c6c", + "source_id": null, + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": null, + "reason": null, + "type": "CREDITS_REDEMPTION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": -7000, + "object": "balance", + "balance": 123000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" } }, - "is_referral_code": false, - "created_at": "2022-09-16T07:19:53.945Z", - "updated_at": "2022-09-16T07:26:35.361Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "order": { + "id": "ord_qZX3pEt5rFf5W23qRMDQcVt9", + "source_id": null }, "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" - }, - "object": "voucher" - } + "id": "r_0c94e80fda4afc1c59" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T18:02:55.935Z" + }, + { + "id": "vtx_0c94e6b82a4bef406c", + "source_id": "walmart", + "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "source": "voucherify-web-ui", + "reason": "return", + "type": "CREDITS_ADDITION", + "details": { + "balance": { + "type": "gift_voucher", + "total": 130000, + "amount": 5000, + "object": "balance", + "balance": 130000, + "related_object": { + "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-10T17:57:03.758Z" } - } + ], + "has_more": false } } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "request_id": "v-0bb3403b9a158c87b2", - "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "resource_type": "voucher" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" } } } } - }, - "put": { - "operationId": "update-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Voucher", - "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/vouchers/{code}/transactions/export": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "GIFT-CARD-1" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." + } + ], + "post": { + "operationId": "export-gift-card-transactions", + "tags": [ + "VOUCHERS API" + ], + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "summary": "Export Gift Card Transactions", + "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "requestBody": { + "description": "Specify the parameters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "source" + ] + } + } } - ], - "requestBody": { - "required": true, - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_PUT" - }, - "examples": { - "Percent Discount": { - "value": { - "category": "Second", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "amount_limit": 1800, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-02-01T00:00:00Z", - "expiration_date": "2023-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT2H", - "interval": "P3D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" + } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_export_transactions_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_ARi2UbRjgfrHQJoVcKFrBUgA", + "object": "export", + "created_at": "2023-05-16T08:30:21.496Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id", + "source" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } } } }, - "Gift Card": { - "value": { - "category": "Existing Customers", - "gift": { - "amount": 20000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z", - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" + "result": null, + "user_id": null + } + }, + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } } } }, - "Loyalty Card": { - "value": { - "category": "Existing Customers", - "loyalty_card": { - "points": 20000 + "result": null, + "user_id": null + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } + } + } + } + } + } + }, + "/v1/vouchers/import": { + "post": { + "operationId": "import-vouchers", + "tags": [ + "VOUCHERS API" + ], + "summary": "Import Vouchers", + "description": "Import standalone vouchers and gift cards into the repository.\n\n\n\n> 📘 Important notes\n>\n> - **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z.\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\nAny parameters not provided in the payload will be left blank or null.\n\nFor both **standalone discount vouchers and gift cards**, you can import the following fields: \n\n- code\n- category\n- active\n- type\n- start_date\n- expiration_date\n- redemption.quantity\n- additional_info\n- metadata\n\nFor **gift cards**, you can also import the following field:\n\n- gift.amount\n\nFor **discount vouchers**, you can import the `discount` object. The object will slightly vary depending on the type of discount. Each discount type **requires** the `type` to be defined in the import.\n\n| **Discount Type** | **Required fields** |\n|:---|:---|\n| Amount | amount_off, effect |\n| Percent | percent_off, effect |\n| Fixed | fixed_amount, effect |\n| Unit - One item | unit_off, unit_type, effect |\n| Unit - Multiple items | unit_off, unit_type, effect |\n| Shipping | unit_off, unit_type, effect |\n\nFields other than the ones listed above won't be imported. Even if provided, they will be silently skipped.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "The request body is an array of objects. Each object contains details about a specific voucher. ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_import" + }, + "examples": { + "Example": { + "value": [ + { + "code": "PROMO-CODE30OFF-NO-EFFECT", + "category": "new customer acquisition", + "type": "DISCOUNT_VOUCHER", + "active": true, + "discount": { + "amount_off": 3000, + "type": "AMOUNT" + }, + "start_date": "2020-12-01T23:00:00Z", + "expiration_date": "2023-12-19T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code1" + }, + { + "code": "PROMO-CODE30-PERCENT-NO-EFFECT", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "GIFT-CARD-100", + "type": "GIFT_VOUCHER", + "active": true, + "category": "new customer acquisition", + "gift": { + "amount": 10000 + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 5 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-GIFT-code2" + }, + { + "code": "PROMO-CODE1-PERCENT-EFFECT-ORDER", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE2-PERCENT-EFFECT-ITEM", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT", + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE1-PERCENT-NO-EFFECT-REDEEMED-QUANTITY-ATTRIBUTE-DOESNT-GET-PASSED", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "percent_off": 30, + "type": "PERCENT" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1, + "redeemed_quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE1-AMOUNT-EFFECT-ITEMS-PROPORTIONALLY", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "amount_off": 30, + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE1-FIXED-EFFECT-ORDER", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "fixed_amount": 30, + "type": "FIXED", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE1-UNIT-SINGLE-ITEM-EFFECT-MISSING", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE2-UNIT-MULTIPLE-ITEMS", + "type": "DISCOUNT_VOUCHER", + "active": true, + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" }, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_NEW_ITEMS" } - } + ] }, - "Amount Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "amount_off": 2000, - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 }, - "Fixed Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "type": "FIXED", - "fixed_amount": 2000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } + "metadata": { + "unit": "EUR" }, - "Unit Discount": { - "value": { - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - } - } - } + "additional_info": "secret-code2" + }, + { + "code": "PROMO-CODE1-SHIPPING", + "type": "DISCOUNT_VOUCHER", + "active": false, + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-12-10T23:00:00Z", + "expiration_date": "2023-12-31T23:00:00Z", + "redemption": { + "quantity": 1 + }, + "metadata": { + "unit": "EUR" + }, + "additional_info": "secret-code2" } - } + ] } - }, - "responses": { - "200": { - "description": "Returns the voucher object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Percent Discount": { - "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", - "campaign": null, - "campaign_id": null, - "category": "Second", - "category_id": "cat_0bb81a481615a37b5e", - "categories": [ - { - "id": "cat_0bb81a481615a37b5e", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-09-20T05:58:01.561Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 1800, - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-02-01T00:00:00.000Z", - "expiration_date": "2023-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "PT2H" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": "2022-09-20T06:00:50.202Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 101, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Card": { - "value": { - "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", - "code": "welcomegiftcard", - "campaign": null, - "campaign_id": null, - "category": "Existing Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 20000, - "balance": 20000, - "effect": "APPLY_TO_ITEMS" - }, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:09:49.665Z", - "updated_at": "2022-02-17T11:11:48.071Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Loyalty Card": { - "value": { - "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", - "code": "welcomeloyalty", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "Existing Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 20000, - "balance": 20000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": "2022-02-17T11:20:12.447Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Amount Discount": { - "value": { - "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "code": "WelcomeDiscountAmount", - "campaign": null, - "campaign_id": null, - "category": "Existing Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T11:41:05.236Z", - "updated_at": "2022-02-17T11:45:29.269Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_tDN7MJNayjrf1wyn", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "related_object_type": "voucher", - "created_at": "2022-02-17T11:41:05.210Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Fixed Discount": { - "value": { - "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", - "code": "wou4w1Og", - "campaign": "Fixed", - "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", - "category": "Existing Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS", - "fixed_amount": 2000 - }, - "gift": null, - "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T11:54:37.766Z", - "updated_at": "2022-02-17T12:04:53.346Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Unit Discount": { - "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", - "updated_at": "2022-02-18T06:31:08.630Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 5, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0aac93c6af84485df3" + } + } + } + } + } + } + } + } + }, + "/v1/vouchers/importCSV": { + "post": { + "operationId": "import-vouchers-using-csv", + "tags": [ + "VOUCHERS API" + ], + "summary": "Import Vouchers using CSV", + "description": "Import standalone vouchers into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties listed in the file headers that cannot be mapped to standard voucher fields will be added to the metadata object. \n\nYou can find an example CSV file [here](https://support.voucherify.io/article/45-import-codes-and-share-them-digitally#coupons).\n___\n\n```cURL cURL example\ncurl -X POST \\\n https://api.voucherify.io/v1/vouchers/importCSV \\\n -F file=@/path/to/vouchers.csv \\\n -H \"X-App-Id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" \\\n -H \"X-App-Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n```\n\n\n\n> 📘 Standard voucher fields mapping\n>\n> - Go to the [import vouchers](ref:import-vouchers) endpoint to see all standard CSV fields description (body params section).\n> - Supported CSV file headers: Code,Voucher Type,Value,Discount Type,Category,Start Date,Expiration Date,Redemption Limit,Redeemed Quantity, Redeemed Amount,Active,Additional Info,Custom Metadata Property Name\n>- **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z. \n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\n\n\n> 📘 Categories\n>\n> In the structure representing your data, you can define a category that the voucher belongs to. You can later use the category of a voucher to group and search by specific criteria in the Dashboard and using the [List Vouchers](ref:list-vouchers) endpoint.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the **response** and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } + } + } + } + }, + "400": { + "description": "Invalid payload. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "400": { - "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid Voucher": { - "value": { - "code": 400, - "key": "invalid_voucher", - "message": "Invalid Voucher", - "details": "It is not possible to change Voucher discount type", - "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" - } - } - } + "examples": { + "Example 1": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'file'", + "request_id": "74e4bb71-5b6d-49b9-98eb-239691c9d67a" } } } } + } + } + } + } + }, + "/v1/vouchers/qualification": { + "post": { + "operationId": "examine-vouchers-qualification", + "deprecated": true, + "tags": [ + "VOUCHERS API" + ], + "summary": "Examine Qualification [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nDisplay vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 **standalone vouchers**. \n\n> 👍 Prevailing assumption\n> You data is synced with Voucherify.\n\n ## How does this endpoint work? \n\n A property's value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.\n\nAs a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.\n\n ## What's excluded? \n\n The verification logic won't run against _coupons from bulk unique code campaigns_. For campaigns with multiple unique codes, you should run a [dedicated function](ref:examine-campaigns-qualification) for searching and identifying qualified campaigns.\n\n ## Customizing the response\n\n> 📘 Query parameters let you sort and filter the returned vouchers\n>\n> Customize your response:\n> - If you only care about verifying a customer, use `audienceRulesOnly` set to `true`. \n>- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a `limit`. This will return vouchers sorted by `-created_at`, by default beginning with the most recent vouchers listed at the top.\n> - If you have a preference on the sorting order of the returned vouchers, you can use `order` to customize your response.\n\n ## Sending the request body payload\n\n\n ## Customer\n\nYou have the option of sending customer data via the dedicated `customer` object in the request body or a nested `customer` object within the `order` object.\n ### Available options:\n\n - You can either pass a customer `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal customer identifier e.g., email, database ID, CRM id), \n\n - a combination of the remaining parameters in the customer object, \n\n - a combination of customer `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that customer in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). \n\n## Order\n\n ### Available options:\n\n - You can either pass an order `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal order identifier), \n\n - a combination of the remaining parameters in the order object, \n\n - a combination of order `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that order in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).\n\n## Guidelines:\n\nTo validate against vouchers with total order `amount` requirements, make sure to include the total order `amount` in the order object or alternatively the `amount` for _every_ order item (the application will then add each amount to get the total and perform the qualification checks). If the total order `amount` is provided along with the individual items' amounts, the total order `amount` will take precedence.\n\n\n| **Case** | **Order-Level Parameter Included** | **Item-Level Parameter Included** | **Precedence** | **Calculation Result** | **Parameter included in payload accounts for checks against requirements in these validation rules** |\n|:---:|:---:|:---:|:---:|---|---|\n| **1** | `amount` | `amount` | Order-level | Uses order-level `amount` | - Total order amount |\n| **2** | | `amount` | Item-level | Sums each item-level `amount` | - Total order amount
                  - subtotal of matched items |\n| **3** | | `price`
                  `quantity` | Item-level | Multiplies each item's (`price` x `quantity`) to get item `amount` and then adds each item's `amount` to get total order `amount` | - Total order amount
                  - Subtotal of matched items
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n| **4** | | `amount`
                  `price`
                  `quantity` | Item-level `amount` | Uses item-level `amount` for total order `amount` calculation, ignores (`price` x `quantity`) calculation | - Total order amount (uses item `amount` if provided or `price` x `quantity` for items without `amount` property; `amount` takes precedence in case all 3 properties are provided for an item)
                  - Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n| **5** | `amount` | `amount`
                  `price`
                  `quantity` | Order-level | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`).
                  - Subtotal of matched items (see case **4** for details).
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n \n\n## Reward\n\n ## Gift Card", + "parameters": [ + { + "$ref": "#/components/parameters/audienceRulesOnly" + }, + { + "schema": { + "type": "integer", + "maximum": 50 }, - "delete": { - "operationId": "delete-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Delete Voucher", - "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the voucher with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Voucher Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id 10OFF", - "request_id": "v-0ae28d3cec96bb1b7e", - "resource_id": "10OFF", - "resource_type": "voucher" + "in": "query", + "name": "limit", + "description": "The number of vouchers to be qualified." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "code", + "-code" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Should contain given customer and context such as an order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_qualification" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", + "metadata": { + "key": "value" + } + }, + "order": { + "amount": 10000, + "items": [ + { + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } } - } + ] + }, + "metadata": { + "key": "value" } } - } - } - }, - "post": { - "operationId": "create-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Create Voucher", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the voucher that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_POST" + }, + "Qualify product using product_id": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "examples": { - "Percentage Discount": { - "value": { - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "percent_off": 10, - "type": "PERCENT", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 10 - }, - "metadata": { - "test": true, - "locale": "de-en" - }, - "validation_rules": [ - "val_4j7DCRm2IS59" - ] + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} + } } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "Gift Card": { - "value": { - "category": "New Customers", - "type": "GIFT_VOUCHER", - "gift": { - "amount": 10000, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + }, + "Qualify product using source_id": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "Loyalty Card": { - "value": { - "category": "New Customers", - "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 10000 - }, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + }, + "Qualify SKU using sku_id": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "Amount Discount with Formula": { - "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 100 - }, - "metadata": { - "Season": "Spring" + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + }, + "Qualify SKU using source_id": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} + } + } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + }, + "Qualify redemption metadata": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" }, - "Percent Discount with Formula": { - "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "amount_limit": 1700, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 0, - 1 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 101 - }, - "metadata": { - "Season": "Fall" + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + }, + "Qualify order line item metadata": { + "value": { + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "order": { + "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", + "source_id": "string", + "amount": 10000, + "items": [ + { + "source_id": "product_1234", + "product_id": "prod_0a9f9aeddb019a42db", + "amount": 10000, + "quantity": 1, + "price": 10000, + "metadata": {}, + "related_object": "product", + "product": { + "source_id": "product_1234", + "name": "Phone", + "price": 10000, + "metadata": {} } } + ], + "customer": { + "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", + "source_id": "firstname.lastname@mycompany.com", + "name": "FirstName LastName", + "email": "firstname.lastname@mycompany.com", + "phone": "string", + "address": { + "city": "New York", + "country": "United States of America", + "postal_code": "10001", + "state": "NY" + }, + "metadata": {}, + "birthdate": "YYYY-MM-DD" + }, + "referrer": {}, + "metadata": "string" + }, + "reward": { + "points": 0, + "assignment_id": "string", + "id": "string" + }, + "metadata": {} + } + } + } + } + } + }, + "responses": { + "200": { + "description": "This operation returns the list of valid and active vouchers based on the qualification of given context (e.g., customer profile, redemptions metadata, order).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_res_vouchers_qualification" + } + } + } + } + } + } + }, + "/v1/vouchers/bulk/async": { + "post": { + "operationId": "update-vouchers-in-bulk", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Vouchers in bulk", + "description": "Use this endpoint to update specific metadata parameters for each code, respectively. You can update each code's metadata property separately. \n\n- Update up to **100 records** in one request.\n- Upserts are not supported. \n\n> 🚧 \n> \n> Currently only **metadata** updates are supported.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "List of objects, each containing a code that is being updated and the metadata key/value pairs for that code.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_bulk_async" + }, + "examples": { + "Example": { + "value": [ + { + "code": "example_code", + "metadata": { + "lang": "en", + "test": false, + "MetadataTest": "Update metadata", + "update_value": 1, + "next_update_date": "2022-11-11T09:00:00.000Z" + } + }, + { + "code": "example_code2", + "metadata": { + "lang": "pl", + "test": false, + "MetadataTest": "Update metadata", + "update_value": 2 } } + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" + } + } + } + } + } + } + } + }, + "/v1/vouchers/metadata/async": { + "post": { + "operationId": "update-vouchers-metadata-in-bulk", + "tags": [ + "VOUCHERS API" + ], + "summary": "Update Vouchers' metadata in bulk", + "description": "Use this endpoint to update the same metadata parameters for a list of codes. \nUpdate up to **100 records** in one request. Upserts are not supported. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "required": true, + "description": "Request to update vouchers metadata in bulk. Provide an array of voucher codes in the `codes` parameter along with the `metadata` object. The `metadata` object should contain the key value pairs that you would like to update for all the vouchers included in the `codes` parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers_metadata_async" + }, + "examples": { + "Example": { + "value": { + "codes": [ + "PROMO-CODE810", + "PROMO-CODE726" + ], + "metadata": { + "lang": "en", + "authorized_internally": true + } + } + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" + } + } + } + } + }, + "400": { + "description": "Returns an error indicating the reason for an unsuccessfull operation.", + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + { + "$ref": "#/components/schemas/e_400_not_enough_codes" + }, + { + "$ref": "#/components/schemas/e_400_metadata_validation_failed" + } + ], + "discriminator": { + "propertyName": "key" + } + }, + "examples": { + "Not enough codes": { + "value": { + "code": 400, + "key": "not_enough_codes", + "message": "Not enough codes", + "details": "Specify at least 1 code in codes.", + "request_id": "v-0c4b067a8f161e120f" + } } } + } + } + } + } + } + }, + "/v1/vouchers/{code}/sessions/{sessionKey}": { + "parameters": [ + { + "name": "code", + "in": "path", + "schema": { + "type": "string", + "example": "7fjWdr" + }, + "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify.", + "required": true + }, + { + "schema": { + "type": "string", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "name": "sessionKey", + "in": "path", + "required": true, + "description": "A unique session identifier." + } + ], + "delete": { + "operationId": "release-validation-session", + "tags": [ + "VOUCHERS API" + ], + "summary": "Release Validation Session", + "description": "Manually release a validation session that has been set up for the voucher. This method undos the actions that are explained in our guide on how a validation session was established, you can read more [here](doc:locking-validation-session). \n\n> 📘 Release Session using Dashboard\n>\n> You can also use the Validations Manager in the Dashboard to unlock sessions. [Read more](https://support.voucherify.io/article/16-dashboard-sections#validations).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if the validation session was released successfully." + } + } + } + }, + "/v1/campaign-object": { + "get": { + "operationId": "campaign-object", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Campaign Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Campaign Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" + } + } + } + } + } + } + }, + "/v1/campaigns": { + "post": { + "operationId": "create-campaign", + "tags": [ + "CAMPAIGNS API", + "PROMOTIONS API" + ], + "summary": "Create Campaign", + "description": "Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes. \n\n\n> 📘 Global uniqueness\n>\n> All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code. \n\n> 🚧 Code generation status\n>\n> This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](ref:get-campaign) description.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the campaign that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_create_campaign" }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" + "examples": { + "Discount Campaign": { + "value": { + "name": "Discount Campaign 4", + "campaign_type": "DISCOUNT_COUPONS", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 3, + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "percent_off": 10, + "type": "PERCENT" }, - "examples": { - "Percentage Discount": { - "value": { - "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "code": "welcome", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:05:34.668Z", - "updated_at": null, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_74F7QZoYbUoljwQO", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "related_object_type": "voucher", - "created_at": "2022-02-17T09:05:34.642Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcome/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Card": { - "value": { - "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", - "code": "welcomegiftcard", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 10000, - "balance": 10000, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:09:49.665Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Loyalty Card": { - "value": { - "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", - "code": "welcomeloyalty", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "New Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 10000, - "balance": 10000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This loyalty card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Amount Discount with Formula": { - "value": { - "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", - "code": "amount1", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "metadata": { - "Season": "Spring" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T14:22:50.552Z", - "updated_at": null, - "redemption": { - "quantity": 100, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/amount1/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Percent Discount with Formula": { - "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 1700, - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 0, - 1 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "metadata": { - "Season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": null, - "redemption": { - "quantity": 101, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" - }, - "object": "voucher" - } - } + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "10OFF-#######" } + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "AMER" } } }, - "409": { - "description": "Returns an error if a voucher code already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate Code": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated voucher exists with id CODE", - "request_id": "v-0ae786a8f786b73dfa", - "resource_id": "CODE", - "resource_type": "voucher" - } - } + "Gift Card Campaign": { + "value": { + "name": "Gift Card Campaign", + "campaign_type": "GIFT_VOUCHERS", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "voucher": { + "type": "GIFT_VOUCHER", + "gift": { + "amount": 1000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "GIFT-CARD-#######" } + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" } } - } - } - } - }, - "/v1/vouchers/": { - "post": { - "operationId": "generate-random-code", - "tags": [ - "VOUCHERS API" - ], - "summary": "Generate Random Code", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the voucher that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers__POST" + }, + "Loyalty Program": { + "value": { + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "auto_join": true, + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "LOYALTY-CARD-#######" + } }, - "examples": { - "Percentage Discount": { - "value": { - "category": "New Customers", - "code": "NEW-WELCOME-COUPON", - "type": "DISCOUNT_VOUCHER", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", - "discount": { - "percent_off": 10, - "type": "PERCENT", - "effect": "APPLY_TO_ORDER" + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" + } + } + }, + "Promotion": { + "value": { + "name": "Promotion - API - 4", + "campaign_type": "PROMOTION", + "type": "STATIC", + "category_id": "cat_0bb343dee3cdb5ec0c", + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "active": false, + "promotion": { + "tiers": [ + { + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "B" }, - "start_date": "2016-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" + "interval": "P2D", + "duration": "P1D" }, "validity_day_of_week": [ 1, 2, 3, - 4, - 5 + 4 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 10 - }, - "metadata": { - "test": true, - "locale": "de-en" - }, "validation_rules": [ - "val_4j7DCRm2IS59" + "val_q8qUBMOh5qIQ" ] - } - }, - "Gift Card": { - "value": { - "category": "New Customers", - "type": "GIFT_VOUCHER", - "gift": { - "amount": 10000, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2022-01-01T00:00:00Z", - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "code_config": { - "pattern": "GIFT-CARD-##########", - "prefix": "New-", - "postfix": "0", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - } - } - }, - "Loyalty Card": { - "value": { - "category": "New Customers", - "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 10000 + }, + { + "name": "Order more than $100", + "banner": "Get $30 off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } }, - "additional_info": "This loyalty card is enabled immediately upon creation.", "metadata": { - "test": true, - "locale": "de-en" - }, - "code_config": { - "pattern": "LOYALTY-CARD-##", - "prefix": "New-", - "postfix": "1", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - } - } - }, - "Unit Discount Multiple Items": { - "value": { - "category": "New Customers", - "code": "MultipleUnitTypesUnitDiscount", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] + "level": "A" }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" + "interval": "P2D", + "duration": "P1D" }, "validity_day_of_week": [ 1, 2, 3, - 4, - 5 + 4 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 5 - }, - "metadata": { - "test": true, - "locale": "de-en" - } + "validation_rules": [ + "val_q8qUBMOh5qIQ" + ] } + ] + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "metadata": { + "region": "APAC" + } + } + }, + "Referral Program": { + "value": { + "name": "Referral Campaign 2", + "campaign_type": "REFERRAL_PROGRAM", + "join_once": true, + "type": "AUTO_UPDATE", + "category_id": "cat_0bb343dee3cdb5ec0c", + "start_date": "2020-08-16T00:00:00Z", + "expiration_date": "2023-12-26T00:00:00Z", + "vouchers_count": 2, + "referral_program": { + "conversion_event_type": "redemption" + }, + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 45, + "effect": "APPLY_TO_ORDER", + "amount_limit": 15 }, - "Unit Discount Single Item": { - "value": { - "category": "New Customers", - "code": "AddMissingItemDiscount", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 3 - } - } - } + "redemption": { + "quantity": 10 + }, + "code_config": { + "pattern": "REFERRAL-CODE-#######" + }, + "is_referral_code": true + }, + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "use_voucher_metadata_schema": false, + "metadata": { + "region": "APAC" } } } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Percentage Discount": { - "value": { - "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", - "code": "NEW-WELCOME-COUPON", - "campaign": "Bug fix", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a campaign object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "examples": { + "Discount Campaign": { + "value": { + "id": "camp_NdBCAQk1AAZcMcv6kt6X164Q", + "name": "Discount Campaign 4", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10 + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "10OFF-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "AMER" + }, + "created_at": "2022-09-21T09:25:49.617Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" + } + }, + "Gift Card Campaign": { + "value": { + "id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "name": "Gift Card Campaign", + "campaign_type": "GIFT_VOUCHERS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "GIFT_VOUCHER", + "gift": { + "amount": 1000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "GIFT-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-21T09:31:16.266Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" + } + }, + "Loyalty Program": { + "value": { + "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" + } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "LOYALTY-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-21T09:39:45.479Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "object": "campaign" + } + }, + "Promotion": { + "value": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "name": "Promotion - API - 4", + "campaign_type": "PROMOTION", + "type": "STATIC", + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-23T08:54:38.281Z", + "category": "First", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "promotion": { + "object": "list", + "data_ref": "tiers", + "tiers": [ + { + "id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", + "created_at": "2022-09-23T08:54:38.286Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "B" + }, + "hierarchy": 1, + "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "campaign": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": true, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" }, - "gift": null, - "loyalty_card": null, - "start_date": "2016-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", + "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { "interval": "P2D", - "duration": "PT1H" + "duration": "P1D" }, "validity_day_of_week": [ 1, 2, 3, - 4, - 5 + 4 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" + "summary": { + "redemptions": { + "total_redeemed": 0 }, - "barcode": { - "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } }, - "is_referral_code": false, - "created_at": "2022-02-17T07:14:40.096Z", - "updated_at": null, - "validation_rules_assignments": { + "object": "promotion_tier", + "validation_rule_assignments": { "object": "list", "data_ref": "data", "data": [ { - "id": "asgm_COu5PJAsWmAwuCqR", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", - "related_object_type": "voucher", - "created_at": "2022-02-17T07:14:40.280Z", + "id": "asgm_dr3oXeN98YfiTF60", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", + "related_object_type": "promotion_tier", + "created_at": "2022-09-23T08:54:38.286Z", "object": "validation_rules_assignment" } ], "total": 1 - }, - "redemption": { - "quantity": 10, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Gift Voucher": { - "value": { - "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", - "code": "New-GIFT-CARD-8tqB6FcyhE0", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 10000, - "balance": 10000, - "effect": "APPLY_TO_ORDER" - }, - "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" + } + }, + { + "id": "promo_uMSxvzhxXDp3Ijs3659npqb2", + "created_at": "2022-09-23T08:54:38.314Z", + "name": "Order more than $100", + "banner": "Get $30 off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" } }, - "is_referral_code": false, - "created_at": "2022-02-17T07:49:10.834Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Loyalty Card": { - "value": { - "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", - "code": "New-LOYALTY-CARD-UC1", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "New Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 10000, - "balance": 10000 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "This loyalty card is enabled immediately upon creation.", "metadata": { - "test": true, - "locale": "de-en" + "level": "A" }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" + "hierarchy": 2, + "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "campaign": { + "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" }, - "barcode": { - "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-17T08:06:41.091Z", - "updated_at": null, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Unit Discount Multiple Items": { - "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "active": true, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", + "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { "interval": "P2D", - "duration": "PT1H" + "duration": "P1D" }, "validity_day_of_week": [ 1, 2, 3, - 4, - 5 + 4 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", - "updated_at": null, - "redemption": { - "quantity": 5, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Unit Discount Single Item": { - "value": { - "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", - "code": "AddMissingItemDiscount", - "campaign": null, - "campaign_id": null, - "category": "New Customers", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T06:46:44.536Z", - "updated_at": null, - "redemption": { - "quantity": 3, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/vouchers/{code}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "2CpRCE2c" - }, - "name": "code", - "in": "path", - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`.", - "required": true - } - ], - "post": { - "operationId": "enable-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Enable Voucher", - "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThe method sets the voucher state to **active**. The voucher can be redeemed - only if the redemption occurs after the start date and the voucher is not expired.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a voucher object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Example": { - "value": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2022-09-19T11:54:17.248Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "created_at": "2022-09-19T10:06:07.934Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/vouchers/{code}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "2CpRCE2c" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "disable-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Disable Voucher", - "description": "There are various times when you'll want to manage a voucher's accessibility. This can be done by two API methods for managing the voucher state - *enable* and *disable*. \n___\nThis method sets the voucher state to **inactive**. The voucher cannot be redeemed.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a voucher object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Example": { - "value": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + "summary": { + "redemptions": { + "total_redeemed": 0 }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2022-09-19T11:53:23.452Z", - "validation_rules_assignments": { + "object": "promotion_tier", + "validation_rule_assignments": { "object": "list", "data_ref": "data", "data": [ { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "created_at": "2022-09-19T10:06:07.934Z", + "id": "asgm_jgJlWms7GVK59iNR", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_uMSxvzhxXDp3Ijs3659npqb2", + "related_object_type": "promotion_tier", + "created_at": "2022-09-23T08:54:38.314Z", "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } - } - } - } - } - } - }, - "/v1/vouchers/{code}/balance": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "GIFT-CARD-1" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "add-remove-gift-voucher-balance", - "tags": [ - "VOUCHERS API" - ], - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "Add or Remove Gift Card Balance", - "description": "Add balance to an existing gift card.", - "requestBody": { - "required": true, - "description": "Provide the amount to be added to/subtracted from the gift card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_balance" - }, - "examples": { - "Example": { - "value": { - "amount": 10000 - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a balance object if the operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_code_balance" - }, - "examples": { - "Example": { - "value": { - "amount": 10000, - "total": 20100, - "balance": 20100, - "type": "gift_voucher", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" + } + ], + "total": 1 } } + ], + "total": 2, + "has_more": false + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } - } + ], + "object": "campaign" } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } + }, + "Referral Program": { + "value": { + "id": "camp_N8rztKAqOYIdFxNLr9eNIjyB", + "name": "Referral Campaign 2", + "campaign_type": "REFERRAL_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 15, + "percent_off": 45, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "REFERRAL-CODE-#######" + }, + "is_referral_code": true, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "referral_program": { + "conversion_event_type": "redemption" + }, + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-23T09:06:41.757Z", + "category": "First", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } - } + ], + "object": "campaign" } } } } } }, - "/v1/vouchers/{code}/transactions": { - "parameters": [ - { + "400": { + "description": "Returns an error if an incomplete request body is provided.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "GIFT-CARD-1" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "get": { - "operationId": "list-voucher-transactions", - "tags": [ - "VOUCHERS API" - ], - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "List Voucher Transactions", - "description": "List transactions that are associated with credit movements on a gift card or loyalty card.", - "responses": { - "200": { - "description": "Returns a dictionary of transaction objects", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/vouchers_list_transactions_response_body" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dccc4d5813e71bd", - "source_id": "20230317_subtract_1", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "API", - "reason": "Subtracting credits from card", - "type": "CREDITS_REMOVAL", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128020, - "amount": -2000, - "object": "balance", - "balance": 121020, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T15:50:00.786Z" - }, - { - "id": "vtx_0c9dcc920ac0e9ef82", - "source_id": "20230317_add_1", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "API", - "reason": "Adding more points to card", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130020, - "amount": 20, - "object": "balance", - "balance": 123020, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T15:49:08.768Z" - }, - { - "id": "vtx_0c94f018d30bef6689", - "source_id": "HRwc0oHz_reward", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "cash reward", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": 2000, - "object": "balance", - "balance": 123000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:38:02.055Z" - }, - { - "id": "vtx_0c94edbbaccbef5db6", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REFUND", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": 44, - "object": "balance", - "balance": 121000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", - "source_id": null - }, - "redemption": { - "id": "r_0c94ed583fcafc31c1" - }, - "rollback": { - "id": "rr_0c94edbb8d0bef5d9e" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:27:42.389Z" - }, - { - "id": "vtx_0c94ed584f4afc31da", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REDEMPTION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": -44, - "object": "balance", - "balance": 120956, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_jj5EzDxDOd2xFPsAJJ18IaZK", - "source_id": null - }, - "redemption": { - "id": "r_0c94ed583fcafc31c1" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:26:00.640Z" - }, - { - "id": "vtx_0c94e9432c4afc2134", - "source_id": "HRwc0oHz_removal", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "removal", - "type": "CREDITS_REMOVAL", - "details": { - "balance": { - "type": "gift_voucher", - "total": 128000, - "amount": -2000, - "object": "balance", - "balance": 121000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:08:10.413Z" - }, - { - "id": "vtx_0c94e8100f8afc1c6c", - "source_id": null, - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": null, - "reason": null, - "type": "CREDITS_REDEMPTION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": -7000, - "object": "balance", - "balance": 123000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - }, - "order": { - "id": "ord_qZX3pEt5rFf5W23qRMDQcVt9", - "source_id": null - }, - "redemption": { - "id": "r_0c94e80fda4afc1c59" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T18:02:55.935Z" - }, - { - "id": "vtx_0c94e6b82a4bef406c", - "source_id": "walmart", - "voucher_id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "campaign_id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "source": "voucherify-web-ui", - "reason": "return", - "type": "CREDITS_ADDITION", - "details": { - "balance": { - "type": "gift_voucher", - "total": 130000, - "amount": 5000, - "object": "balance", - "balance": 130000, - "related_object": { - "id": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-10T17:57:03.758Z" - } - ], - "has_more": false - } - } - } - } - } + "$ref": "#/components/schemas/e_error_no_translation" }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_campaign", + "message": "Invalid Campaign", + "details": "Property 'discount' is required for REFERRAL_PROGRAM campaign", + "request_id": "v-0bb99c9213425fa250" } } } } } }, - "/v1/vouchers/{code}/transactions/export": { - "parameters": [ - { + "404": { + "description": "When a payload value is not found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "GIFT-CARD-1" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "code", - "in": "path", - "required": true, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify, i.e. `v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u`." - } - ], - "post": { - "operationId": "export-gift-card-transactions", - "tags": [ - "VOUCHERS API" - ], - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "summary": "Export Gift Card Transactions", - "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                  - `CREDITS_ADDITION`
                  - `CREDITS_REFUND`
                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", - "requestBody": { - "description": "Specify the parameters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "source" - ] - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find category with id cat_0bb343dee3cdb5ec0c", + "request_id": "v-0c55671ed1cb0f1a27", + "resource_id": "cat_0bb343dee3cdb5ec0c", + "resource_type": "category" } } } - }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_ARi2UbRjgfrHQJoVcKFrBUgA", - "object": "export", - "created_at": "2023-05-16T08:30:21.496Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id", - "source" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null - } - }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null - } - } - } - } - } + } + } + }, + "409": { + "description": "Returns an error if a campaign with the same name already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated campaign exists with name Discount Campaign", + "request_id": "v-0bb98f8c6552250aab", + "resource_id": "Discount Campaign", + "resource_type": "campaign" } } } } } + } + } + }, + "get": { + "operationId": "list-campaigns", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "List Campaigns", + "description": "Retrieve a list of campaigns in a project. \n\nThe campaigns are returned sorted by creation date, with the most recent campaigns appearing first. \n\nWhen you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.\n\nThis method will return an error when trying to return a limit of more than 100 campaigns.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "/v1/vouchers/import": { - "post": { - "operationId": "import-vouchers", - "tags": [ - "VOUCHERS API" - ], - "summary": "Import Vouchers", - "description": "Import standalone vouchers and gift cards into the repository.\n\n\n\n> 📘 Important notes\n>\n> - **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z.\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\nAny parameters not provided in the payload will be left blank or null.\n\nFor both **standalone discount vouchers and gift cards**, you can import the following fields: \n\n- code\n- category\n- active\n- type\n- start_date\n- expiration_date\n- redemption.quantity\n- additional_info\n- metadata\n\nFor **gift cards**, you can also import the following field:\n\n- gift.amount\n\nFor **discount vouchers**, you can import the `discount` object. The object will slightly vary depending on the type of discount. Each discount type **requires** the `type` to be defined in the import.\n\n| **Discount Type** | **Required fields** |\n|:---|:---|\n| Amount | amount_off, effect |\n| Percent | percent_off, effect |\n| Fixed | fixed_amount, effect |\n| Unit - One item | unit_off, unit_type, effect |\n| Unit - Multiple items | unit_off, unit_type, effect |\n| Shipping | unit_off, unit_type, effect |\n\nFields other than the ones listed above won't be imported. Even if provided, they will be silently skipped.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "The request body is an array of objects. Each object contains details about a specific voucher. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_import" - }, - "examples": { - "Example": { - "value": [ - { - "code": "PROMO-CODE30OFF-NO-EFFECT", - "category": "new customer acquisition", - "type": "DISCOUNT_VOUCHER", - "active": true, - "discount": { - "amount_off": 3000, - "type": "AMOUNT" - }, - "start_date": "2020-12-01T23:00:00Z", - "expiration_date": "2023-12-19T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code1" - }, - { - "code": "PROMO-CODE30-PERCENT-NO-EFFECT", + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/campaign_type" + }, + { + "schema": { + "type": "string", + "default": "category" + }, + "in": "query", + "name": "expand", + "description": "Include an expanded `categories` object in the response." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `campaign` property that contains an array of campaigns. The maximum number of campaigns returned is determined by the `limit` query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_res_list_campaigns" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "campaigns", + "campaigns": [ + { + "id": "camp_SibPsDRKQvg3SUtptgPZCNZb", + "name": "Voucher Metadata", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { "type": "DISCOUNT_VOUCHER", - "active": false, "discount": { + "type": "PERCENT", + "amount_limit": 4400, "percent_off": 30, - "type": "PERCENT" + "effect": "APPLY_TO_ORDER" }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { - "quantity": 1 + "quantity": null }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 9, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "#########", + "prefix": "Discount-", + "postfix": "YY" }, - "additional_info": "secret-code2" + "is_referral_code": false, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P1D" + } }, - { - "code": "GIFT-CARD-100", - "type": "GIFT_VOUCHER", - "active": true, - "category": "new customer acquisition", - "gift": { - "amount": 10000 - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 5 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-GIFT-code2" + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P1D" }, - { - "code": "PROMO-CODE1-PERCENT-EFFECT-ORDER", + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 1, + "active": true, + "metadata": { + "region": "AMER" + }, + "created_at": "2022-09-20T09:32:29.530Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_HgsbCKauXmEoPnnh8aas0ISe", + "name": "Static Campaign", + "campaign_type": "DISCOUNT_COUPONS", + "type": "STATIC", + "voucher": { "type": "DISCOUNT_VOUCHER", - "active": false, "discount": { - "percent_off": 30, - "type": "PERCENT", + "type": "AMOUNT", + "amount_off": 3000, "effect": "APPLY_TO_ORDER" }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { "quantity": 1 }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########" }, - "additional_info": "secret-code2" + "is_referral_code": false }, - { - "code": "PROMO-CODE2-PERCENT-EFFECT-ITEM", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "percent_off": 30, - "type": "PERCENT", - "effect": "APPLY_TO_ITEMS" + "auto_join": false, + "join_once": true, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-09-20T07:52:34.499Z", + "updated_at": "2022-09-20T11:38:13.501Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "name": "Loyalty Program Fall 2022", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 7, + "rounding_type": "END_OF_YEAR" + } }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { - "quantity": 1 + "quantity": null }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LOYALTY-CARD-" }, - "additional_info": "secret-code2" + "is_referral_code": false }, - { - "code": "PROMO-CODE1-PERCENT-NO-EFFECT-REDEEMED-QUANTITY-ATTRIBUTE-DOESNT-GET-PASSED", + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-09-19T07:56:22.103Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0bb343dee3cdb5ec0c", + "object": "campaign" + }, + { + "id": "camp_4tHsQEDUOER6PeW8SoMdnHH6", + "name": "Dynamic Discounts", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { "type": "DISCOUNT_VOUCHER", - "active": false, "discount": { - "percent_off": 30, - "type": "PERCENT" + "type": "PERCENT", + "percent_off": 5, + "percent_off_formula": "IF(ORDER_AMOUNT > 300;15;5)", + "effect": "APPLY_TO_ORDER" }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { - "quantity": 1, - "redeemed_quantity": 1 + "quantity": null }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "DYNAMIC-" }, - "additional_info": "secret-code2" + "is_referral_code": false }, - { - "code": "PROMO-CODE1-AMOUNT-EFFECT-ITEMS-PROPORTIONALLY", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "amount_off": 30, - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": { + "marketing_text": "Purchases above $300 are eligible for a 15% discount." }, - { - "code": "PROMO-CODE1-FIXED-EFFECT-ORDER", + "created_at": "2022-07-12T15:12:02.575Z", + "updated_at": "2022-07-20T10:48:05.617Z", + "category": "test", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b688929a2476386a8", + "object": "campaign" + }, + { + "id": "camp_JlsseNSDO7l4neFtev6p6945", + "name": "$20 OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { "type": "DISCOUNT_VOUCHER", - "active": false, "discount": { - "fixed_amount": 30, - "type": "FIXED", + "type": "AMOUNT", + "amount_off": 2000, "effect": "APPLY_TO_ORDER" }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" - }, - { - "code": "PROMO-CODE1-UNIT-SINGLE-ITEM-EFFECT-MISSING", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { - "quantity": 1 + "quantity": null }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "$20OFFORDER-" }, - "additional_info": "secret-code2" + "is_referral_code": false }, - { - "code": "PROMO-CODE2-UNIT-MULTIPLE-ITEMS", + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:43:36.057Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + }, + { + "id": "camp_Uj3cNbWSgt7Zl4AyHM7Sa5Qk", + "name": "3% OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { "type": "DISCOUNT_VOUCHER", - "active": true, "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_NEW_ITEMS" - } - ] + "type": "PERCENT", + "percent_off": 3, + "effect": "APPLY_TO_ORDER" }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", "redemption": { - "quantity": 1 + "quantity": null }, - "metadata": { - "unit": "EUR" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "3%OFFORDER-" }, - "additional_info": "secret-code2" + "is_referral_code": false }, - { - "code": "PROMO-CODE1-SHIPPING", - "type": "DISCOUNT_VOUCHER", - "active": false, - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "effect": "ADD_MISSING_ITEMS" - }, - "start_date": "2020-12-10T23:00:00Z", - "expiration_date": "2023-12-31T23:00:00Z", - "redemption": { - "quantity": 1 - }, - "metadata": { - "unit": "EUR" - }, - "additional_info": "secret-code2" - } - ] - } + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:41:12.087Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": null, + "object": "campaign" + } + ], + "total": 6 } } } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}": { + "parameters": [ + { + "in": "path", + "name": "campaignId", + "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.", + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "required": true + } + ], + "get": { + "operationId": "get-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Get Campaign", + "description": "Retrieves the campaign with the given campaign ID or campaign name.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a campaign object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_JlsseNSDO7l4neFtev6p6945", + "name": "$20 OFF Entire Order", + "campaign_type": "DISCOUNT_COUPONS", + "type": "AUTO_UPDATE", + "voucher": { + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "$20OFFORDER-" + }, + "is_referral_code": false + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "vouchers_count": 1, + "active": true, + "metadata": {}, + "created_at": "2022-07-11T09:43:36.057Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0aac93c6af84485df3" + "category_id": null, + "object": "campaign" + } + } + } + } + } + }, + "404": { + "description": "Returns an error when requesting the campaign that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_jcErmtGAOmHUAy0oUgkwKnP", + "request_id": "v-0bb8694614d58bf2a8", + "resource_id": "camp_jcErmtGAOmHUAy0oUgkwKnP", + "resource_type": "campaign" + } + } + } + } + } + } + } + }, + "put": { + "operationId": "update-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Update Campaign", + "description": "Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. \n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped. \n\n> #### Vouchers will be affected\n>\n> This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the campaign parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_update_campaign" + }, + "examples": { + "Example": { + "value": { + "description": "New description" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the campaign object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_obj_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "name": "Loyalty Campaign", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1000, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_YEAR" } + }, + "redemption": { + "quantity": 10 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "LOYALTY-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + } + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": false, + "description": "New description", + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": "2023-12-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 2, + "active": true, + "metadata": { + "region": "APAC" + }, + "created_at": "2022-09-21T09:39:45.479Z", + "updated_at": "2022-09-23T09:47:00.205Z", + "category": "First", + "creation_status": "MODIFYING", + "vouchers_generation_status": "MODIFYING", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" } - } + ], + "object": "campaign" } } } } } + } + } + }, + "delete": { + "operationId": "delete-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Delete Campaign", + "description": "Permanently deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with exactly the same name.", + "name": "force" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Delete Campaign": { + "$ref": "#/components/examples/res_async_actions" + } + } + } + } }, - "/v1/vouchers/importCSV": { - "post": { - "operationId": "import-vouchers-using-csv", - "tags": [ - "VOUCHERS API" - ], - "summary": "Import Vouchers using CSV", - "description": "Import standalone vouchers into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties listed in the file headers that cannot be mapped to standard voucher fields will be added to the metadata object. \n\nYou can find an example CSV file [here](https://support.voucherify.io/article/45-import-codes-and-share-them-digitally#coupons).\n___\n\n```cURL cURL example\ncurl -X POST \\\n https://api.voucherify.io/v1/vouchers/importCSV \\\n -F file=@/path/to/vouchers.csv \\\n -H \"X-App-Id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" \\\n -H \"X-App-Token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n```\n\n\n\n> 📘 Standard voucher fields mapping\n>\n> - Go to the [import vouchers](ref:import-vouchers) endpoint to see all standard CSV fields description (body params section).\n> - Supported CSV file headers: Code,Voucher Type,Value,Discount Type,Category,Start Date,Expiration Date,Redemption Limit,Redeemed Quantity, Redeemed Amount,Active,Additional Info,Custom Metadata Property Name\n>- **Start and expiration dates** need to be provided in compliance with the ISO 8601 norms. For example, 2020-03-11T09:00:00.000Z. \n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Custom code attributes (not supported by-default) need to be added as code **metadata**.\n> - You **cannot import the same codes** to a single Voucherify Project.\n\n\n\n> 📘 Categories\n>\n> In the structure representing your data, you can define a category that the voucher belongs to. You can later use the category of a voucher to group and search by specific criteria in the Dashboard and using the [List Vouchers](ref:list-vouchers) endpoint.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "404": { + "description": "Returns an error indicating that the campaign with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Spring Campaign", + "request_id": "v-0adac46be8cdbfd921", + "resource_id": "Spring Campaign", + "resource_type": "campaign" + } + } } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}/vouchers": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign to which voucher(s) will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "add-vouchers-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Add Vouchers to Campaign", + "description": "This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "vouchers_count", + "description": "Number of vouchers that should be added." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher parameters that you would like to overwrite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_add_vouchers_to_campaign" + }, + "examples": { + "Example": { + "value": { + "category_id": "cat_0bb81a481615a37b5e", + "start_date": "2022-09-24T00:00:00Z", + "expiration_date": "2022-09-25T23:59:59Z", + "active": false, + "redemption": { + "quantity": null + }, + "code_config": { + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "length": 8, + "prefix": "Add-", + "pattern": null, + "postfix": "-API" + }, + "additional_info": "Voucher added using API", + "metadata": { + "Season": "Fall" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded for a voucher count of 1.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0bb96ebb7ec3720252" } } } + } + } + }, + "202": { + "description": "Returns an `async_action_id` if the request was made to create more than 1 voucher.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + } + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}/vouchers/{code}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + }, + { + "schema": { + "type": "string" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A custom **code** that identifies the voucher." + } + ], + "post": { + "operationId": "add-voucher-with-specific-code-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Add Voucher with Specific Code to Campaign", + "description": "This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher parameters that you would like to overwrite.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_add_vouchers_with_specific_code_to_campaign" }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and vouchers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the **response** and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "examples": { + "Example": { + "value": { + "category_id": "cat_0bb81a481615a37b5e", + "start_date": "2022-09-24T00:00:00Z", + "expiration_date": "2022-09-25T23:59:59Z", + "active": false, + "redemption": { + "quantity": null + }, + "additional_info": "Voucher added using API", + "metadata": { + "Season": "Fall" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a voucher object if the call succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Example": { + "value": { + "id": "v_EJwB9Wy2aOIsDpWhnl2QBY51OqjQ5Ukg", + "code": "Code3", + "campaign": "Add Vouchers to Campaign", + "campaign_id": "camp_xxpmFyWO9h9s5cEe7HtmOK5B", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "amount_limit": 2000, + "percent_off": 30, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-24T00:00:00.000Z", + "expiration_date": "2022-09-25T23:59:59.000Z", + "validity_timeframe": null, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "additional_info": "Voucher added using API", + "metadata": { + "Season": "Fall" }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } + "assets": { + "qr": { + "id": "U2FsdGVkX1+p2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6+1N81zXuY6/pnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bp2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6%2B1N81zXuY6%2FpnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5/u9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY+sOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW+NCQg6Ts8clYWWP5lrGyV/fzoA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5%2Fu9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY%2BsOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW%2BNCQg6Ts8clYWWP5lrGyV%2FfzoA%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-09-21T07:14:28.217Z", + "updated_at": null, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/Code3/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/Code3/publications?page=1&limit=10" + }, + "object": "voucher" } } + } + } + } + }, + "409": { + "description": "Returns an error if a voucher with the same code already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" }, - "400": { - "description": "Invalid payload. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example 1": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'file'", - "request_id": "74e4bb71-5b6d-49b9-98eb-239691c9d67a" - } - } - } + "examples": { + "Duplicate": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated voucher exists with id Code1", + "request_id": "v-0bb974be99d22504cd", + "resource_id": "Code1", + "resource_type": "voucher" } } } } } + } + } + } + }, + "/v1/campaigns/{campaignId}/import": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" }, - "/v1/vouchers/qualification": { - "post": { - "operationId": "examine-vouchers-qualification", - "deprecated": true, - "tags": [ - "VOUCHERS API" - ], - "summary": "Examine Qualification [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nDisplay vouchers qualified to the given customer and context (e.g., order, loyalty reward). Checks up to 50 **standalone vouchers**. \n\n> 👍 Prevailing assumption\n> You data is synced with Voucherify.\n\n ## How does this endpoint work? \n\n A property's value that does not meet a validation rule requirement will disqualify that particular voucher and it will not be listed in the results.\n\nAs a sample use case, you can imagine a requirement of displaying coupons available for the customer below the shopping cart. The customer can choose and apply the proposed voucher.\n\n ## What's excluded? \n\n The verification logic won't run against _coupons from bulk unique code campaigns_. For campaigns with multiple unique codes, you should run a [dedicated function](ref:examine-campaigns-qualification) for searching and identifying qualified campaigns.\n\n ## Customizing the response\n\n> 📘 Query parameters let you sort and filter the returned vouchers\n>\n> Customize your response:\n> - If you only care about verifying a customer, use `audienceRulesOnly` set to `true`. \n>- If you want to limit the number of vouchers to be returned from the entire pool of eligible vouchers, set a `limit`. This will return vouchers sorted by `-created_at`, by default beginning with the most recent vouchers listed at the top.\n> - If you have a preference on the sorting order of the returned vouchers, you can use `order` to customize your response.\n\n ## Sending the request body payload\n\n\n ## Customer\n\nYou have the option of sending customer data via the dedicated `customer` object in the request body or a nested `customer` object within the `order` object.\n ### Available options:\n\n - You can either pass a customer `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal customer identifier e.g., email, database ID, CRM id), \n\n - a combination of the remaining parameters in the customer object, \n\n - a combination of customer `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that customer in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). \n\n## Order\n\n ### Available options:\n\n - You can either pass an order `id` (Voucherify system generated),\n\n - a `source_id` (your own unique internal order identifier), \n\n - a combination of the remaining parameters in the order object, \n\n - a combination of order `id` and remaining parameters excluding `source_id`, or\n\n - a combination of `source_id` and remaining parameters excluding `id`\n\n #### Note:\n\n For the latter two options, if you pass the `source_id` or the `id` with the other parameters, the logic will run independently for parameters explicitly passed in the request body versus those not explicitly passed in the request body. For _parameters not explicitly listed in the payload_, the verification will be against the data stored for that order in the system. On the other hand, for any _parameter values explicitly passed in the payload_, the logic will ignore those stored in the system and will use the new values provided in the qualification request body. \n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).\n\n## Guidelines:\n\nTo validate against vouchers with total order `amount` requirements, make sure to include the total order `amount` in the order object or alternatively the `amount` for _every_ order item (the application will then add each amount to get the total and perform the qualification checks). If the total order `amount` is provided along with the individual items' amounts, the total order `amount` will take precedence.\n\n\n| **Case** | **Order-Level Parameter Included** | **Item-Level Parameter Included** | **Precedence** | **Calculation Result** | **Parameter included in payload accounts for checks against requirements in these validation rules** |\n|:---:|:---:|:---:|:---:|---|---|\n| **1** | `amount` | `amount` | Order-level | Uses order-level `amount` | - Total order amount |\n| **2** | | `amount` | Item-level | Sums each item-level `amount` | - Total order amount
                  - subtotal of matched items |\n| **3** | | `price`
                  `quantity` | Item-level | Multiplies each item's (`price` x `quantity`) to get item `amount` and then adds each item's `amount` to get total order `amount` | - Total order amount
                  - Subtotal of matched items
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n| **4** | | `amount`
                  `price`
                  `quantity` | Item-level `amount` | Uses item-level `amount` for total order `amount` calculation, ignores (`price` x `quantity`) calculation | - Total order amount (uses item `amount` if provided or `price` x `quantity` for items without `amount` property; `amount` takes precedence in case all 3 properties are provided for an item)
                  - Subtotal of matched items (uses item `amount`, takes precedence if all 3 properties are provided)
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n| **5** | `amount` | `amount`
                  `price`
                  `quantity` | Order-level | Uses order-level `amount` for total order `amount` | - Total order amount (uses order-level `amount`).
                  - Subtotal of matched items (see case **4** for details).
                  - Unit price of any matching order line
                  - Price of each item/Price of any item |\n \n\n## Reward\n\n ## Gift Card", - "parameters": [ - { - "$ref": "#/components/parameters/audienceRulesOnly" - }, - { - "schema": { - "type": "integer", - "maximum": 50 - }, - "in": "query", - "name": "limit", - "description": "The number of vouchers to be qualified." + "name": "campaignId", + "in": "path", + "required": true, + "description": "The ID of an existing campaign to which you're importing the codes. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "import-vouchers-to-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Import Vouchers to Campaign", + "description": "Imports vouchers to an **existing** campaign.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Discount type, expiration date and the remaining attributes will be taken from the [Campaign](ref:get-campaign) settings.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_import_vouchers_to_campaign" + }, + "examples": { + "Example": { + "value": [ + { + "code": "CODE7", + "category": "First", + "redemption": { + "quantity": 1 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true + }, + { + "code": "CODE8", + "category": "Second", + "redemption": { + "quantity": 18 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true + }, + { + "code": "CODE9", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true + } + ] }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "code", - "-code" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "Should contain given customer and context such as an order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_qualification" + "Gift Cards": { + "value": [ + { + "code": "CODE13", + "category": "First", + "redemption": { + "quantity": 1 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "gift": { + "amount": 500 + }, + "active": true }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", - "metadata": { - "key": "value" - } - }, - "order": { - "amount": 10000, - "items": [ - { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ] - }, - "metadata": { - "key": "value" - } - } + { + "code": "CODE14", + "category": "Second", + "redemption": { + "quantity": 18 }, - "Qualify product using product_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } + "metadata": { + "season": "Fall" }, - "Qualify product using source_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } + "additional_info": "secret-code1", + "gift": { + "amount": 2000 }, - "Qualify SKU using sku_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } + "active": true + }, + { + "code": "CODE15", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 }, - "Qualify SKU using source_id": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } + "metadata": { + "season": "Fall" }, - "Qualify redemption metadata": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } + "additional_info": "secret-code1", + "active": false + } + ] + }, + "Loyalty Cards": { + "value": [ + { + "code": "CODE10", + "category": "First", + "redemption": { + "quantity": 1 }, - "Qualify order line item metadata": { - "value": { - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "order": { - "id": "ord_gqj1QYW2j2A1E3Ula2YjdPf4", - "source_id": "string", - "amount": 10000, - "items": [ - { - "source_id": "product_1234", - "product_id": "prod_0a9f9aeddb019a42db", - "amount": 10000, - "quantity": 1, - "price": 10000, - "metadata": {}, - "related_object": "product", - "product": { - "source_id": "product_1234", - "name": "Phone", - "price": 10000, - "metadata": {} - } - } - ], - "customer": { - "id": "cust_J1CDUdbqn5Exva8ASWk1Fq0j", - "source_id": "firstname.lastname@mycompany.com", - "name": "FirstName LastName", - "email": "firstname.lastname@mycompany.com", - "phone": "string", - "address": { - "city": "New York", - "country": "United States of America", - "postal_code": "10001", - "state": "NY" - }, - "metadata": {}, - "birthdate": "YYYY-MM-DD" - }, - "referrer": {}, - "metadata": "string" - }, - "reward": { - "points": 0, - "assignment_id": "string", - "id": "string" - }, - "metadata": {} - } - } + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "loyalty_card": { + "points": 300 + }, + "active": true + }, + { + "code": "CODE11", + "category": "Second", + "redemption": { + "quantity": 18 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "loyalty_card": { + "points": 2000 + }, + "active": true + }, + { + "code": "CODE12", + "category_id": "cat_0bb343dee3cdb5ec0c", + "redemption": { + "quantity": 4 + }, + "metadata": { + "season": "Fall" + }, + "additional_info": "secret-code1", + "active": true } - } + ] } - }, - "responses": { - "200": { - "description": "This operation returns the list of valid and active vouchers based on the qualification of given context (e.g., customer profile, redemptions metadata, order).", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_res_vouchers_qualification" - } - } + } + } + } + }, + "responses": { + "202": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" } } } } }, - "/v1/vouchers/bulk/async": { - "post": { - "operationId": "update-vouchers-in-bulk", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Vouchers in bulk", - "description": "Use this endpoint to update specific metadata parameters for each code, respectively. You can update each code's metadata property separately. \n\n- Update up to **100 records** in one request.\n- Upserts are not supported. \n\n> 🚧 \n> \n> Currently only **metadata** updates are supported.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "List of objects, each containing a code that is being updated and the metadata key/value pairs for that code.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_bulk_async" + "400": { + "description": "Returns an error if the request includes incorrect data, e.g. a wrong data type or duplicated codes.", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_voucher" }, - "examples": { - "Example": { - "value": [ - { - "code": "example_code", - "metadata": { - "lang": "en", - "test": false, - "MetadataTest": "Update metadata", - "update_value": 1, - "next_update_date": "2022-11-11T09:00:00.000Z" - } - }, - { - "code": "example_code2", - "metadata": { - "lang": "pl", - "test": false, - "MetadataTest": "Update metadata", - "update_value": 2 - } - } - ] - } + { + "$ref": "#/components/schemas/e_400_duplicate_key" } - } - } - }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } + ] + }, + "examples": { + "Duplicate Codes": { + "value": { + "code": 400, + "key": "duplicate_key", + "message": "Duplicate codes", + "details": "2 voucher codes(s) already exist.", + "request_id": "v-0adaccaba61502e4b3" + } + }, + "Missing Code": { + "value": { + "code": 400, + "key": "invalid_voucher", + "message": "Invalid Voucher", + "details": "Found 1 voucher(s) without 'code' value", + "request_id": "v-0bbc38ce088c8b2f9a" + } + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redemption.quantity should be number,null", + "request_id": "v-0c545db3808418908f" } } } } } + } + } + } + }, + "/v1/campaigns/{campaignId}/importCSV": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "import-vouchers-to-campaign-using-csv", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Import Vouchers to Campaign by CSV", + "description": "Imports vouchers to an **existing** campaign. \n\n\nThe CSV file has to include headers in the first line. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \\\n -F file=@/path/to/campaigns.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nYou can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties. \n\nDiscount type, time limits, and validation rules will be taken from the [campaign object](ref:get-campaign) settings. \n\n\n| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |\n|---|---|---|---|---|---|---|---|\n| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.
                  Context: `LOYALTY_PROGRAM` | The initial gift card balance.
                  Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |\n|\n\n> 📘 Active\n>\n> The CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } }, - "/v1/vouchers/metadata/async": { - "post": { - "operationId": "update-vouchers-metadata-in-bulk", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Vouchers' metadata in bulk", - "description": "Use this endpoint to update the same metadata parameters for a list of codes. \nUpdate up to **100 records** in one request. Upserts are not supported. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "description": "The file path is stored in the form `file` header." + }, + "responses": { + "200": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "$ref": "#/components/examples/res_async_actions" + } } - ], - "requestBody": { - "required": true, - "description": "Request to update vouchers metadata in bulk. Provide an array of voucher codes in the `codes` parameter along with the `metadata` object. The `metadata` object should contain the key value pairs that you would like to update for all the vouchers included in the `codes` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_metadata_async" - }, - "examples": { - "Example": { - "value": { - "codes": [ - "PROMO-CODE810", - "PROMO-CODE726" - ], - "metadata": { - "lang": "en", - "authorized_internally": true - } - } - } + } + } + }, + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_FZL4iTTdZw36nZOoXYQ172fQ", + "request_id": "v-0bc26adad888b6fed1", + "resource_id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", + "resource_type": "campaign" } } } + } + } + } + } + } + }, + "/v1/campaigns/qualification": { + "post": { + "operationId": "examine-campaigns-qualification", + "deprecated": true, + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Examine Qualification [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nThe method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order). \n\nThe maximum number of **returned campaigns is 50**.\n\n## What campaign types are included in the response?\n\n- `DISCOUNT_COUPONS`\n- `GIFT_VOUCHERS`\n- `REFERRAL_PROGRAM`\n\n## What's excluded?\n\nA checking logic will be run only among campaigns and will ignore _standalone vouchers_. For standalone vouchers, you should run a [dedicated endpoint](ref:examine-vouchers-qualification) for searching and identifing vouchers. \n\n## Subsequent Steps\n\nAs a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](ref:create-publication) will return a unique code which will belong to a given customer.\n\n## Sample use case\n\nAs a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "audienceRulesOnly", + "description": "This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)" + }, + { + "schema": { + "type": "integer", + "maximum": 50 + }, + "in": "query", + "name": "limit", + "description": "The number of campaigns to be qualified. The maximum number is 50." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "type", + "-type", + "code", + "-code", + "category", + "-category", + "campaign", + "-campaign" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_req_examine_qualification" }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the voucher(s) will be updated in the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", + "metadata": { + "key": "value" } - } - } - }, - "400": { - "description": "Returns an error indicating the reason for an unsuccessfull operation.", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - { - "$ref": "#/components/schemas/e_400_not_enough_codes" - }, - { - "$ref": "#/components/schemas/e_400_metadata_validation_failed" - } - ], - "discriminator": { - "propertyName": "key" - } - }, - "examples": { - "Not enough codes": { - "value": { - "code": 400, - "key": "not_enough_codes", - "message": "Not enough codes", - "details": "Specify at least 1 code in codes.", - "request_id": "v-0c4b067a8f161e120f" + }, + "order": { + "amount": 10000, + "items": [ + { + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } } - } + ] + }, + "metadata": { + "key": "value" } } } } } + } + }, + "responses": { + "200": { + "description": "This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/2_res_examine_qualification" + } + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" }, - "/v1/vouchers/{code}/sessions/{sessionKey}": { - "parameters": [ - { - "name": "code", - "in": "path", + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "enable-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Enable Campaign", + "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an empty json `{}`.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "7fjWdr" + "$ref": "#/components/schemas/res_empty_json" }, - "description": "A **code** that identifies the voucher or a unique voucher ID assigned by Voucherify.", - "required": true - }, - { + "examples": { + "Empty JSON": { + "value": {} + } + } + } + } + }, + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "sessionKey", - "in": "path", - "required": true, - "description": "A unique session identifier." - } - ], - "delete": { - "operationId": "release-validation-session", - "tags": [ - "VOUCHERS API" - ], - "summary": "Release Validation Session", - "description": "Manually release a validation session that has been set up for the voucher. This method undos the actions that are explained in our guide on how a validation session was established, you can read more [here](doc:locking-validation-session). \n\n> 📘 Release Session using Dashboard\n>\n> You can also use the Validations Manager in the Dashboard to unlock sessions. [Read more](https://support.voucherify.io/article/16-dashboard-sections#validations).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_h8RyP6FV94F3Ev2odP24j5p", + "request_id": "v-0adaf4847c9502879b", + "resource_id": "camp_h8RyP6FV94F3Ev2odP24j5p", + "resource_type": "campaign" + } + } } - ], - "responses": { - "204": { - "description": "Returns no content if the validation session was released successfully." + } + } + } + } + } + }, + "/v1/campaigns/{campaignId}/disable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the campaign being disabled. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." + } + ], + "post": { + "operationId": "disable-campaign", + "tags": [ + "CAMPAIGNS API" + ], + "summary": "Disable Campaign", + "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an empty json `{}`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/res_empty_json" + }, + "examples": { + "Empty JSON": { + "value": {} + } } } } }, - "/v1/campaign-object": { - "get": { - "operationId": "campaign-object", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Campaign Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Campaign Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } + "404": { + "description": "Returns an error if the campaign cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Spring Campaign", + "request_id": "v-0adaf3735116bb298b", + "resource_id": "Spring Campaign", + "resource_type": "campaign" } } } } } - }, - "/v1/campaigns": { - "post": { - "operationId": "create-campaign", - "tags": [ - "CAMPAIGNS API", - "PROMOTIONS API" - ], - "summary": "Create Campaign", - "description": "Method to create a batch of vouchers aggregated in one campaign. You can choose a variety of voucher types and define a unique pattern for generating codes. \n\n\n> 📘 Global uniqueness\n>\n> All campaign codes are unique across the whole project. Voucherify will not allow you to generate 2 campaigns with the same coupon code. \n\n> 🚧 Code generation status\n>\n> This is an asynchronous action; you can't read or modify a newly created campaign until the code generation is completed. See the `creation_status` field in the [campaign object](ref:get-campaign) description.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + }, + "/v1/promotion-tier-object": { + "get": { + "operationId": "promotion-tier-object", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Promotion Tier Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Promotion Tier Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" } - ], - "requestBody": { - "description": "Specify the details of the campaign that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_create_campaign" - }, - "examples": { - "Discount Campaign": { - "value": { - "name": "Discount Campaign 4", - "campaign_type": "DISCOUNT_COUPONS", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 3, - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "percent_off": 10, - "type": "PERCENT" - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "10OFF-#######" + } + } + } + } + } + }, + "/v1/promotions/tiers": { + "get": { + "operationId": "list-promotion-tiers", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers", + "description": "This method enables you to list promotion tiers.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "is_available", + "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ + { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" } }, + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "category_id": "cat_0bb81a481615a37b5e", + "object": "campaign" + }, + "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" + "interval": "P3D", + "duration": "P2D" }, "validity_day_of_week": [ - 0, 1, 2 ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "AMER" - } - } - }, - "Gift Card Campaign": { - "value": { - "name": "Gift Card Campaign", - "campaign_type": "GIFT_VOUCHERS", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "voucher": { - "type": "GIFT_VOUCHER", - "gift": { - "amount": 1000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 10 + "summary": { + "redemptions": { + "total_redeemed": 0 }, - "code_config": { - "pattern": "GIFT-CARD-#######" + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" + "object": "promotion_tier", + "validation_rule_assignments": null + }, + { + "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "created_at": "2021-12-15T11:34:01.358Z", + "updated_at": "2022-02-09T09:20:08.619Z", + "name": "Hot Promotion - Tier 2", + "banner": "Get Tier 2 Discount $20 Off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + } }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" - } - } - }, - "Loyalty Program": { - "value": { - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "auto_join": true, - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 33 }, - "code_config": { - "pattern": "LOYALTY-CARD-#######" + "orders": { + "total_amount": 519200, + "total_discount_amount": 66000 } }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" - } - } - }, - "Promotion": { - "value": { - "name": "Promotion - API - 4", - "campaign_type": "PROMOTION", - "type": "STATIC", - "category_id": "cat_0bb343dee3cdb5ec0c", - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "active": false, - "promotion": { - "tiers": [ - { - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "B" - }, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" - ] - }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ { - "name": "Order more than $100", - "banner": "Get $30 off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A" - }, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" - ] + "id": "asgm_pEe1inoYSfmO12p7", + "rule_id": "val_5h0wc453_5", + "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.358Z", + "object": "validation_rules_assignment" } - ] - }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" + ], + "total": 1 + } + }, + { + "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "created_at": "2021-12-15T11:34:01.333Z", + "updated_at": "2022-02-09T09:20:05.603Z", + "name": "Hot Promotion - Tier 1", + "banner": "Get Tier 1 Discount 10zl", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", "metadata": { - "region": "APAC" - } - } - }, - "Referral Program": { - "value": { - "name": "Referral Campaign 2", - "campaign_type": "REFERRAL_PROGRAM", - "join_once": true, - "type": "AUTO_UPDATE", - "category_id": "cat_0bb343dee3cdb5ec0c", - "start_date": "2020-08-16T00:00:00Z", - "expiration_date": "2023-12-26T00:00:00Z", - "vouchers_count": 2, - "referral_program": { - "conversion_event_type": "redemption" + "ProductionMetaData": "Hot Promotion - Tier 1" }, - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 45, - "effect": "APPLY_TO_ORDER", - "amount_limit": 15 - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "pattern": "REFERRAL-CODE-#######" - }, - "is_referral_code": true + "hierarchy": 1, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" }, - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 11 + }, + "orders": { + "total_amount": 1414979, + "total_discount_amount": 11000 + } }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "use_voucher_metadata_schema": false, - "metadata": { - "region": "APAC" + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_QqYs7GGVy7cuh3L9", + "rule_id": "val_5h0wc453_4", + "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.333Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } } - } + ], + "total": 3 } } } - }, - "responses": { - "200": { - "description": "Returns a campaign object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "examples": { - "Discount Campaign": { - "value": { - "id": "camp_NdBCAQk1AAZcMcv6kt6X164Q", - "name": "Discount Campaign 4", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 10 - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "10OFF-#######" - }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", + } + } + } + } + } + }, + "/client/v1/promotions/tiers": { + "get": { + "operationId": "list-promotion-tiers-client-side", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers (client-side)", + "description": "This method enables you to list promotion tiers.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "is_available", + "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_res_list_promotion_tiers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ + { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" + "interval": "P3D", + "duration": "P2D" }, "validity_day_of_week": [ - 0, 1, - 2 + 2, + 3, + 4, + 5 ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, "active": true, - "metadata": { - "region": "AMER" - }, - "created_at": "2022-09-21T09:25:49.617Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], + "category_id": "cat_0bb81a481615a37b5e", "object": "campaign" - } - }, - "Gift Card Campaign": { - "value": { - "id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "name": "Gift Card Campaign", - "campaign_type": "GIFT_VOUCHERS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "GIFT_VOUCHER", - "gift": { - "amount": 1000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "GIFT-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:31:16.266Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + }, + "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "object": "campaign" - } + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null }, - "Loyalty Program": { - "value": { - "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "LOYALTY-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, + { + "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "created_at": "2021-12-15T11:34:01.358Z", + "updated_at": "2022-02-09T09:20:08.619Z", + "name": "Hot Promotion - Tier 2", + "banner": "Get Tier 2 Discount $20 Off", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:39:45.479Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], + "category_id": "cat_0b688929a2476386a6", "object": "campaign" - } - }, - "Promotion": { - "value": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "name": "Promotion - API - 4", - "campaign_type": "PROMOTION", - "type": "STATIC", - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-23T08:54:38.281Z", - "category": "First", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "promotion": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", - "created_at": "2022-09-23T08:54:38.286Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "B" - }, - "hierarchy": 1, - "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "campaign": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": true, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" - }, - "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_dr3oXeN98YfiTF60", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_M4OfmMgSUyN12JPAw3l4hWjD", - "related_object_type": "promotion_tier", - "created_at": "2022-09-23T08:54:38.286Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - }, - { - "id": "promo_uMSxvzhxXDp3Ijs3659npqb2", - "created_at": "2022-09-23T08:54:38.314Z", - "name": "Order more than $100", - "banner": "Get $30 off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A" - }, - "hierarchy": 2, - "promotion_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "campaign": { - "id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": true, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" - }, - "campaign_id": "camp_ru1B8mQjY75KxXupt7RPZcb8", - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_jgJlWms7GVK59iNR", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_uMSxvzhxXDp3Ijs3659npqb2", - "related_object_type": "promotion_tier", - "created_at": "2022-09-23T08:54:38.314Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - ], - "total": 2, - "has_more": false + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 33 }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ + "orders": { + "total_amount": 519200, + "total_discount_amount": 66000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" + "id": "asgm_pEe1inoYSfmO12p7", + "rule_id": "val_5h0wc453_5", + "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.358Z", + "object": "validation_rules_assignment" } ], - "object": "campaign" + "total": 1 } }, - "Referral Program": { - "value": { - "id": "camp_N8rztKAqOYIdFxNLr9eNIjyB", - "name": "Referral Campaign 2", - "campaign_type": "REFERRAL_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 15, - "percent_off": 45, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "REFERRAL-CODE-#######" - }, - "is_referral_code": true, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "referral_program": { - "conversion_event_type": "redemption" - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-23T09:06:41.757Z", - "category": "First", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "object": "campaign" - } - } - } - } - } - }, - "400": { - "description": "Returns an error if an incomplete request body is provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_campaign", - "message": "Invalid Campaign", - "details": "Property 'discount' is required for REFERRAL_PROGRAM campaign", - "request_id": "v-0bb99c9213425fa250" - } - } - } - } - } - }, - "404": { - "description": "When a payload value is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find category with id cat_0bb343dee3cdb5ec0c", - "request_id": "v-0c55671ed1cb0f1a27", - "resource_id": "cat_0bb343dee3cdb5ec0c", - "resource_type": "category" - } - } - } - } - } - }, - "409": { - "description": "Returns an error if a campaign with the same name already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated campaign exists with name Discount Campaign", - "request_id": "v-0bb98f8c6552250aab", - "resource_id": "Discount Campaign", - "resource_type": "campaign" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "list-campaigns", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "List Campaigns", - "description": "Retrieve a list of campaigns in a project. \n\nThe campaigns are returned sorted by creation date, with the most recent campaigns appearing first. \n\nWhen you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using `limit`, which page of campaigns to return using `page`, sort the campaigns using the `order` query parameter and filter the results by the `campaign_type`.\n\nThis method will return an error when trying to return a limit of more than 100 campaigns.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/campaign_type" - }, - { - "schema": { - "type": "string", - "default": "category" - }, - "in": "query", - "name": "expand", - "description": "Include an expanded `categories` object in the response." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `campaign` property that contains an array of campaigns. The maximum number of campaigns returned is determined by the `limit` query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_res_list_campaigns" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "campaigns", - "campaigns": [ - { - "id": "camp_SibPsDRKQvg3SUtptgPZCNZb", - "name": "Voucher Metadata", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 4400, - "percent_off": 30, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 9, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "#########", - "prefix": "Discount-", - "postfix": "YY" - }, - "is_referral_code": false, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 1, - "active": true, - "metadata": { - "region": "AMER" - }, - "created_at": "2022-09-20T09:32:29.530Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" - }, - { - "id": "camp_HgsbCKauXmEoPnnh8aas0ISe", - "name": "Static Campaign", - "campaign_type": "DISCOUNT_COUPONS", - "type": "STATIC", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": 1 - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": true, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-09-20T07:52:34.499Z", - "updated_at": "2022-09-20T11:38:13.501Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" - }, - { - "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "name": "Loyalty Program Fall 2022", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 7, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LOYALTY-CARD-" - }, - "is_referral_code": false - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-09-19T07:56:22.103Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0bb343dee3cdb5ec0c", - "object": "campaign" - }, - { - "id": "camp_4tHsQEDUOER6PeW8SoMdnHH6", - "name": "Dynamic Discounts", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 5, - "percent_off_formula": "IF(ORDER_AMOUNT > 300;15;5)", - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "DYNAMIC-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": { - "marketing_text": "Purchases above $300 are eligible for a 15% discount." - }, - "created_at": "2022-07-12T15:12:02.575Z", - "updated_at": "2022-07-20T10:48:05.617Z", - "category": "test", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b688929a2476386a8", - "object": "campaign" - }, - { - "id": "camp_JlsseNSDO7l4neFtev6p6945", - "name": "$20 OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "$20OFFORDER-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:43:36.057Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" - }, + { + "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "created_at": "2021-12-15T11:34:01.333Z", + "updated_at": "2022-02-09T09:20:05.603Z", + "name": "Hot Promotion - Tier 1", + "banner": "Get Tier 1 Discount 10zl", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "ProductionMetaData": "Hot Promotion - Tier 1" + }, + "hierarchy": 1, + "promotion_id": "camp_5h0wc453_5", + "campaign": { + "id": "camp_5h0wc453_5", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b688929a2476386a6", + "object": "campaign" + }, + "campaign_id": "camp_5h0wc453_5", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 11 + }, + "orders": { + "total_amount": 1414979, + "total_discount_amount": 11000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ { - "id": "camp_Uj3cNbWSgt7Zl4AyHM7Sa5Qk", - "name": "3% OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 3, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "3%OFFORDER-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, - "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:41:12.087Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": null, - "object": "campaign" + "id": "asgm_QqYs7GGVy7cuh3L9", + "rule_id": "val_5h0wc453_4", + "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", + "related_object_type": "promotion_tier", + "created_at": "2021-12-15T11:34:01.333Z", + "object": "validation_rules_assignment" } ], - "total": 6 + "total": 1 } } - } + ], + "total": 3 } } } } } + } + } + } + }, + "/v1/promotions/{campaignId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/campaigns/{campaignId}": { - "parameters": [ - { - "in": "path", - "name": "campaignId", - "description": "You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value.", + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID assigned by Voucherify." + } + ], + "get": { + "operationId": "list-promotion-tiers-from-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Tiers from Campaign", + "description": "This method enables you to list promotion tiers from a specified campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" }, - "required": true - } - ], - "get": { - "operationId": "get-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Get Campaign", - "description": "Retrieves the campaign with the given campaign ID or campaign name.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a campaign object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_JlsseNSDO7l4neFtev6p6945", - "name": "$20 OFF Entire Order", - "campaign_type": "DISCOUNT_COUPONS", - "type": "AUTO_UPDATE", - "voucher": { - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "$20OFFORDER-" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "vouchers_count": 1, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "tiers", + "tiers": [ + { + "id": "promo_xyOKjAmysZrwt3aqq1dMUwMU", + "created_at": "2022-04-07T08:43:53.730Z", + "updated_at": "2022-08-26T05:22:43.220Z", + "name": "Amount", + "banner": "Get $10 off entire order", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 1000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "campaign": { + "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "start_date": null, + "expiration_date": null, "active": true, - "metadata": {}, - "created_at": "2022-07-11T09:43:36.057Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 + "category_id": "cat_0b5f67863083bf7c05", + "object": "campaign" + }, + "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 1 }, - "category_id": null, + "orders": { + "total_amount": 2187, + "total_discount_amount": 1000 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null + }, + { + "id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", + "created_at": "2022-04-07T08:43:53.581Z", + "updated_at": "2022-08-26T05:22:43.008Z", + "name": "Percentage", + "banner": "Get 10% OFF on entire order", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "campaign": { + "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "start_date": null, + "expiration_date": null, + "active": true, + "category_id": "cat_0b5f67863083bf7c05", "object": "campaign" - } - } - } - } - } - }, - "404": { - "description": "Returns an error when requesting the campaign that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_jcErmtGAOmHUAy0oUgkwKnP", - "request_id": "v-0bb8694614d58bf2a8", - "resource_id": "camp_jcErmtGAOmHUAy0oUgkwKnP", - "resource_type": "campaign" - } + }, + "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", + "active": true, + "summary": { + "redemptions": { + "total_redeemed": 1 + }, + "orders": { + "total_amount": 71600, + "total_discount_amount": 7160 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } - } + ], + "total": 2, + "has_more": false } } } } - }, - "put": { - "operationId": "update-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Update Campaign", - "description": "Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. \n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped. \n\n> #### Vouchers will be affected\n>\n> This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the campaign parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_update_campaign" + } + } + } + }, + "post": { + "operationId": "add-promotion-tier-to-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Add Promotion Tier to Campaign", + "description": "This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion tier parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" + }, + "examples": { + "Example": { + "value": { + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" }, - "examples": { - "Example": { - "value": { - "description": "New description" - } - } - } + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "validation_rules": [ + "val_q8qUBMOh5qIQ" + ] } } - }, - "responses": { - "200": { - "description": "Returns the campaign object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_obj_campaign_object" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a promotion tier object if the promotion tier was successfully added to the campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_JcYGIKJsnv0SpZcx2njZm69x", + "created_at": "2022-09-22T11:21:57.808Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 6, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } }, - "examples": { - "Example": { - "value": { - "id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "name": "Loyalty Campaign", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1000, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_YEAR" - } - }, - "redemption": { - "quantity": 10 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "LOYALTY-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": false, - "description": "New description", - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": "2023-12-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 2, - "active": true, - "metadata": { - "region": "APAC" - }, - "created_at": "2022-09-21T09:39:45.479Z", - "updated_at": "2022-09-23T09:47:00.205Z", - "category": "First", - "creation_status": "MODIFYING", - "vouchers_generation_status": "MODIFYING", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "object": "campaign" + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_AmeYPmiLZKaIxq01", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_JcYGIKJsnv0SpZcx2njZm69x", + "related_object_type": "promotion_tier", + "created_at": "2022-09-22T11:21:57.808Z", + "object": "validation_rules_assignment" } - } + ], + "total": 1 } } } } } - }, - "delete": { - "operationId": "delete-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Delete Campaign", - "description": "Permanently deletes a campaign and all related vouchers. This action cannot be undone. Also, this method immediately removes any redemptions on the voucher.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with exactly the same name.", - "name": "force" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/promotions/tiers/{promotionTierId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "promo_2EnAik6Jt7dKTOMkRTIgEjZH" + }, + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "get": { + "operationId": "get-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Get Promotion Tier", + "description": "This method enables you to retrieve a specific promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a promotion tier object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" } - ], - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Delete Campaign": { - "$ref": "#/components/examples/res_async_actions" - } + } + } + } + } + }, + "put": { + "operationId": "update-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Update Promotion Tier", + "description": "This method updates a promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion tier parameters that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_update_promotion_tier" + }, + "examples": { + "Example": { + "value": { + "name": "Order more than $100 USD", + "banner": "Order more than $100 USD", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 25, + "effect": "APPLY_TO_ORDER" } - } + }, + "metadata": { + "level": "A-21" + }, + "hierarchy": 1, + "start_date": "2022-09-22T00:00:00.000Z", + "expiration_date": "2022-09-29T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3 + ] } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a promotion tier object if the update was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" }, - "404": { - "description": "Returns an error indicating that the campaign with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Spring Campaign", - "request_id": "v-0adac46be8cdbfd921", - "resource_id": "Spring Campaign", - "resource_type": "campaign" - } + "examples": { + "Example": { + "value": { + "id": "promo_hINAfBAVhmFuSAzi3vptfyxW", + "created_at": "2022-09-22T12:40:23.286Z", + "updated_at": "2022-09-22T12:40:58.626Z", + "name": "Order more than $100 USD", + "banner": "Order more than $100 USD", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 25, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": { + "level": "A-21" + }, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": false, + "start_date": "2022-09-22T00:00:00.000Z", + "expiration_date": "2022-09-29T00:00:00.000Z", + "validity_timeframe": { + "interval": "P3D", + "duration": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3 + ], + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_8e3e53ZgDNcoRGAI", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW", + "related_object_type": "promotion_tier", + "created_at": "2022-09-22T12:40:23.286Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 } } } } } } + } + } + }, + "delete": { + "operationId": "delete-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Delete Promotion Tier", + "description": "This method deletes a promotion tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/campaigns/{campaignId}/vouchers": { - "parameters": [ - { + "404": { + "description": "Returns an error indicating that the promotion tier with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign to which voucher(s) will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "add-vouchers-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Add Vouchers to Campaign", - "description": "This method gives the possibility to push new vouchers to an existing campaign. New vouchers will inherit properties from the campaign profile. However, it is possible to overwrite some of them in the request body. If you provide an optional `code_config` parameter with a voucher code configuration, then it will be used to generate new voucher codes. Otherwise, the voucher code configuration from the campaign will be used.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [ - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "vouchers_count", - "description": "Number of vouchers that should be added." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher parameters that you would like to overwrite.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_add_vouchers_to_campaign" - }, - "examples": { - "Example": { - "value": { - "category_id": "cat_0bb81a481615a37b5e", - "start_date": "2022-09-24T00:00:00Z", - "expiration_date": "2022-09-25T23:59:59Z", - "active": false, - "redemption": { - "quantity": null - }, - "code_config": { - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "length": 8, - "prefix": "Add-", - "pattern": null, - "postfix": "-API" - }, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_2EnAik6Jt7dKTOMkRTIgEjZ", + "request_id": "v-0ae284707e9027a79d", + "resource_id": "promo_2EnAik6Jt7dKTOMkRTIgEjZ", + "resource_type": "promotion_tier" } } } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded for a voucher count of 1.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0bb96ebb7ec3720252" - } + } + } + } + } + } + }, + "/v1/promotions/tiers/{promotionTierId}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + }, + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "post": { + "operationId": "enable-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Enable Promotion Tier", + "description": "This method enables a promotion tier, i.e. makes the `active` parameter = `true`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the promotion tier object with an updated `active` parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_tier_object" + }, + "examples": { + "Example": { + "value": { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "updated_at": "2022-09-22T10:32:07.712Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 2 + }, + "orders": { + "total_amount": 37650, + "total_discount_amount": 6000 } - } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } + } + } + } + }, + "404": { + "description": "Returns an error if the promotion tier cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "202": { - "description": "Returns an `async_action_id` if the request was made to create more than 1 voucher.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - } + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", + "request_id": "v-0bbaea52be14cc9782", + "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", + "resource_type": "promotion_tier" } } } } } + } + } + } + }, + "/v1/promotions/tiers/{promotionTierId}/disable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" }, - "/v1/campaigns/{campaignId}/vouchers/{code}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign to which voucher will be added. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - }, - { + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "post": { + "operationId": "disable-promotion-tier", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Disable Promotion Tier", + "description": "This method disables a promotion tier, i.e. makes the `active` parameter = `false`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the promotion tier object with an updated `active` parameter.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/3_obj_promotion_tier_object" }, - "name": "code", - "in": "path", - "required": true, - "description": "A custom **code** that identifies the voucher." - } - ], - "post": { - "operationId": "add-voucher-with-specific-code-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Add Voucher with Specific Code to Campaign", - "description": "This method gives a possibility to add a new voucher to an existing campaign. The voucher definition will be inherited from the definition kept in the campaign profile. However, you are able to overwrite a few properties inherited from the campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher parameters that you would like to overwrite.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_add_vouchers_with_specific_code_to_campaign" - }, - "examples": { - "Example": { - "value": { - "category_id": "cat_0bb81a481615a37b5e", - "start_date": "2022-09-24T00:00:00Z", - "expiration_date": "2022-09-25T23:59:59Z", - "active": false, - "redemption": { - "quantity": null - }, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" - } + "examples": { + "Example": { + "value": { + "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", + "created_at": "2022-09-21T11:38:34.962Z", + "updated_at": "2022-09-22T10:34:09.529Z", + "name": "Order more than $100", + "banner": "Order more than $100", + "action": { + "discount": { + "type": "AMOUNT", + "amount_off": 3000, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 1, + "campaign": { + "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": false, + "start_date": "2022-09-21T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 2 + }, + "orders": { + "total_amount": 37650, + "total_discount_amount": 6000 } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a voucher object if the call succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" }, - "examples": { - "Example": { - "value": { - "id": "v_EJwB9Wy2aOIsDpWhnl2QBY51OqjQ5Ukg", - "code": "Code3", - "campaign": "Add Vouchers to Campaign", - "campaign_id": "camp_xxpmFyWO9h9s5cEe7HtmOK5B", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "amount_limit": 2000, - "percent_off": 30, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-24T00:00:00.000Z", - "expiration_date": "2022-09-25T23:59:59.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "Voucher added using API", - "metadata": { - "Season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+p2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6+1N81zXuY6/pnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bp2kdatp7KAUZxgSATC1gRWgsb1Q3RQyClNOBrfUrRKpTjSPSzBuUSZzb45TIpfWRISSiaz1QXGh8z9sVSHIWQsGLO6%2B1N81zXuY6%2FpnC7gRBa4edwMaRoCAwzqO9JDw148AGk4XrXLg%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5/u9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY+sOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW+NCQg6Ts8clYWWP5lrGyV/fzoA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wrLVWzIOgoVd9an76OxiJWB5%2Fu9yWGoD7cqN6Qd1K9noNyR1YwvHnBrcN5fa5qtY%2BsOXonn7WsynAWeR289gA0XobsHHE2VWe8BzNZ7h2kH90SsiW%2BNCQg6Ts8clYWWP5lrGyV%2FfzoA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-21T07:14:28.217Z", - "updated_at": null, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/Code3/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/Code3/publications?page=1&limit=10" - }, - "object": "voucher" - } - } - } + "object": "promotion_tier", + "validation_rule_assignments": null } } + } + } + } + }, + "404": { + "description": "Returns an error if the promotion tier cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "409": { - "description": "Returns an error if a voucher with the same code already exists.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated voucher exists with id Code1", - "request_id": "v-0bb974be99d22504cd", - "resource_id": "Code1", - "resource_type": "voucher" - } - } - } + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", + "request_id": "v-0bbaea52be14cc9782", + "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", + "resource_type": "promotion_tier" } } } } } + } + } + } + }, + "/v1/promotions/stacks": { + "get": { + "operationId": "list-all-promotion-stacks", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Stacks", + "description": "This method enables you to list promotion stacks irrespective of the campaign they are associated with. \n\nYou can use filters in the query parameters to specify the stacks to be returned in the response.\n\n## Advanced filters for fetching promotion stacks\n\n| **Filters** | **Examples** |\n| :--- | :--- |\n| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`
                  - `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`
                  - `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |\n| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`
                  - `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`
                  - `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." }, - "/v1/campaigns/{campaignId}/import": { - "parameters": [ - { + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Which page of results to return.", + "name": "page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "name", + "-name" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a `data` property that contains an array of promotion stacks across all your campaigns.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The ID of an existing campaign to which you're importing the codes. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "import-vouchers-to-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Import Vouchers to Campaign", - "description": "Imports vouchers to an **existing** campaign.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Discount type, expiration date and the remaining attributes will be taken from the [Campaign](ref:get-campaign) settings.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_import_vouchers_to_campaign" - }, - "examples": { - "Example": { - "value": [ - { - "code": "CODE7", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true - }, - { - "code": "CODE8", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true - }, - { - "code": "CODE9", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true - } - ] - }, - "Gift Cards": { - "value": [ - { - "code": "CODE13", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "gift": { - "amount": 500 - }, - "active": true - }, - { - "code": "CODE14", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "gift": { - "amount": 2000 - }, - "active": true - }, - { - "code": "CODE15", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": false - } - ] - }, - "Loyalty Cards": { - "value": [ - { - "code": "CODE10", - "category": "First", - "redemption": { - "quantity": 1 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "loyalty_card": { - "points": 300 - }, - "active": true - }, - { - "code": "CODE11", - "category": "Second", - "redemption": { - "quantity": 18 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "loyalty_card": { - "points": 2000 - }, - "active": true - }, - { - "code": "CODE12", - "category_id": "cat_0bb343dee3cdb5ec0c", - "redemption": { - "quantity": 4 - }, - "metadata": { - "season": "Fall" - }, - "additional_info": "secret-code1", - "active": true + "$ref": "#/components/schemas/3_res_list_promotion_stacks" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "stack_SLuhQrAt3mXwHg776lYkzZO8", + "name": "Stack 2", + "created_at": "2022-11-03T10:18:58.356Z", + "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Mfww2TuoeU23enqSmnz0f3rh", + "promo_vU5IHaLKS7mmZ3ylABET6ikb", + "promo_TeHA11JlfN29mUftDcpqIWWq", + "promo_bhKBsIX3tO7yqmpTLCLLuaud" + ], + "hierarchy_mode": "MANUAL" } - ] - } - } - } - } - }, - "responses": { - "202": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "400": { - "description": "Returns an error if the request includes incorrect data, e.g. a wrong data type or duplicated codes.", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/e_400_invalid_voucher" - }, - { - "$ref": "#/components/schemas/e_400_duplicate_key" + }, + { + "id": "stack_twQWp1TyaxX5RlSqn061xGVy", + "name": "First stack", + "created_at": "2021-12-27T11:59:21.838Z", + "updated_at": "2022-12-16T08:22:51.970Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga", + "promo_Mwy9XpA0TLctSGriM5kum0qp" + ], + "hierarchy_mode": "MANUAL" } - ] - }, - "examples": { - "Duplicate Codes": { - "value": { - "code": 400, - "key": "duplicate_key", - "message": "Duplicate codes", - "details": "2 voucher codes(s) already exist.", - "request_id": "v-0adaccaba61502e4b3" + }, + { + "id": "stack_vhCqN5PY7rmPw8yACRvHRZaz", + "name": "Second stack", + "created_at": "2021-12-27T11:55:47.431Z", + "updated_at": "2022-12-16T08:22:52.221Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga", + "promo_Mwy9XpA0TLctSGriM5kum0qp" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_zwChew7GY1AnDZJQ6GVP2sdT", + "name": "Third stack", + "created_at": "2021-12-27T11:54:26.283Z", + "updated_at": "2022-12-16T08:22:52.483Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_NS5hEUznL9XPa89rbrOZYMey", + "name": "Fourth stack", + "created_at": "2021-12-27T11:48:43.982Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_Rz0NvFtCZOObS3J5R68KET17", + "name": "Third stack", + "created_at": "2021-12-27T11:40:57.426Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_e8pH0nIuANmYRPE0x8hwDrpm", + "name": "Second stack", + "created_at": "2021-12-27T08:43:13.875Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Mwy9XpA0TLctSGriM5kum0qp", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" } }, - "Missing Code": { - "value": { - "code": 400, - "key": "invalid_voucher", - "message": "Invalid Voucher", - "details": "Found 1 voucher(s) without 'code' value", - "request_id": "v-0bbc38ce088c8b2f9a" + { + "id": "stack_3Q4EJpZqg3DI5IRwgBYfsb37", + "name": "First stack", + "created_at": "2021-12-27T08:43:13.498Z", + "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_Vet0vCNyyo5pOddHfu2X3FCB", + "promo_PoIyRVFA5c0Jk514xCpzKHga" + ], + "hierarchy_mode": "MANUAL" } }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redemption.quantity should be number,null", - "request_id": "v-0c545db3808418908f" + { + "id": "stack_KxSD0GahLUg9ULB6TseGfUHJ", + "name": "Stack 1", + "created_at": "2021-12-23T12:28:38.881Z", + "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_NMex647s5UushvbBUJmYT2Fc", + "promo_4TqHr24boFISDrcOHSlfAxwm" + ], + "hierarchy_mode": "MANUAL" } } - } + ], + "total": 9 } } } } } + } + } + } + }, + "/v1/promotions/{campaignId}/stacks": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/campaigns/{campaignId}/importCSV": { - "parameters": [ - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + } + ], + "get": { + "operationId": "list-promotion-stacks-in-campaign", + "tags": [ + "PROMOTIONS API" + ], + "summary": "List Promotion Stacks in Campaign", + "description": "This method enables you to list promotion stacks from a specified campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of promotion stack objects.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "import-vouchers-to-campaign-using-csv", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Import Vouchers to Campaign by CSV", - "description": "Imports vouchers to an **existing** campaign. \n\n\nThe CSV file has to include headers in the first line. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/campaigns/TEST-CAMPAIGN/importCSV \\\n -F file=@/path/to/campaigns.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nYou can import values for the following fields: `Code` (**required**), `Category`, `Active`. In a gift cards import, you can also include the current card balance using the `Gift Amount` header and the amount that was redeemed using the `Redeemed Amount` header. In a loyalty cards import, you can also include the current loyalty card score in points using the `Loyalty Points` header. Remaining CSV columns will be mapped to metadata properties. \n\nDiscount type, time limits, and validation rules will be taken from the [campaign object](ref:get-campaign) settings. \n\n\n| **Active** | **Code** | **Loyalty Points** | **Gift Amount** | **Redeemed Amount** | **Redeemed Quantity** | **Category** | **Custom_metadata_property** |\n|---|---|---|---|---|---|---|---|\n| Use `true` or `false` to enable or disable the voucher; this flag can be used to turn off the ability to redeem a voucher even though it is within the campaign's start/end validity timeframe. | The unique voucher code. | The number of points to be added to the loyalty card. If you leave this undefined, then the initial number of points will be set according to the campaign settings.
                  Context: `LOYALTY_PROGRAM` | The initial gift card balance.
                  Context: `GIFT_VOUCHERS` | The amount that was redeemed from the available balance on a gift card. | The number of times the voucher has been redeemed. | A custom tag for the voucher to help you filter codes; you can either import the category name or a unique Voucherify-assigned category ID. | Any additional data that you would like to store for the given loyalty card as a Custom attribute. Remember to define the metadata schema in the Dashboard prior to importing codes. |\n|\n\n> 📘 Active\n>\n> The CSV file is allowed in two versions; either with or without a column titled `Active`. It indicates whether the voucher is enabled after the import event. \n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - } - } - }, - "description": "The file path is stored in the form `file` header." - }, - "responses": { - "200": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the vouchers will be imported to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "$ref": "#/components/examples/res_async_actions" - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_FZL4iTTdZw36nZOoXYQ172fQ", - "request_id": "v-0bc26adad888b6fed1", - "resource_id": "camp_FZL4iTTdZw36nZOoXYQ172fQ", - "resource_type": "campaign" + "$ref": "#/components/schemas/3_res_list_promotion_stacks" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "stack_p0WhtyyDU95crobleMpRabhH", + "name": "First stack", + "created_at": "2022-09-22T13:03:25.740Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_dJNhAEeV5sR5oPQq1UrUdnMC", + "promo_aaAF8mVAzA0PF1igia2OC63d" + ], + "hierarchy_mode": "MANUAL" + } + }, + { + "id": "stack_XAzn8AFR3Ks3DBPLAQxV7zHe", + "name": "Second stack", + "created_at": "2022-09-22T13:03:25.903Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" } } - } + ], + "total": 2 } } } } } - }, - "/v1/campaigns/qualification": { - "post": { - "operationId": "examine-campaigns-qualification", - "deprecated": true, - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Examine Qualification [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nThe method can be used for sending a request to display all campaigns qualified to the given customer and context (e.g., order). \n\nThe maximum number of **returned campaigns is 50**.\n\n## What campaign types are included in the response?\n\n- `DISCOUNT_COUPONS`\n- `GIFT_VOUCHERS`\n- `REFERRAL_PROGRAM`\n\n## What's excluded?\n\nA checking logic will be run only among campaigns and will ignore _standalone vouchers_. For standalone vouchers, you should run a [dedicated endpoint](ref:examine-vouchers-qualification) for searching and identifing vouchers. \n\n## Subsequent Steps\n\nAs a recommended subsequent step after selecting a qualified campaign is to publish a voucher code from that campaign. The [API method for publishing](ref:create-publication) will return a unique code which will belong to a given customer.\n\n## Sample use case\n\nAs a sample use case, you can imagine a requirement of displaying coupons (grouped in campaigns) that a customer is eligible to use. The customer should get assigned to the particular voucher from the campaign and then may redeem that particular code when he/she places an order.\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "audienceRulesOnly", - "description": "This parameter set to true will ask only for verifying vouchers' validation rules only against conditions applied to audiences' attributes (belonging into segment and Customer metadata)" - }, - { - "schema": { - "type": "integer", - "maximum": 50 - }, - "in": "query", - "name": "limit", - "description": "The number of campaigns to be qualified. The maximum number is 50." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "type", - "-type", - "code", - "-code", - "category", - "-category", - "campaign", - "-campaign" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_req_examine_qualification" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", - "metadata": { - "key": "value" - } - }, - "order": { - "amount": 10000, - "items": [ - { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ] - }, - "metadata": { - "key": "value" - } - } - } - } - } - } + } + } + }, + "post": { + "operationId": "create-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Create Promotion Stack", + "description": "This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the order of promotion tiers for the promotion stack.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_create_promotion_stack" }, - "responses": { - "200": { - "description": "This operation returns the list of valid and active campaigns based on the qualification of a given context (e.g., customer profile, redemptions metadata, order).\n\n[Read](doc:checking-eligibility-for-coupons) about Qualification API limits before you start.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/2_res_examine_qualification" - } + "examples": { + "Example": { + "value": { + "name": "Fifth Stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" } } } } } - }, - "/v1/campaigns/{campaignId}/enable": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns a new stack object if a valid promotion campaign identifier was provided in the path and available promotion IDs in the payload.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being enabled. You can either pass the campaign ID, which was assigned by Voucherify or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "enable-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Enable Campaign", - "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **active**. The vouchers in this campaign can be redeemed - only if the redemption occurs after the start date of the campaign and voucher and the voucher and campaign are not expired.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an empty json `{}`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/res_empty_json" - }, - "examples": { - "Empty JSON": { - "value": {} - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_h8RyP6FV94F3Ev2odP24j5p", - "request_id": "v-0adaf4847c9502879b", - "resource_id": "camp_h8RyP6FV94F3Ev2odP24j5p", - "resource_type": "campaign" - } - } + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", + "name": "Fifth Stack", + "created_at": "2022-09-23T07:44:53.888Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE", + "promo_dJNhAEeV5sR5oPQq1UrUdnMC" + ], + "hierarchy_mode": "MANUAL" } } } @@ -51363,90 +53111,102 @@ } } }, - "/v1/campaigns/{campaignId}/disable": { - "parameters": [ - { + "404": { + "description": "Returns an error if the campaign or promotion tier cannot be found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the campaign being disabled. You can either pass the campaign ID, which was assigned by Voucherify, or the name of the campaign as the path parameter value." - } - ], - "post": { - "operationId": "disable-campaign", - "tags": [ - "CAMPAIGNS API" - ], - "summary": "Disable Campaign", - "description": "There are various times when you'll want to manage a campaign's accessibility. This can be done by two API methods for managing the campaign state - *enable* and *disable*. \n\nSets campaign state to **inactive**. The vouchers in this campaign can no longer be redeemed.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an empty json `{}`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/res_empty_json" - }, - "examples": { - "Empty JSON": { - "value": {} - } - } + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", + "request_id": "v-0bbc10de5886137afd", + "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", + "resource_type": "campaign" } - } - }, - "404": { - "description": "Returns an error if the campaign cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Spring Campaign", - "request_id": "v-0adaf3735116bb298b", - "resource_id": "Spring Campaign", - "resource_type": "campaign" - } - } - } + }, + "Promotion Tier Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_tier with id promo_dJNhAEeV5sR5oPQq1UrUdnM", + "request_id": "v-0bbc11186303fa288a", + "resource_id": "promo_dJNhAEeV5sR5oPQq1UrUdnM", + "resource_type": "promotion_tier" } } } } } + } + } + } + }, + "/v1/promotions/{campaignId}/stacks/{stackId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" }, - "/v1/promotion-tier-object": { - "get": { - "operationId": "promotion-tier-object", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Promotion Tier Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Promotion Tier Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + "name": "campaignId", + "in": "path", + "required": true, + "description": "ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "stack_KOIde7AUf08at12lZ1r3OfFL" + }, + "name": "stackId", + "in": "path", + "required": true, + "description": "Promotion stack ID." + } + ], + "get": { + "operationId": "get-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Get Promotion Stack", + "description": "This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a stack object if valid identifiers were provided in the path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_p0WhtyyDU95crobleMpRabhH", + "name": "First stack", + "created_at": "2022-09-22T13:03:25.740Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_dJNhAEeV5sR5oPQq1UrUdnMC", + "promo_aaAF8mVAzA0PF1igia2OC63d" + ], + "hierarchy_mode": "MANUAL" } } } @@ -51454,13066 +53214,9926 @@ } } }, - "/v1/promotions/tiers": { - "get": { - "operationId": "list-promotion-tiers", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers", - "description": "This method enables you to list promotion tiers.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "is_available", - "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." - }, - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] + "404": { + "description": "Returns an error if the campaign or promotion stack cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Stack Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_stack with id stack_p0WhtyyDU95crobleMpRabh", + "request_id": "v-0bbc0a659591f99d65", + "resource_id": "stack_p0WhtyyDU95crobleMpRabh", + "resource_type": "promotion_stack" + } }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "category_id": "cat_0bb81a481615a37b5e", - "object": "campaign" - }, - "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - }, - { - "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "created_at": "2021-12-15T11:34:01.358Z", - "updated_at": "2022-02-09T09:20:08.619Z", - "name": "Hot Promotion - Tier 2", - "banner": "Get Tier 2 Discount $20 Off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 33 - }, - "orders": { - "total_amount": 519200, - "total_discount_amount": 66000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_pEe1inoYSfmO12p7", - "rule_id": "val_5h0wc453_5", - "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.358Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - }, - { - "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "created_at": "2021-12-15T11:34:01.333Z", - "updated_at": "2022-02-09T09:20:05.603Z", - "name": "Hot Promotion - Tier 1", - "banner": "Get Tier 1 Discount 10zl", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "ProductionMetaData": "Hot Promotion - Tier 1" - }, - "hierarchy": 1, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 11 - }, - "orders": { - "total_amount": 1414979, - "total_discount_amount": 11000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_QqYs7GGVy7cuh3L9", - "rule_id": "val_5h0wc453_4", - "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.333Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - ], - "total": 3 - } - } - } + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", + "request_id": "v-0bbc0aa77a0c8b78e8", + "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", + "resource_type": "campaign" } } } } } - }, - "/client/v1/promotions/tiers": { - "get": { - "operationId": "list-promotion-tiers-client-side", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers (client-side)", - "description": "This method enables you to list promotion tiers.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "is_available", - "description": "This parameter allows filtering promotions that are only available at the moment. When set to `true`, it selects only non-expired and active promotions." - }, - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] + } + } + }, + "put": { + "operationId": "update-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Update Promotion Stack", + "description": "This methods allows for editing an existing stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the promotion stack parameters that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_req_create_promotion_stack" + }, + "examples": { + "Example": { + "value": { + "name": "Fifth Stack Modified", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE" + ], + "hierarchy_mode": "MANUAL" + } + } } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "category_id": "cat_0bb81a481615a37b5e", - "object": "campaign" - }, - "campaign_id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - }, - { - "id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "created_at": "2021-12-15T11:34:01.358Z", - "updated_at": "2022-02-09T09:20:08.619Z", - "name": "Hot Promotion - Tier 2", - "banner": "Get Tier 2 Discount $20 Off", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 33 - }, - "orders": { - "total_amount": 519200, - "total_discount_amount": 66000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_pEe1inoYSfmO12p7", - "rule_id": "val_5h0wc453_5", - "related_object_id": "promo_RaYHtUBre5jU8frUXOvYBtlN", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.358Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - }, - { - "id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "created_at": "2021-12-15T11:34:01.333Z", - "updated_at": "2022-02-09T09:20:05.603Z", - "name": "Hot Promotion - Tier 1", - "banner": "Get Tier 1 Discount 10zl", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "ProductionMetaData": "Hot Promotion - Tier 1" - }, - "hierarchy": 1, - "promotion_id": "camp_5h0wc453_5", - "campaign": { - "id": "camp_5h0wc453_5", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b688929a2476386a6", - "object": "campaign" - }, - "campaign_id": "camp_5h0wc453_5", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 11 - }, - "orders": { - "total_amount": 1414979, - "total_discount_amount": 11000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_QqYs7GGVy7cuh3L9", - "rule_id": "val_5h0wc453_4", - "related_object_id": "promo_63fYCt81Aw0h7lzyRkrGZh9p", - "related_object_type": "promotion_tier", - "created_at": "2021-12-15T11:34:01.333Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - ], - "total": 3 - } - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a promotion stack with updated parameters if the update was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3_obj_promotion_stack_object" + }, + "examples": { + "Example": { + "value": { + "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", + "name": "Fifth Stack Modified", + "created_at": "2022-09-23T07:44:53.888Z", + "updated_at": "2022-09-23T07:59:44.172Z", + "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", + "object": "promotion_stack", + "tiers": { + "ids": [ + "promo_aaAF8mVAzA0PF1igia2OC63d", + "promo_t9zdL6XMFk7B8fQ23zxELtdE" + ], + "hierarchy_mode": "MANUAL" } } } } } } + } + } + }, + "delete": { + "operationId": "delete-promotion-stack", + "tags": [ + "PROMOTIONS API" + ], + "summary": "Delete Promotion Stack", + "description": "This method deletes a promotion stack.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/promotions/{campaignId}/tiers": { - "parameters": [ - { + "404": { + "description": "Returns an error indicating that the stack or campaign with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID assigned by Voucherify." - } - ], - "get": { - "operationId": "list-promotion-tiers-from-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Tiers from Campaign", - "description": "This method enables you to list promotion tiers from a specified campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `tiers` property that contains an array of promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_tiers_from_campaign" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "tiers", - "tiers": [ - { - "id": "promo_xyOKjAmysZrwt3aqq1dMUwMU", - "created_at": "2022-04-07T08:43:53.730Z", - "updated_at": "2022-08-26T05:22:43.220Z", - "name": "Amount", - "banner": "Get $10 off entire order", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 1000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "campaign": { - "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b5f67863083bf7c05", - "object": "campaign" - }, - "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 1 - }, - "orders": { - "total_amount": 2187, - "total_discount_amount": 1000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - }, - { - "id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", - "created_at": "2022-04-07T08:43:53.581Z", - "updated_at": "2022-08-26T05:22:43.008Z", - "name": "Percentage", - "banner": "Get 10% OFF on entire order", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 10, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "promotion_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "campaign": { - "id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "start_date": null, - "expiration_date": null, - "active": true, - "category_id": "cat_0b5f67863083bf7c05", - "object": "campaign" - }, - "campaign_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0", - "active": true, - "summary": { - "redemptions": { - "total_redeemed": 1 - }, - "orders": { - "total_amount": 71600, - "total_discount_amount": 7160 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - } - ], - "total": 2, - "has_more": false - } - } - } + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Stack Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find promotion_stack with id stack_KOIde7AUf08at12lZ1r3OfFp", + "request_id": "v-0ae289ca779027b030", + "resource_id": "stack_KOIde7AUf08at12lZ1r3OfFp", + "resource_type": "promotion_stack" + } + }, + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer % Promotion", + "request_id": "v-0ae28a621c46af534b", + "resource_id": "Summer % Promotion", + "resource_type": "campaign" } } } } - }, - "post": { - "operationId": "add-promotion-tier-to-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Add Promotion Tier to Campaign", - "description": "This method allows you to add a new promotion tier to an existing campaign. The tier hierarchy will be set as the next consequtive integer following the lowest ranking tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/reward-object": { + "get": { + "operationId": "reward-object", + "tags": [ + "REWARDS API" + ], + "summary": "Reward Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Reward object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" } - ], - "requestBody": { - "description": "Specify the promotion tier parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_add_promotion_tier_to_campaign" - }, - "examples": { - "Example": { - "value": { - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "validation_rules": [ - "val_q8qUBMOh5qIQ" - ] - } - } - } - } + } + } + } + } + } + }, + "/v1/reward-assignment-object": { + "get": { + "operationId": "reward-assignment-object", + "tags": [ + "REWARDS API" + ], + "summary": "Reward Assignment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Reward Assignment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" } - }, - "responses": { - "200": { - "description": "Returns a promotion tier object if the promotion tier was successfully added to the campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - }, - "examples": { - "Example": { - "value": { - "id": "promo_JcYGIKJsnv0SpZcx2njZm69x", - "created_at": "2022-09-22T11:21:57.808Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 6, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_AmeYPmiLZKaIxq01", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_JcYGIKJsnv0SpZcx2njZm69x", - "related_object_type": "promotion_tier", - "created_at": "2022-09-22T11:21:57.808Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 + } + } + } + } + } + }, + "/v1/rewards": { + "get": { + "operationId": "list-rewards", + "tags": [ + "REWARDS API" + ], + "summary": "List Rewards", + "description": "Retrieve rewards.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + }, + "in": "query", + "name": "assignment_id", + "description": "A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of reward objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_res_list_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rew_3e7IqghVtTR7L3xQMSCxjFu2", + "name": "Get $10", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", + "balance": 1000, + "type": "GIFT_VOUCHERS" } - } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-03-10T08:40:20.917Z", + "updated_at": "2022-08-17T07:52:56.965Z", + "metadata": null, + "object": "reward" + }, + { + "id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "name": "Get 100 Points", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "balance": 100, + "type": "LOYALTY_PROGRAM" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-02-28T11:56:13.764Z", + "updated_at": null, + "metadata": null, + "object": "reward" + }, + { + "id": "rew_BNZ3van6AF2AiquWp8Lfw0xq", + "name": "30% discount", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_ZtHLATYVpItqmuSqmaz1rZ2Y", + "type": "DISCOUNT_COUPONS" + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T09:48:50.609Z", + "updated_at": null, + "metadata": {}, + "object": "reward" + }, + { + "id": "rew_nlV8bgWU1jNO9YWQ7CdZmzq7", + "name": "1 point = $0.01", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 0.01, + "points_ratio": 1 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T16:45:21.582Z", + "updated_at": null, + "metadata": { + "Type": "0.01" + }, + "object": "reward" + }, + { + "id": "rew_x6FmF1KFdDs06hYPr9lK6ajf", + "name": "Material Reward", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619" + } + }, + "stock": "4", + "redeemed": "1", + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_wJHdZUAVSpWtYM6ORq4up3I2.png", + "description": "Get a Comic Book in Archie's series." + }, + "created_at": "2022-08-17T07:13:32.781Z", + "updated_at": null, + "metadata": { + "Type": "Personal" + }, + "object": "reward" } - } + ], + "total": 5 } } } } } - }, - "/v1/promotions/tiers/{promotionTierId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "promo_2EnAik6Jt7dKTOMkRTIgEjZH" + } + } + }, + "post": { + "operationId": "create-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Create Reward", + "description": "Create a new reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define parameters of the new reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_create_reward" + }, + "examples": { + "Gift card credits": { + "value": { + "name": "Digital - Gift Card Reward", + "type": "CAMPAIGN", + "metadata": { + "Type": "Gift" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 3000 + } + } + } }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "get": { - "operationId": "get-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Get Promotion Tier", - "description": "This method enables you to retrieve a specific promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a promotion tier object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" + "Discount Coupon": { + "value": { + "name": "Digital - Discount Coupon", + "type": "CAMPAIGN", + "metadata": { + "Type": "Discount" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1" } } } - } - } - }, - "put": { - "operationId": "update-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Update Promotion Tier", - "description": "This method updates a promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the promotion tier parameters that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_update_promotion_tier" + }, + "Loyalty Points": { + "value": { + "name": "Digital - Loyalty Points Reward", + "type": "CAMPAIGN", + "metadata": { + "Type": "Loyalty Points" }, - "examples": { - "Example": { - "value": { - "name": "Order more than $100 USD", - "banner": "Order more than $100 USD", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 25, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A-21" - }, - "hierarchy": 1, - "start_date": "2022-09-22T00:00:00.000Z", - "expiration_date": "2022-09-29T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3 - ] - } + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 100 } } } - } - }, - "responses": { - "200": { - "description": "Returns a promotion tier object if the update was successful.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - }, - "examples": { - "Example": { - "value": { - "id": "promo_hINAfBAVhmFuSAzi3vptfyxW", - "created_at": "2022-09-22T12:40:23.286Z", - "updated_at": "2022-09-22T12:40:58.626Z", - "name": "Order more than $100 USD", - "banner": "Order more than $100 USD", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 25, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": { - "level": "A-21" - }, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": false, - "start_date": "2022-09-22T00:00:00.000Z", - "expiration_date": "2022-09-29T00:00:00.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3 - ], - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_8e3e53ZgDNcoRGAI", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW", - "related_object_type": "promotion_tier", - "created_at": "2022-09-22T12:40:23.286Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } - } + }, + "Pay with Points": { + "value": { + "name": "Pay with Points Reward", + "type": "COIN", + "metadata": { + "Type": "Coin" + }, + "parameters": { + "coin": { + "exchange_ratio": 900, + "points_ratio": 8000 + } + } + } + }, + "Material Reward": { + "value": { + "name": "Get a Comic Book", + "metadata": { + "Type": "Material" + }, + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" } + }, + "stock": 2, + "attributes": { + "image_url": "https://www.website.com/img_fPHsk9Ob.png", + "description": "Archie's Series" } } } } - }, - "delete": { - "operationId": "delete-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Delete Promotion Tier", - "description": "This method deletes a promotion tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the promotion tier with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_2EnAik6Jt7dKTOMkRTIgEjZ", - "request_id": "v-0ae284707e9027a79d", - "resource_id": "promo_2EnAik6Jt7dKTOMkRTIgEjZ", - "resource_type": "promotion_tier" - } + } + } + }, + "responses": { + "200": { + "description": "Returns a reward object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_object" + }, + "examples": { + "Material": { + "value": { + "id": "rew_Crmu3hu2FKZWZIML59AeAs1n", + "name": "Material Reward", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" } - } + }, + "stock": "2", + "redeemed": null, + "attributes": { + "image_url": "https://www.website.com/img_fPH9oOb.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-25T11:20:58.172Z", + "updated_at": null, + "metadata": { + "Type": "Material" + }, + "object": "reward" } } } } } + } + } + } + }, + "/v1/rewards/{rewardId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "rew_2erjvECLs92GYzKbak3QkyTV" }, - "/v1/promotions/tiers/{promotionTierId}/enable": { - "parameters": [ - { + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + } + ], + "get": { + "operationId": "get-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Get Reward", + "description": "Retrieve a reward by the reward ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a reward object if a valid identifier was provided. ", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" - }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." + "$ref": "#/components/schemas/4_obj_reward_object" + } } - ], - "post": { - "operationId": "enable-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Enable Promotion Tier", - "description": "This method enables a promotion tier, i.e. makes the `active` parameter = `true`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + }, + "404": { + "description": "Not Found. When requesting a reward that has been deleted or does not exist, the resource will not be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkG", + "request_id": "v-0b8c77bcc890215e35", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkG", + "resource_type": "reward" + } + } } - ], - "responses": { - "200": { - "description": "Returns the promotion tier object with an updated `active` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - }, - "examples": { - "Example": { - "value": { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "updated_at": "2022-09-22T10:32:07.712Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 2 - }, - "orders": { - "total_amount": 37650, - "total_discount_amount": 6000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - } - } + } + } + } + } + }, + "put": { + "operationId": "update-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Update Reward", + "description": "Update the details of a reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define the parameters to be updated for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_update_reward" + }, + "examples": { + "Gift card credits": { + "value": { + "name": "Digital - Gift Card Reward", + "metadata": { + "Type": "Gift" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 3000 } } } }, - "404": { - "description": "Returns an error if the promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", - "request_id": "v-0bbaea52be14cc9782", - "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", - "resource_type": "promotion_tier" - } - } + "Discount Coupon": { + "value": { + "name": "Digital - Discount Coupon", + "metadata": { + "Type": "Discount" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + } + }, + "Loyalty points": { + "value": { + "name": "Digital - Loyalty Points Reward", + "metadata": { + "Type": "Loyalty Points" + }, + "parameters": { + "campaign": { + "id": "camp_hC2GdqYtOmTT45zfhib62cK1", + "balance": 100 + } + } + } + }, + "Pay with Points": { + "value": { + "name": "Pay with Points Reward", + "metadata": { + "Type": "Coin" + }, + "parameters": { + "coin": { + "exchange_ratio": 900, + "points_ratio": 8000 + } + } + } + }, + "Material Reward": { + "value": { + "name": "Get a Comic Book", + "metadata": { + "Type": "Physical product" + }, + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" } + }, + "stock": 2, + "attributes": { + "image_url": "https://www.website.com/img_fPH9.png", + "description": "Comic book" } } } } } - }, - "/v1/promotions/tiers/{promotionTierId}/disable": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns an updated reward object.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "promo_NzjTc3ZXTe7md5SziK3uYtei" + "$ref": "#/components/schemas/4_obj_reward_object" }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "post": { - "operationId": "disable-promotion-tier", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Disable Promotion Tier", - "description": "This method disables a promotion tier, i.e. makes the `active` parameter = `false`.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns the promotion tier object with an updated `active` parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_tier_object" - }, - "examples": { - "Example": { - "value": { - "id": "promo_NzjTc3ZXTe7md5SziK3uYtei", - "created_at": "2022-09-21T11:38:34.962Z", - "updated_at": "2022-09-22T10:34:09.529Z", - "name": "Order more than $100", - "banner": "Order more than $100", - "action": { - "discount": { - "type": "AMOUNT", - "amount_off": 3000, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 1, - "campaign": { - "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq", - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": false, - "start_date": "2022-09-21T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 2 - }, - "orders": { - "total_amount": 37650, - "total_discount_amount": 6000 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null - } + "examples": { + "Material": { + "value": { + "id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "name": "Get a Comic Book", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" } - } + }, + "stock": "2", + "redeemed": null, + "attributes": { + "image_url": "https://www.website.com/img_fPH9.png", + "description": "Comic book" + }, + "created_at": "2022-08-25T10:00:12.794Z", + "updated_at": "2022-08-25T10:06:30.655Z", + "metadata": { + "Type": "Physical product" + }, + "object": "reward" } } + } + } + } + }, + "400": { + "description": "Returns an error if the balance parameter is not defined correctly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_balance" }, - "404": { - "description": "Returns an error if the promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_NzjTc3ZXTe7md5SziK3uYte", - "request_id": "v-0bbaea52be14cc9782", - "resource_id": "promo_NzjTc3ZXTe7md5SziK3uYte", - "resource_type": "promotion_tier" - } - } - } + "examples": { + "Invalid Balance": { + "value": { + "code": 400, + "key": "invalid_balance", + "message": "Property 'parameters.campaign.balance' is invalid", + "details": "Property 'parameters.campaign.balance' must be greater than zero for campaign type: GIFT_VOUCHERS", + "request_id": "v-0b96d2b90dce48855f" } } } } } + } + } + }, + "delete": { + "operationId": "delete-reward", + "tags": [ + "REWARDS API" + ], + "summary": "Delete Reward", + "description": "Delete a reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/promotions/stacks": { - "get": { - "operationId": "list-all-promotion-stacks", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Stacks", - "description": "This method enables you to list promotion stacks irrespective of the campaign they are associated with. \n\nYou can use filters in the query parameters to specify the stacks to be returned in the response.\n\n## Advanced filters for fetching promotion stacks\n\n| **Filters** | **Examples** |\n| :--- | :--- |\n| Created Before | - `[created_at][before]=2021-12-30T13:52:18.227Z`
                  - `[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Created After | - `[created_at][after]=2021-12-30T13:52:18.227Z`
                  - `[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |\n| Updated Before | - `[updated_at][before]=2021-12-30T13:52:18.227Z`
                  - `[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z` |\n| Updated After | - `[updated_at][after]=2021-12-30T13:52:18.227Z`
                  - `[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z` |", - "parameters": [ - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100 items." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Which page of results to return.", - "name": "page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "name", - "-name" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a `data` property that contains an array of promotion stacks across all your campaigns.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "stack_SLuhQrAt3mXwHg776lYkzZO8", - "name": "Stack 2", - "created_at": "2022-11-03T10:18:58.356Z", - "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Mfww2TuoeU23enqSmnz0f3rh", - "promo_vU5IHaLKS7mmZ3ylABET6ikb", - "promo_TeHA11JlfN29mUftDcpqIWWq", - "promo_bhKBsIX3tO7yqmpTLCLLuaud" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_twQWp1TyaxX5RlSqn061xGVy", - "name": "First stack", - "created_at": "2021-12-27T11:59:21.838Z", - "updated_at": "2022-12-16T08:22:51.970Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga", - "promo_Mwy9XpA0TLctSGriM5kum0qp" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_vhCqN5PY7rmPw8yACRvHRZaz", - "name": "Second stack", - "created_at": "2021-12-27T11:55:47.431Z", - "updated_at": "2022-12-16T08:22:52.221Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga", - "promo_Mwy9XpA0TLctSGriM5kum0qp" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_zwChew7GY1AnDZJQ6GVP2sdT", - "name": "Third stack", - "created_at": "2021-12-27T11:54:26.283Z", - "updated_at": "2022-12-16T08:22:52.483Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_NS5hEUznL9XPa89rbrOZYMey", - "name": "Fourth stack", - "created_at": "2021-12-27T11:48:43.982Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_Rz0NvFtCZOObS3J5R68KET17", - "name": "Third stack", - "created_at": "2021-12-27T11:40:57.426Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_e8pH0nIuANmYRPE0x8hwDrpm", - "name": "Second stack", - "created_at": "2021-12-27T08:43:13.875Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Mwy9XpA0TLctSGriM5kum0qp", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_3Q4EJpZqg3DI5IRwgBYfsb37", - "name": "First stack", - "created_at": "2021-12-27T08:43:13.498Z", - "campaign_id": "camp_HXsR22VUMC4hN4DR7eAhCalp", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_Vet0vCNyyo5pOddHfu2X3FCB", - "promo_PoIyRVFA5c0Jk514xCpzKHga" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_KxSD0GahLUg9ULB6TseGfUHJ", - "name": "Stack 1", - "created_at": "2021-12-23T12:28:38.881Z", - "campaign_id": "camp_h8RyP6FV94F3Ev2odP24j5p1", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_NMex647s5UushvbBUJmYT2Fc", - "promo_4TqHr24boFISDrcOHSlfAxwm" - ], - "hierarchy_mode": "MANUAL" - } - } - ], - "total": 9 - } - } - } + "400": { + "description": "Bad Request. Returns an error indicating that the reward with given ID is assigned to a resource.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_resource_in_use" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "resource_in_use", + "message": "Resource in use", + "details": "Resource reward with id rew_fcYALROsORec6cP0VBItCVfq is in use by reward_assignments with ids [rewa_5WV7H3y2lT3GGl03Xjw29IEc]", + "request_id": "v-0b8c7b967950216291", + "related_object_ids": [ + "rewa_5WV7H3y2lT3GGl03Xjw29IEc" + ], + "related_object_type": "reward_assignment" } } } } } }, - "/v1/promotions/{campaignId}/stacks": { - "parameters": [ - { + "404": { + "description": "Returns an error indicating that the reward with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - } - ], - "get": { - "operationId": "list-promotion-stacks-in-campaign", - "tags": [ - "PROMOTIONS API" - ], - "summary": "List Promotion Stacks in Campaign", - "description": "This method enables you to list promotion stacks from a specified campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", + "request_id": "v-0ae29895e8c6b7781a", + "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", + "resource_type": "reward" + } + } } - ], - "responses": { - "200": { - "description": "Returns a list of promotion stack objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_res_list_promotion_stacks" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "stack_p0WhtyyDU95crobleMpRabhH", - "name": "First stack", - "created_at": "2022-09-22T13:03:25.740Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_dJNhAEeV5sR5oPQq1UrUdnMC", - "promo_aaAF8mVAzA0PF1igia2OC63d" - ], - "hierarchy_mode": "MANUAL" - } - }, - { - "id": "stack_XAzn8AFR3Ks3DBPLAQxV7zHe", - "name": "Second stack", - "created_at": "2022-09-22T13:03:25.903Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" - } - } - ], - "total": 2 - } + } + } + } + } + } + }, + "/v1/rewards/{rewardId}/assignments": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + } + ], + "get": { + "operationId": "list-reward-assignments", + "tags": [ + "REWARDS API" + ], + "summary": "List Reward Assignments", + "description": "Retrieve reward assignments by the reward ID.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_wciTvaOfYmAa3EmIIW3QpXXZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 15 + } + }, + "created_at": "2022-08-17T08:13:02.507Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 20 + } + }, + "created_at": "2022-08-24T11:40:22.418Z", + "updated_at": null, + "object": "reward_assignment" } - } + ], + "total": 2 } } } } - }, - "post": { - "operationId": "create-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Create Promotion Stack", - "description": "This method creates one promotion stack. The sequence of promotion tier IDs will determine the promotion stacking order.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the order of promotion tiers for the promotion stack.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" - }, - "examples": { - "Example": { - "value": { - "name": "Fifth Stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" - } - } - } + } + }, + "404": { + "description": "Returns an error if the given reward is missing, does not exist or was deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "request_id": "v-0b95a68c678ad5c765", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "resource_type": "reward" } } } + } + } + } + } + }, + "post": { + "operationId": "create-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Create Reward Assignment", + "description": "Assigns a reward to a specified loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_create_reward_assignment" }, - "responses": { - "200": { - "description": "Returns a new stack object if a valid promotion campaign identifier was provided in the path and available promotion IDs in the payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", - "name": "Fifth Stack", - "created_at": "2022-09-23T07:44:53.888Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE", - "promo_dJNhAEeV5sR5oPQq1UrUdnMC" - ], - "hierarchy_mode": "MANUAL" - } - } - } + "examples": { + "Example": { + "value": { + "campaign": "camp_OTuGGP90PivbvROsRvfM65El", + "parameters": { + "loyalty": { + "points": 39 } } } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" }, - "404": { - "description": "Returns an error if the campaign or promotion tier cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", - "request_id": "v-0bbc10de5886137afd", - "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", - "resource_type": "campaign" - } - }, - "Promotion Tier Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_tier with id promo_dJNhAEeV5sR5oPQq1UrUdnM", - "request_id": "v-0bbc11186303fa288a", - "resource_id": "promo_dJNhAEeV5sR5oPQq1UrUdnM", - "resource_type": "promotion_tier" - } + "examples": { + "Example": { + "value": { + "id": "rewa_cqD2XE5x8LcD2c1FLlvqikti", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_OTuGGP90PivbvROsRvfM65El", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 39 } - } + }, + "created_at": "2022-08-24T13:44:42.610Z", + "updated_at": null, + "object": "reward_assignment" } } } } } }, - "/v1/promotions/{campaignId}/stacks/{stackId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_BcHeMm4QaKjqCWMQFecMp1U0" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "ID of the promotion campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty Campaign`. " - }, - { + "400": { + "description": "Returns an error if request body parameters are missing.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "stack_KOIde7AUf08at12lZ1r3OfFL" + "$ref": "#/components/schemas/e_400_missing_param" }, - "name": "stackId", - "in": "path", - "required": true, - "description": "Promotion stack ID." - } - ], - "get": { - "operationId": "get-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Get Promotion Stack", - "description": "This method returns the details of a promotion stack, including the promotion tiers grouped within the stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Missing Parameter": { + "value": { + "code": 400, + "key": "missing_param", + "message": "Missing required parameter", + "details": "Parameter 'parameters.loyalty' is required", + "request_id": "v-0b95c7f3684ad5f06d" + } + } } - ], - "responses": { - "200": { - "description": "Returns a stack object if valid identifiers were provided in the path.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_p0WhtyyDU95crobleMpRabhH", - "name": "First stack", - "created_at": "2022-09-22T13:03:25.740Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_dJNhAEeV5sR5oPQq1UrUdnMC", - "promo_aaAF8mVAzA0PF1igia2OC63d" - ], - "hierarchy_mode": "MANUAL" - } - } - } - } + } + } + }, + "404": { + "description": "Returns an error when creating a reward assignment for a reward that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "request_id": "v-0b95c0bedf46fcbe83", + "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", + "resource_type": "reward" + } + }, + "Missing Campaign": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id null", + "request_id": "v-0b95c68b12cad5eebb", + "resource_id": null, + "resource_type": "campaign" } } + } + } + } + }, + "409": { + "description": "Returns an error if a conflict is found, i.e. an assignment for the reward has already been created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" }, - "404": { - "description": "Returns an error if the campaign or promotion stack cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Stack Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_stack with id stack_p0WhtyyDU95crobleMpRabh", - "request_id": "v-0bbc0a659591f99d65", - "resource_id": "stack_p0WhtyyDU95crobleMpRabh", - "resource_type": "promotion_stack" - } - }, - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id camp_99HUWI53bVyLzPN1Fg5TBLW", - "request_id": "v-0bbc0aa77a0c8b78e8", - "resource_id": "camp_99HUWI53bVyLzPN1Fg5TBLW", - "resource_type": "campaign" - } - } - } + "examples": { + "Duplicate Found": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated reward_assignment exists with id rewa_q1Ad955TUZS4nVIxplOw9pL3", + "request_id": "v-0b95c78daa06fcc6bb", + "resource_id": "rewa_q1Ad955TUZS4nVIxplOw9pL3", + "resource_type": "reward_assignment" } } } } - }, - "put": { - "operationId": "update-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Update Promotion Stack", - "description": "This methods allows for editing an existing stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the promotion stack parameters that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_req_create_promotion_stack" - }, - "examples": { - "Example": { - "value": { - "name": "Fifth Stack Modified", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE" - ], - "hierarchy_mode": "MANUAL" - } - } + } + } + } + } + }, + "/v1/rewards/{rewardId}/assignments/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "rew_2erjvECLs92GYzKbak3QkyTV" + }, + "name": "rewardId", + "in": "path", + "required": true, + "description": "A unique reward ID." + }, + { + "schema": { + "type": "string", + "example": "rewa_YkwQ5ezNYTQV2geodMVhTpy4" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique reward assignment ID." + } + ], + "put": { + "operationId": "update-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Update Reward Assignment", + "description": "Update the number of points needed to successfully redeem the reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define the number of points required to exchange for the reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_req_update_reward_assignment" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "loyalty": { + "points": 35 } } } } - }, - "responses": { - "200": { - "description": "Returns a promotion stack with updated parameters if the update was successful.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/3_obj_promotion_stack_object" - }, - "examples": { - "Example": { - "value": { - "id": "stack_q2AmzFvOMCmg4Wdu5bDBlME6", - "name": "Fifth Stack Modified", - "created_at": "2022-09-23T07:44:53.888Z", - "updated_at": "2022-09-23T07:59:44.172Z", - "campaign_id": "camp_99HUWI53bVyLzPN1Fg5TBLWX", - "object": "promotion_stack", - "tiers": { - "ids": [ - "promo_aaAF8mVAzA0PF1igia2OC63d", - "promo_t9zdL6XMFk7B8fQ23zxELtdE" - ], - "hierarchy_mode": "MANUAL" - } - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the updated reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 35 } - } + }, + "created_at": "2022-08-24T11:40:22.418Z", + "updated_at": "2022-08-24T13:02:32.262Z", + "object": "reward_assignment" } } } } - }, - "delete": { - "operationId": "delete-promotion-stack", - "tags": [ - "PROMOTIONS API" - ], - "summary": "Delete Promotion Stack", - "description": "This method deletes a promotion stack.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the stack or campaign with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Stack Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find promotion_stack with id stack_KOIde7AUf08at12lZ1r3OfFp", - "request_id": "v-0ae289ca779027b030", - "resource_id": "stack_KOIde7AUf08at12lZ1r3OfFp", - "resource_type": "promotion_stack" - } - }, - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer % Promotion", - "request_id": "v-0ae28a621c46af534b", - "resource_id": "Summer % Promotion", - "resource_type": "campaign" - } - } - } + } + }, + "404": { + "description": "Returns an error indicating that the reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76XI", + "request_id": "v-0b95b8760a4ad5dda1", + "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76XI", + "resource_type": "reward_assignment" } } } } } + } + } + }, + "delete": { + "operationId": "delete-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Delete Reward Assignment", + "description": "This method deletes a reward assignment for a particular reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/reward-object": { - "get": { - "operationId": "reward-object", - "tags": [ - "REWARDS API" - ], - "summary": "Reward Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Reward object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" - } + "404": { + "description": "Returns an error indicating that the reward or reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", + "request_id": "v-0ae29f325e1027cde8", + "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", + "resource_type": "reward" + } + }, + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_YkwQ5ezNYTQV2geodMVhTpy", + "request_id": "v-0ae2a0588b9027cf95", + "resource_id": "rewa_YkwQ5ezNYTQV2geodMVhTpy", + "resource_type": "reward_assignment" } } } } } + } + } + }, + "get": { + "operationId": "get-reward-assignment", + "tags": [ + "REWARDS API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve a reward assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a reward assignment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + } + } + } }, - "/v1/reward-assignment-object": { - "get": { - "operationId": "reward-assignment-object", - "tags": [ - "REWARDS API" - ], - "summary": "Reward Assignment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Reward Assignment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } + "404": { + "description": "Returns an error indicating that the reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76X", + "request_id": "v-0b95b596e98ad5da24", + "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "resource_type": "reward_assignment" } } } } } + } + } + } + }, + "/v1/publication-object": { + "get": { + "operationId": "publication-object", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Publication Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Publication Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_obj_publication_object" + } + } + } + } + } + } + }, + "/v1/publications/create": { + "get": { + "operationId": "create-publication-1", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Create Publication", + "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet.\n> ❗️ Limited access\n>\n> Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a [dedicated endpoint](ref:create-publication). \n\n\n> 📘 Specifying the voucher to be published\n>\n> - In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign and in the query parameters specify the `campaign` without specifying the voucher.\n> - If you would like to publish a specific code from a specific campaign, then you need to provide the `campaign` and the `voucher` parameters.\n> - If you would like to publish a standalone voucher, then omit the campaign parameter and simply provide the `voucher` parameter. \n\n## Example Request \n```markdown Publication Query \n/publications/create?campaign=camp_T0bUgWGCAV6S0X3smH4MEboG&metadata[year]=2&metadata[Date]=2023-03-03&metadata[DateTime]=2023-03-03T14:06:08.311Z&metadata[Flag]=true&metadata[Number]=222&metadata[String]=stringy&metadata[ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&metadata[Object][payment][payment_tax]=9&metadata[Object][payment][payment_method]=Visa&metadata[Object][payment][payment_date]=2023-03-03&metadata[Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&metadata[Object][payment][payment_completed]=true&metadata[Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[source_id]=try-new-12&customer[name]=John%20Jimmy&customer[description]=This is testing the publication endpoint.&customer[email]=johnjimy2%40email.com&customer[phone]=%2B48%20123%20333%20333&customer[address][city]=Warsaw&customer[address][state]=Mazowieckie&customer[address][line_1]=4499%20Main%20St.&customer[address][line_2]=Blg%202%20APT%204&customer[address][country]=Poland&customer[address][postal_code]=122333&customer[birthday]=2222-01-22&customer[metadata][paid_bill]=true&customer[metadata][age]=22&customer[metadata][location]=Poland&customer[metadata][acquisition_date]=2022-09-09&customer[metadata][birth_date]=2023-03-20T18:44:19.215Z&customer[metadata][ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][location-unknown][city]=Katowice&customer[metadata][location-unknown][state]=slask&customer[metadata][location-unknown][number]=2&customer[metadata][location-unknown][date]=2034-09-11&customer[metadata][location-unknown][dateTime]=2023-03-20T18:44:19.215Z&customer[metadata][Object][payment][payment_date]=2023-03-03&customer[metadata][Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&customer[metadata][Object][payment][payment_completed]=true&customer[metadata][Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][Object][payment][payment_tax]=9&customer[metadata][Object][payment][payment_method]=Visa```", + "parameters": [ + { + "schema": { + "type": "string", + "example": "custom_publication_source_id" + }, + "in": "query", + "name": "source_id", + "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." }, - "/v1/rewards": { - "get": { - "operationId": "list-rewards", - "tags": [ - "REWARDS API" - ], - "summary": "List Rewards", - "description": "Retrieve rewards.", - "parameters": [ + { + "schema": { + "type": "string", + "example": "PROMO-1LwwzYI" + }, + "in": "query", + "name": "voucher", + "description": "Code of voucher being published. If there is a particular code that you would like to publish, then you can use this parameter to specify the code. You can omit this parameter if you would like to publish a random code from a campaign, where the campaign is in `AUTO_UPDATE` mode." + }, + { + "name": "metadata", + "in": "query", + "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.", + "style": "deepObject", + "explode": true, + "schema": { + "type": "object" + } + }, + { + "name": "customer", + "in": "query", + "required": true, + "description": "Specify the customer who is to receive a code. You can either directly provide the respective ID's as strings or provide them in the form of an object.", + "style": "deepObject", + "explode": true, + "schema": { + "anyOf": [ { - "$ref": "#/components/parameters/limit" + "$ref": "#/components/schemas/5_req_create_publication_customer" }, { - "$ref": "#/components/parameters/page" + "$ref": "#/components/schemas/5_res_create_publication_customer_id" }, { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" - }, - "in": "query", - "name": "assignment_id", - "description": "A unique reward assignment ID. Use this parameter to get the reward details in the context of an assignment ID." - } - ], - "security": [ + "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" + }, { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of reward objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_res_list_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rew_3e7IqghVtTR7L3xQMSCxjFu2", - "name": "Get $10", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_FNYR4jhqZBM9xTptxDGgeNBV", - "balance": 1000, - "type": "GIFT_VOUCHERS" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-03-10T08:40:20.917Z", - "updated_at": "2022-08-17T07:52:56.965Z", - "metadata": null, - "object": "reward" - }, - { - "id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "name": "Get 100 Points", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "balance": 100, - "type": "LOYALTY_PROGRAM" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-02-28T11:56:13.764Z", - "updated_at": null, - "metadata": null, - "object": "reward" - }, - { - "id": "rew_BNZ3van6AF2AiquWp8Lfw0xq", - "name": "30% discount", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_ZtHLATYVpItqmuSqmaz1rZ2Y", - "type": "DISCOUNT_COUPONS" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T09:48:50.609Z", - "updated_at": null, - "metadata": {}, - "object": "reward" - }, - { - "id": "rew_nlV8bgWU1jNO9YWQ7CdZmzq7", - "name": "1 point = $0.01", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 0.01, - "points_ratio": 1 - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T16:45:21.582Z", - "updated_at": null, - "metadata": { - "Type": "0.01" - }, - "object": "reward" - }, - { - "id": "rew_x6FmF1KFdDs06hYPr9lK6ajf", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619" - } - }, - "stock": "4", - "redeemed": "1", - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_wJHdZUAVSpWtYM6ORq4up3I2.png", - "description": "Get a Comic Book in Archie's series." - }, - "created_at": "2022-08-17T07:13:32.781Z", - "updated_at": null, - "metadata": { - "Type": "Personal" - }, - "object": "reward" - } - ], - "total": 5 - } - } - } - } - } + "$ref": "#/components/schemas/9_req_create_customer" } - } - }, - "post": { - "operationId": "create-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Create Reward", - "description": "Create a new reward.", - "parameters": [], - "security": [ + ] + } + }, + { + "name": "campaign", + "in": "query", + "required": true, + "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. You can use this parameter without having to specify a particular `voucher` code if the campaign is in `AUTO_UPDATE` mode. This parameter not required for a standalone code, however, if you intend to use a code from a campaign, then this parameter is required.", + "style": "deepObject", + "explode": true, + "schema": { + "anyOf": [ { - "X-App-Id-1": [], - "X-App-Token-1": [] + "$ref": "#/components/schemas/5_req_create_publication_campaign" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_campaign_id" + }, + { + "$ref": "#/components/schemas/5_req_create_publication_campaign_name" } - ], - "requestBody": { - "description": "Define parameters of the new reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_create_reward" - }, - "examples": { - "Gift card credits": { - "value": { - "name": "Digital - Gift Card Reward", - "type": "CAMPAIGN", - "metadata": { - "Type": "Gift" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 3000 - } - } - } - }, - "Discount Coupon": { - "value": { - "name": "Digital - Discount Coupon", - "type": "CAMPAIGN", - "metadata": { - "Type": "Discount" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1" - } - } - } - }, - "Loyalty Points": { - "value": { - "name": "Digital - Loyalty Points Reward", - "type": "CAMPAIGN", - "metadata": { - "Type": "Loyalty Points" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 100 - } - } - } - }, - "Pay with Points": { - "value": { - "name": "Pay with Points Reward", - "type": "COIN", - "metadata": { - "Type": "Coin" + ] + } + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a publication object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_create_publication" + }, + "examples": { + "Example": { + "value": { + "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", + "object": "publication", + "created_at": "2022-09-30T16:30:32.924Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "pub_source_customer_5", + "metadata": { + "year": 2022 + }, + "channel": "myown", + "source_id": "publication_source_ID_10", + "result": "SUCCESS", + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "voucher": { + "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", + "code": "cEsMn0uA", + "campaign": "Test - Discount Effect - Amount - Items", + "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" }, - "parameters": { - "coin": { - "exchange_ratio": 900, - "points_ratio": 8000 - } + "barcode": { + "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-09-30T16:30:32.956Z", + "updated_at": null, + "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" + }, + "object": "voucher" }, - "Material Reward": { - "value": { - "name": "Get a Comic Book", - "metadata": { - "Type": "Material" - }, - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } - }, - "stock": 2, - "attributes": { - "image_url": "https://www.website.com/img_fPHsk9Ob.png", - "description": "Archie's Series" - } - } - } + "vouchers_id": [ + "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" + ] } } } - }, - "responses": { - "200": { - "description": "Returns a reward object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "examples": { - "Material": { - "value": { - "id": "rew_Crmu3hu2FKZWZIML59AeAs1n", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } - }, - "stock": "2", - "redeemed": null, - "attributes": { - "image_url": "https://www.website.com/img_fPH9oOb.png", - "description": "Archie's Series" - }, - "created_at": "2022-08-25T11:20:58.172Z", - "updated_at": null, - "metadata": { - "Type": "Material" - }, - "object": "reward" - } - } - } + } + } + }, + "400": { + "description": "Returns an error if the query parameters are incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Missing customer": { + "value": { + "code": 400, + "key": "invalid_query_params", + "message": "Invalid query params", + "details": "Query should have required property 'customer'", + "request_id": "v-0c8b6423f3c80ed3e4" + } + }, + "Missing vouchers": { + "value": { + "code": 400, + "key": "missing_vouchers", + "message": "Missing vouchers", + "details": "Either Campaign or Voucher is required" + } + }, + "Voucher cannot be published": { + "value": { + "code": 400, + "key": "voucher_cannot_be_published", + "message": "Voucher cannot be published", + "details": "Voucher cannot be published. Customer already joined program.", + "request_id": "v-0c8b763544080efed2" + } + }, + "Voucher already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_vM7vQZmgV86k0wuz05cFAOfarj4s8BQE' has already been published", + "request_id": "v-0c8baebc67c80e97a0" + } + }, + "Duplicate source ID": { + "value": { + "code": 400, + "key": "duplicate_source_id", + "message": "Duplicate source_id", + "details": "Publication with source_id: 'test_publication_source_id_test_voucher' already exists", + "request_id": "v-0c8b7e8f78c80e94a2" + } + }, + "Too many vouchers requested": { + "value": { + "code": 400, + "key": "too_many_vouchers_requested", + "message": "Too many vouchers requested", + "details": "Only up to 1 can be published", + "request_id": "v-0c8bac9a25c80e912d" + } + }, + "Metadata validation failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "ImageURL: must be a URL pointing to JPG/JPEG or PNG resource (actual value is 'http.com')", + "request_id": "v-0c8bcbd742080ee807" } } } } } }, - "/v1/rewards/{rewardId}": { - "parameters": [ - { + "403": { + "description": "Returns an error if you don't have a specific credentials set up. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "rew_2erjvECLs92GYzKbak3QkyTV" + "$ref": "#/components/schemas/e_integration_key" }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." - } - ], - "get": { - "operationId": "get-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Get Reward", - "description": "Retrieve a reward by the reward ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward object if a valid identifier was provided. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" - } + "examples": { + "Example": { + "value": { + "code": 403, + "message": "Forbidden", + "key": "integration_api_key_required" } } + } + } + } + }, + "404": { + "description": "Returns an error if a resource is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Not Found. When requesting a reward that has been deleted or does not exist, the resource will not be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkG", - "request_id": "v-0b8c77bcc890215e35", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkG", - "resource_type": "reward" - } - } - } + "examples": { + "Resource not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_xqA7DGj5eYPHg6PHVKwYRWiA", + "request_id": "v-0c8b6b35294af6f192", + "resource_id": "cust_xqA7DGj5eYPHg6PHVKwYRWiA", + "resource_type": "customer" } } } } + } + } + } + } + }, + "/v1/publications": { + "get": { + "operationId": "list-publications", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "List Publications", + "description": "Retrieve a list of publications. To return a **particular** publication, you can use the `source_id` query parameter and provide the `source_id` of the publication you are looking for specifically.\n\n## Pagination\n\n\n> 🚧 Important!\n>\n> If you want to scroll through a huge set of records, it is recommended to use the [Exports API](ref:create-export). This API will return an error `page_over_limit` if you reach a page above 1000.\n\n## Filter Query\n\nThe `filters` query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:\n\n\n```url\nfilters[][conditions][][]=\n```\n\n### Operators:\n\n\n```\n \"$in\"\n \"$not_in\"\n \"$is\"\n \"$is_not\"\n \"$has_value\"\n \"$is_unknown\"\n \"$contains\"\n \"$starts_with\"\n \"$ends_with\"\n \"$more_than\"\n \"$less_than\"\n \"$more_than_equal\"\n \"$less_than_equal\"\n```\n\n### Examples\n\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR\n```", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id", + "created_at", + "-created_at", + "channel", + "-channel" + ] }, - "put": { - "operationId": "update-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Update Reward", - "description": "Update the details of a reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define the parameters to be updated for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_update_reward" - }, - "examples": { - "Gift card credits": { - "value": { - "name": "Digital - Gift Card Reward", - "metadata": { - "Type": "Gift" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 3000 - } - } - } - }, - "Discount Coupon": { - "value": { - "name": "Digital - Discount Coupon", - "metadata": { - "Type": "Discount" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1" - } - } - } - }, - "Loyalty points": { - "value": { - "name": "Digital - Loyalty Points Reward", - "metadata": { - "Type": "Loyalty Points" - }, - "parameters": { - "campaign": { - "id": "camp_hC2GdqYtOmTT45zfhib62cK1", - "balance": 100 - } - } - } - }, - "Pay with Points": { - "value": { - "name": "Pay with Points Reward", + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign", + "description": "Filters by a given campaign name." + }, + { + "schema": { + "type": "string", + "example": "cust_jl33V8ZDQJp4goU1z8DmFioo" + }, + "in": "query", + "name": "customer", + "description": "Filters by a unique customer ID." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "voucher", + "description": "Filters by a given voucher code." + }, + { + "schema": { + "type": "string", + "enum": [ + "SUCCESS", + "FAILURE" + ] + }, + "in": "query", + "name": "result", + "description": "Filters by a publication result." + }, + { + "schema": { + "type": "string", + "enum": [ + "discount", + "loyalty", + "lucky_draw" + ] + }, + "in": "query", + "name": "voucher_type", + "description": "Filters by a voucher type." + }, + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "is_referral_code", + "description": "This filter works only for the `true` option. If set to `true`, the query returns only publications of codes from referral campaigns. " + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "filters", + "description": "Allows for combining the filters mentioned in the endpoint description." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "source_id", + "description": "Using this endpoint with a particular publication `source_id`, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of publications you’ve previously created with [create publication](ref:create-publication) or implicitly by the distribution manager. The publications are returned in sorted order, with the most recent ones appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_list_publications" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "publications", + "publications": [ + { + "id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu", + "object": "publication", + "created_at": "2022-09-28T13:31:23.522Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "cindy.jones@email.com", "metadata": { - "Type": "Coin" + "distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei", + "source_type": "distribution", + "source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei" }, - "parameters": { - "coin": { - "exchange_ratio": 900, - "points_ratio": 8000 - } - } - } - }, - "Material Reward": { - "value": { - "name": "Get a Comic Book", - "metadata": { - "Type": "Physical product" + "channel": "Automation", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Cindy Jones", + "email": "cindy.jones@email.com", + "source_id": "cindy.jones@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" }, - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } + "voucher": { + "code": "FNV5IrtY", + "object": "voucher", + "campaign": "Loyalty Campaign", + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "is_referral_code": false }, - "stock": 2, - "attributes": { - "image_url": "https://www.website.com/img_fPH9.png", - "description": "Comic book" - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an updated reward object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "examples": { - "Material": { - "value": { - "id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "name": "Get a Comic Book", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } + "vouchers_id": [ + "v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD" + ] + }, + { + "id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX", + "object": "publication", + "created_at": "2022-09-28T13:31:02.766Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "sandy.jones@email.com", + "metadata": {}, + "channel": "voucherify-website", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Sandy Jones", + "email": "sandy.jones@email.com", + "source_id": "sandy.jones@email.com", + "metadata": { + "acquisition_channel": "Facebook" }, - "stock": "2", - "redeemed": null, - "attributes": { - "image_url": "https://www.website.com/img_fPH9.png", - "description": "Comic book" + "object": "customer" + }, + "voucher": { + "code": "Voucher-1", + "object": "voucher", + "campaign": null, + "discount": { + "type": "AMOUNT", + "amount_off": 200, + "amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)", + "effect": "APPLY_TO_ORDER" }, - "created_at": "2022-08-25T10:00:12.794Z", - "updated_at": "2022-08-25T10:06:30.655Z", + "is_referral_code": false + }, + "vouchers_id": [ + "v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu" + ] + }, + { + "id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV", + "object": "publication", + "created_at": "2022-09-13T06:15:08.249Z", + "customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G", + "tracking_id": "1", + "metadata": {}, + "channel": "voucherify-website", + "source_id": null, + "result": "SUCCESS", + "customer": { + "id": "cust_ur1hIPGflbaAe14mLlLdon3G", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "1", "metadata": { - "Type": "Physical product" + "accepts_marketing": false }, - "object": "reward" - } + "object": "customer" + }, + "voucher": { + "code": "GIFT-WOZaK5YF1Fs87tAX", + "object": "voucher", + "campaign": "Gift Cards", + "gift": { + "amount": 0, + "balance": 0 + }, + "is_referral_code": false + }, + "vouchers_id": [ + "v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc" + ] } - } + ], + "total": 3 } } + } + } + } + }, + "400": { + "description": "Returns an error if you request a page higher than 1000.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "400": { - "description": "Returns an error if the balance parameter is not defined correctly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_balance" - }, - "examples": { - "Invalid Balance": { - "value": { - "code": 400, - "key": "invalid_balance", - "message": "Property 'parameters.campaign.balance' is invalid", - "details": "Property 'parameters.campaign.balance' must be greater than zero for campaign type: GIFT_VOUCHERS", - "request_id": "v-0b96d2b90dce48855f" - } - } - } + "examples": { + "Example": { + "value": { + "code": 400, + "key": "page_over_limit", + "message": "Listing resource above 1000 page is not supported", + "details": "Property .page cannot be higher than 1000", + "request_id": "v-0bc2a39574c61362af" } } } } + } + } + } + }, + "post": { + "operationId": "create-publication", + "tags": [ + "PUBLICATIONS API" + ], + "summary": "Create Publication", + "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.", + "parameters": [ + { + "schema": { + "type": "boolean" }, - "delete": { - "operationId": "delete-reward", - "tags": [ - "REWARDS API" - ], - "summary": "Delete Reward", - "description": "Delete a reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "400": { - "description": "Bad Request. Returns an error indicating that the reward with given ID is assigned to a resource.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_resource_in_use" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "resource_in_use", - "message": "Resource in use", - "details": "Resource reward with id rew_fcYALROsORec6cP0VBItCVfq is in use by reward_assignments with ids [rewa_5WV7H3y2lT3GGl03Xjw29IEc]", - "request_id": "v-0b8c7b967950216291", - "related_object_ids": [ - "rewa_5WV7H3y2lT3GGl03Xjw29IEc" - ], - "related_object_type": "reward_assignment" - } - } - } + "in": "query", + "name": "join_once", + "description": "Through this flag, you can control if a particular person gets only one and always the same code even if the app sends multiple publication requests. It means that if you have a referral program, a referrer is assigned only to one code if an integration sends publication requests more than once for the same customer." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the publication parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_req_create_publication" + }, + "examples": { + "Example - Specific Voucher": { + "value": { + "campaign": { + "name": "campaign-name" + }, + "customer": { + "source_id": "source-id", + "Name": "Customer Name", + "email": "customer email" + }, + "voucher": "voucher-code", + "metadata": { + "key": "value" + } + } + }, + "Example - Random Voucher": { + "value": { + "campaign": { + "name": "campaign-name", + "count": 1 + }, + "customer": { + "source_id": "source-id", + "Name": "Customer Name", + "email": "customer email" + }, + "voucher": "voucher-code", + "metadata": { + "key": "value" } } }, - "404": { - "description": "Returns an error indicating that the reward with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", - "request_id": "v-0ae29895e8c6b7781a", - "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", - "resource_type": "reward" + "Example 3": { + "value": { + "source_id": "publication_source_ID_10", + "campaign": "Test - Discount Effect - Amount - Items", + "channel": "myown", + "customer": { + "source_id": "pub_source_customer_5", + "name": "Bob Jones", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1901-12-01" + }, + "metadata": { + "year": 2022 + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a publication object if a valid identifier was provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/5_res_create_publication" + }, + "examples": { + "Example": { + "value": { + "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", + "object": "publication", + "created_at": "2022-09-30T16:30:32.924Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "pub_source_customer_5", + "metadata": { + "year": 2022 + }, + "channel": "myown", + "source_id": "publication_source_ID_10", + "result": "SUCCESS", + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "voucher": { + "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", + "code": "cEsMn0uA", + "campaign": "Test - Discount Effect - Amount - Items", + "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" } - } - } + }, + "is_referral_code": false, + "created_at": "2022-09-30T16:30:32.956Z", + "updated_at": null, + "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "redemption": { + "quantity": 1, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "vouchers_id": [ + "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" + ] } } } } } }, - "/v1/rewards/{rewardId}/assignments": { - "parameters": [ - { + "400": { + "description": "Returns an error if a publication with the same source ID already exists in the system or some request body parameter is missing.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." + "examples": { + "Missing Parameters": { + "value": { + "code": 400, + "key": "missing_vouchers", + "message": "Missing vouchers", + "details": "Either Campaign or Voucher is required" + } + }, + "Already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_Y5P4UZ1yilkiYOIJmAAgWazUi1wfkNwF' has already been published", + "request_id": "v-0bc40bb800d5651137" + } + }, + "Duplicate Source ID": { + "value": { + "code": 400, + "key": "duplicate_source_id", + "message": "Duplicate source_id", + "details": "Publication with source_id: 'publication_source_ID_1' already exists", + "request_id": "v-0bc40bf81555651191" + } + } + } } - ], - "get": { - "operationId": "list-reward-assignments", - "tags": [ - "REWARDS API" - ], - "summary": "List Reward Assignments", - "description": "Retrieve reward assignments by the reward ID.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" + } + }, + "404": { + "description": "Returns an error if a resource is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - { - "$ref": "#/components/parameters/page" + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id 1", + "request_id": "v-0bc40546e5d56508e5", + "resource_id": "1", + "resource_type": "campaign" + } + } } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/validation-object": { + "get": { + "operationId": "validation-object", + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validation Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Object", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher" + } + ] } - ], - "responses": { - "200": { - "description": "Returns a dictionary of reward assignment objects. Each object contains information regarding the resource to which the reward was assigned and the cost in loyalty points for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_PbIRoMXpwe5QhobW4JKu0VjH", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_wciTvaOfYmAa3EmIIW3QpXXZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 15 - } - }, - "created_at": "2022-08-17T08:13:02.507Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 20 - } - }, - "created_at": "2022-08-24T11:40:22.418Z", - "updated_at": null, - "object": "reward_assignment" - } - ], - "total": 2 - } + } + } + } + } + } + }, + "/v1/vouchers/{code}/validate": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "Testing7fjWdr" + }, + "name": "code", + "in": "path", + "required": true, + "description": "A code that identifies the voucher." + } + ], + "post": { + "operationId": "validate-voucher", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Voucher [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys. \n\n\n> ❗️ Important \n>\n> This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](ref:stackable-discounts-api). The stacking discounts API lets you validate up to 5 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.\n\n#### Gift Vouchers - validate Gift Card and control amount to redeem\nVoucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition. \n\nThis operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.\n\nIf a validation session is established, then the session details will be returned as well. Read more about sessions [here](doc:locking-validation-session).\n\nVoucher validation might fail because of one of these reasons:\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of start date - expiration date time frame\n* `voucher is disabled` - learn more about a [disabled voucher](ref:disable-voucher)\n* `customer does not match segment rules` - learn more [customer tracking](doc:customers#customer-tracking) \n* `order does not match validation rules` - learn more about [validation rules](doc:validation-rules)", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the voucher validation context using the request body parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_voucher" + }, + "examples": { + "Free Shipping": { + "value": { + "customer": { + "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M" + }, + "order": { + "items": [ + { + "product_id": "prod_0ba621bae5d39762ce", + "quantity": "1" + }, + { + "product_id": "prod_0b661d404787ec6d3b", + "quantity": "1", + "price": 3100 } - } + ] } } }, - "404": { - "description": "Returns an error if the given reward is missing, does not exist or was deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "request_id": "v-0b95a68c678ad5c765", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "resource_type": "reward" - } - } - } + "Multiple Product Variants": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" + }, + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP" } } - } - } - }, - "post": { - "operationId": "create-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Create Reward Assignment", - "description": "Assigns a reward to a specified loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the campaign ID of the campaign to which the reward is to be assigned and define the cost of the reward in terms of loyalty points.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_create_reward_assignment" + }, + "Unit - Add order items": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" }, - "examples": { - "Example": { - "value": { - "campaign": "camp_OTuGGP90PivbvROsRvfM65El", - "parameters": { - "loyalty": { - "points": 39 - } - } + "order": { + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8" + }, + "session": { + "type": "LOCK", + "ttl_unit": "NANOSECONDS", + "ttl": 1 + } + } + }, + "Fixed": { + "value": { + "customer": { + "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" } - } + ] + }, + "session": { + "type": "LOCK" } } - } - }, - "responses": { - "200": { - "description": "Returns a reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "Percentage": { + "value": { + "customer": { + "source_id": "your_customer_source_ID", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" }, - "examples": { - "Example": { - "value": { - "id": "rewa_cqD2XE5x8LcD2c1FLlvqikti", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_OTuGGP90PivbvROsRvfM65El", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 39 - } - }, - "created_at": "2022-08-24T13:44:42.610Z", - "updated_at": null, - "object": "reward_assignment" - } + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1960-12-01" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" } - } + ] + }, + "session": { + "type": "LOCK", + "key": "your_custom_key", + "ttl_unit": "NANOSECONDS", + "ttl": 1 } } }, - "400": { - "description": "Returns an error if request body parameters are missing.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_missing_param" + "Amount": { + "value": { + "customer": { + "source_id": "your_customer_source_ID", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "postal_code": "10001", + "state": "NY" }, - "examples": { - "Missing Parameter": { - "value": { - "code": 400, - "key": "missing_param", - "message": "Missing required parameter", - "details": "Parameter 'parameters.loyalty' is required", - "request_id": "v-0b95c7f3684ad5f06d" - } + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "1960-12-01" + }, + "order": { + "items": [ + { + "source_id": "webinar_BF_sweater_pink_sweater", + "quantity": "1", + "price": 6500, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_navy_sweat_pants", + "quantity": "1", + "price": 6000, + "related_object": "product" + }, + { + "source_id": "5h1pp1ng", + "quantity": "1", + "price": 2000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_pants_gray_sweat_pants", + "quantity": "2", + "price": 5000, + "related_object": "product" + }, + { + "source_id": "webinar_BF_sweater_pearl", + "quantity": "2", + "price": 11000, + "related_object": "product" } + ], + "metadata": { + "currency": "EUR" } + }, + "session": { + "type": "LOCK", + "key": "your_custom_key", + "ttl_unit": "NANOSECONDS", + "ttl": 1 } } }, - "404": { - "description": "Returns an error when creating a reward assignment for a reward that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "request_id": "v-0b95c0bedf46fcbe83", - "resource_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGYi", - "resource_type": "reward" - } + "Loyalty Card": { + "value": { + "order": { + "items": [ + { + "product_id": "prod_0bd76fc58f8038b043", + "quantity": "1" }, - "Missing Campaign": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id null", - "request_id": "v-0b95c68b12cad5eebb", - "resource_id": null, - "resource_type": "campaign" - } + { + "product_id": "prod_0bd76bd0e204542738", + "quantity": "1" } + ] + }, + "reward": { + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "points": 10 + } + } + }, + "Gift Card": { + "value": { + "customer": { + "source_id": "286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d" + }, + "order": { + "amount": 1000, + "metadata": { + "currency": "USD" } + }, + "gift": { + "credits": 2 + }, + "metadata": { + "location_id": [ + "L1" + ] } } }, - "409": { - "description": "Returns an error if a conflict is found, i.e. an assignment for the reward has already been created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate Found": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated reward_assignment exists with id rewa_q1Ad955TUZS4nVIxplOw9pL3", - "request_id": "v-0b95c78daa06fcc6bb", - "resource_id": "rewa_q1Ad955TUZS4nVIxplOw9pL3", - "resource_type": "reward_assignment" - } - } + "Referral Code": { + "value": { + "customer": { + "source_id": "earlybirdcust" + }, + "order": { + "amount": 20000, + "metadata": { + "currency": "USD" } + }, + "metadata": { + "location_id": [ + "L1" + ] } } } } } - }, - "/v1/rewards/{rewardId}/assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "rew_2erjvECLs92GYzKbak3QkyTV" - }, - "name": "rewardId", - "in": "path", - "required": true, - "description": "A unique reward ID." - }, - { + } + }, + "responses": { + "200": { + "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the request body.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "rewa_YkwQ5ezNYTQV2geodMVhTpy4" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique reward assignment ID." - } - ], - "put": { - "operationId": "update-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Update Reward Assignment", - "description": "Update the number of points needed to successfully redeem the reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define the number of points required to exchange for the reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_req_update_reward_assignment" + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher" }, - "examples": { - "Example": { - "value": { - "parameters": { - "loyalty": { - "points": 35 + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" + } + ] + }, + "examples": { + "False": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Gift Card cannot be redeemed because of violated validation rules: val_wvipKm99CJuL", + "request_id": "v-0bccef7a9585cf63b6" + }, + "tracking_id": "track_ZGPtmYcM+Mw=", + "code": "vBQvYFEM", + "metadata": {} + } + }, + "Free Shipping": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "order": { + "amount": 4300, + "total_amount": 4300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0ba621bae5d39762ce", + "quantity": 1, + "amount": 1200, + "price": 1200, + "subtotal_amount": 1200, + "product": { + "id": "prod_0ba621bae5d39762ce", + "source_id": "arabica_plus", + "name": "Arabica Coffee 250g", + "price": 1200 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d404787ec6d3b", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0b661d404787ec6d3b", + "source_id": "7717f389-4621-4c7a-a6db-d4acfe051a97", + "name": "Kate Moss by Mario Testino" + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" } } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "Test - Discount - Free Shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" } - } + }, + "metadata": {} } - } - } - }, - "responses": { - "200": { - "description": "Returns the updated reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "Multiple Product Varients": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", + "created_at": "2022-09-21T13:09:25.773Z", + "updated_at": "2022-09-21T13:09:27.139Z", + "status": "PAID", + "amount": 237300, + "initial_amount": 28000, + "discount_amount": 8400, + "items_discount_amount": 209300, + "total_discount_amount": 217700, + "total_amount": 19600, + "items_applied_discount_amount": 209300, + "total_applied_discount_amount": 209300, + "items": [ + { + "object": "order_item", + "source_id": "A0E20000000295J", + "related_object": "sku", + "product_id": "prod_0b661d31134b299cc2", + "quantity": 1, + "amount": 9500, + "price": 9500, + "subtotal_amount": 9500, + "product": { + "id": "prod_0b661d31134b299cc2", + "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", + "name": "Keychain D‘Amico" + }, + "sku": { + "id": "sku_0b661d6265cb29ae52", + "source_id": "A0E20000000295J", + "sku": "Keychain D‘Amico", + "metadata": {}, + "price": 9500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000EAT6", + "related_object": "sku", + "quantity": 1, + "amount": 18500, + "price": 18500, + "subtotal_amount": 18500, + "product": { + "name": "Jogging pants Paolo Pecora light grey" + }, + "sku": { + "sku": "Jogging pants Paolo Pecora light grey", + "metadata": {} + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f7", + "quantity": 3, + "discount_quantity": 3, + "initial_quantity": 0, + "amount": 89700, + "discount_amount": 89700, + "initial_amount": 0, + "applied_discount_amount": 89700, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f7", + "source_id": "M0E20000000ELDG", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f6", + "quantity": 4, + "discount_quantity": 4, + "initial_quantity": 0, + "amount": 119600, + "discount_amount": 119600, + "initial_amount": 0, + "applied_discount_amount": 119600, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f6", + "source_id": "M0E20000000ELDF", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bb9c69ca9d5a364b2": { + "date": "2022-09-21T13:09:25.799Z", + "related_object_type": "redemption", + "related_object_id": "r_0bb9c69ca9d5a364b2", + "stacked": [ + "r_0bb9c69ca9d5a364b3", + "r_0bb9c69ca9d5a364b4" + ] + } + } }, - "examples": { - "Example": { - "value": { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 35 - } + "code": "Test - Discount - Unit - Multiple - Product Variants", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "effect": "ADD_MISSING_ITEMS", + "unit_off": 3, + "unit_type": "sku_0b661e41fc8d35a8f7", + "sku": { + "id": "sku_0b661e41fc8d35a8f7", + "source_id": "M0E20000000ELDG", + "sku": "Casual jacket Michael Kors beige" }, - "created_at": "2022-08-24T11:40:22.418Z", - "updated_at": "2022-08-24T13:02:32.262Z", - "object": "reward_assignment" + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + } + }, + { + "effect": "ADD_NEW_ITEMS", + "unit_off": 4, + "unit_type": "sku_0b661e41fc8d35a8f6", + "sku": { + "id": "sku_0b661e41fc8d35a8f6", + "source_id": "M0E20000000ELDF", + "sku": "Casual jacket Michael Kors beige" + }, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + } + } + ] + }, + "metadata": {} + } + }, + "Unit - Add order items": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "ssn_K7DV3RbAGNCRVrPNZxJfld3FdwAQwOGl", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", + "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", + "created_at": "2022-09-21T13:09:25.773Z", + "updated_at": "2022-09-21T13:09:27.139Z", + "status": "PAID", + "amount": 117700, + "initial_amount": 28000, + "discount_amount": 8400, + "items_discount_amount": 89700, + "total_discount_amount": 98100, + "total_amount": 19600, + "items_applied_discount_amount": 89700, + "total_applied_discount_amount": 89700, + "items": [ + { + "object": "order_item", + "source_id": "A0E20000000295J", + "related_object": "sku", + "product_id": "prod_0b661d31134b299cc2", + "quantity": 1, + "amount": 9500, + "price": 9500, + "subtotal_amount": 9500, + "product": { + "id": "prod_0b661d31134b299cc2", + "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", + "name": "Keychain D‘Amico" + }, + "sku": { + "id": "sku_0b661d6265cb29ae52", + "source_id": "A0E20000000295J", + "sku": "Keychain D‘Amico", + "metadata": {}, + "price": 9500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000EAT6", + "related_object": "sku", + "quantity": 1, + "amount": 18500, + "price": 18500, + "subtotal_amount": 18500, + "product": { + "name": "Jogging pants Paolo Pecora light grey" + }, + "sku": { + "sku": "Jogging pants Paolo Pecora light grey", + "metadata": {} + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "sku_id": "sku_0b661e41fc8d35a8f8", + "quantity": 3, + "discount_quantity": 3, + "initial_quantity": 0, + "amount": 89700, + "discount_amount": 89700, + "initial_amount": 0, + "applied_discount_amount": 89700, + "price": 29900, + "subtotal_amount": 0, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bb9c69ca9d5a364b2": { + "date": "2022-09-21T13:09:25.799Z", + "related_object_type": "redemption", + "related_object_id": "r_0bb9c69ca9d5a364b2", + "stacked": [ + "r_0bb9c69ca9d5a364b3", + "r_0bb9c69ca9d5a364b4" + ] + } + } + }, + "code": "Test - Discount - Unit - Add new order items", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 3, + "unit_type": "sku_0b661e41fc8d35a8f8", + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige" + }, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + } + }, + "metadata": {} + } + }, + "Fixed": { + "value": { + "valid": true, + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "strict": false, + "price": 2000, + "price_formula": "IF(ORDER_AMOUNT > 400;0;20)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "products_collection", + "id": "pc_2KWKXn09Dk8neCfymqd4xOq8", + "strict": false, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "products_collection", + "id": "pc_x7HELQo52g2uI6nDuuOTRjAW", + "strict": false, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "strict": true, + "price": 99900, + "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", + "effect": "APPLY_TO_EVERY" + } + ], + "total": 7, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "ssn_u8rvi3Ac70S5ZRELWrxYsR2bnolpVWNg", + "type": "LOCK", + "ttl": 7, + "ttl_unit": "DAYS" + }, + "order": { + "amount": 46500, + "items_discount_amount": 9300, + "total_discount_amount": 9300, + "total_amount": 37200, + "items_applied_discount_amount": 9300, + "total_applied_discount_amount": 9300, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "discount_amount": 1300, + "applied_discount_amount": 1300, + "price": 6500, + "subtotal_amount": 5200, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "discount_amount": 600, + "applied_discount_amount": 600, + "price": 6000, + "subtotal_amount": 5400, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "discount_amount": 2000, + "applied_discount_amount": 2000, + "price": 2000, + "subtotal_amount": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 5000, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "discount_amount": 4400, + "applied_discount_amount": 4400, + "price": 11000, + "subtotal_amount": 17600, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "SPENDMOREGETMORE-DaIXFJvn", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "metadata": { + "shoutout": "Order more than 200€ to get 10% off pants, more than 300€ to get 20% off sweaters, and more than 400€ to get free shipping." + }, + "campaign": "SPENDMOREGETMORE", + "campaign_id": "camp_Nwb2mppeDTtk23s1FVo6riwp" + } + }, + "Voucher expired": { + "value": { + "valid": false, + "reason": "voucher expired", + "error": { + "code": 400, + "key": "voucher_expired", + "message": "voucher expired", + "details": "EarlyBird-tB6zCApA", + "request_id": "v-0be43067028abb6ca8" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "code": "EarlyBird-tB6zCApA", + "metadata": { + "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." + } + } + }, + "Percentage": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "session": { + "key": "your_custom_key", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 46500, + "discount_amount": 4650, + "total_discount_amount": 4650, + "total_amount": 41850, + "applied_discount_amount": 4650, + "total_applied_discount_amount": 4650, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "EarlyBird-tB6zCApA", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 10 + }, + "expiration_date": "2022-10-29T00:00:00.000Z", + "metadata": { + "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." + }, + "campaign": "Webinar - Early Bird Scenario", + "campaign_id": "camp_z1g3iFqQe5qiZ9TTYFVpMwC0" + } + }, + "Amount": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", + "session": { + "key": "your_custom_key", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 46500, + "discount_amount": 1000, + "total_discount_amount": 1000, + "total_amount": 45500, + "applied_discount_amount": 1000, + "total_applied_discount_amount": 1000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping", + "price": 0 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000, + "product": { + "id": "prod_0bd76f59f98617518e", + "source_id": "webinar_BF_sweater_pearl", + "name": "Pearl Sweater", + "price": 11000 + } } - } + ], + "metadata": { + "currency": "EUR" + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "PAYINEUROS", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 1000 + }, + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." } } - } - }, - "404": { - "description": "Returns an error indicating that the reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76XI", - "request_id": "v-0b95b8760a4ad5dda1", - "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76XI", - "resource_type": "reward_assignment" - } - } - } + }, + "Loyalty points exceeded": { + "value": { + "valid": false, + "reason": "loyalty card points exceeded", + "error": { + "code": 400, + "key": "loyalty_card_points_exceeded", + "message": "loyalty card points exceeded", + "details": "LOYALTY-CARD-ng3Kb9tM", + "request_id": "v-0be434ae35cabb018a" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "LOYALTY-CARD-ng3Kb9tM", + "metadata": {} } - } - } - } - }, - "delete": { - "operationId": "delete-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Delete Reward Assignment", - "description": "This method deletes a reward assignment for a particular reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the reward or reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward with id rew_2erjvECLs92GYzKbak3QkyT", - "request_id": "v-0ae29f325e1027cde8", - "resource_id": "rew_2erjvECLs92GYzKbak3QkyT", - "resource_type": "reward" + }, + "Loyalty Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "order": { + "amount": 14500, + "discount_amount": 50, + "total_discount_amount": 50, + "total_amount": 14450, + "applied_discount_amount": 50, + "total_applied_discount_amount": 50, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bd76fc58f8038b043", + "quantity": 1, + "amount": 8500, + "price": 8500, + "subtotal_amount": 8500, + "product": { + "id": "prod_0bd76fc58f8038b043", + "source_id": "webinar_BF_sweater_yellow", + "name": "Yellow Sweater", + "price": 8500 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bd0e204542738", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000, + "product": { + "id": "prod_0bd76bd0e204542738", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "name": "Navy Sweat Pants", + "price": 6000 + } } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "LOYALTY-CARD-ng3Kb9tM", + "loyalty": { + "points_cost": 10 + }, + "reward": { + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy", + "points": 10 + }, + "metadata": {}, + "campaign": "Loyalty Campaign", + "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" + } + }, + "Voucher disabled": { + "value": { + "valid": false, + "reason": "voucher is disabled", + "error": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "GIFT-CARD-kW4aEsfB", + "request_id": "v-0be43817d7121a437d" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "GIFT-CARD-kW4aEsfB", + "metadata": {} + } + }, + "Gift Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "order": { + "amount": 1000, + "discount_amount": 2, + "total_discount_amount": 2, + "total_amount": 998, + "applied_discount_amount": 2, + "total_applied_discount_amount": 2, + "metadata": { + "currency": "USD" }, - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_YkwQ5ezNYTQV2geodMVhTpy", - "request_id": "v-0ae2a0588b9027cf95", - "resource_id": "rewa_YkwQ5ezNYTQV2geodMVhTpy", - "resource_type": "reward_assignment" - } - } - } + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "GIFT-CARD-kW4aEsfB", + "gift": { + "amount": 32000, + "balance": 21500, + "effect": "APPLY_TO_ORDER" + }, + "metadata": {}, + "campaign": "Gift Card Campaign", + "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" } - } - } - } - }, - "get": { - "operationId": "get-reward-assignment", - "tags": [ - "REWARDS API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve a reward assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - } + }, + "Cannot be redeemed by referrer": { + "value": { + "valid": false, + "reason": "voucher cannot be redeemed by referrer", + "error": { + "code": 400, + "key": "referrer_not_permitted_to_redeem", + "message": "voucher cannot be redeemed by referrer", + "details": "REFERRAL-CODE-OxBakPYf", + "request_id": "v-0be43a8a110abb1bd3" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "code": "REFERRAL-CODE-OxBakPYf", + "metadata": {} } - } - }, - "404": { - "description": "Returns an error indicating that the reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_pJYQBXSitK2OVPK3XMXZK76X", - "request_id": "v-0b95b596e98ad5da24", - "resource_id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "resource_type": "reward_assignment" - } - } - } + }, + "Referral Code": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", + "order": { + "amount": 20000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 14000, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "metadata": { + "currency": "USD" + }, + "referrer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": null, + "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "order" + }, + "code": "REFERRAL-CODE-OxBakPYf", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 30 + }, + "metadata": {}, + "campaign": "Referral Campaign", + "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" } } } } } }, - "/v1/publication-object": { - "get": { - "operationId": "publication-object", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Publication Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Publication Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_obj_publication_object" + "400": { + "description": "Returns an error if request body is missing parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error" + }, + "examples": { + "Missing reward": { + "value": { + "code": 400, + "key": "missing_reward", + "message": "Missing reward", + "details": "A reward is required when redeeming a LOYALTY_CARD", + "request_id": "v-0bcb925c6d90f7f8fc", + "error": { + "message": "Missing reward = please add one." + } + } + }, + "Missing Parameter": { + "value": { + "code": 400, + "key": "missing_order_items_amount", + "message": "Missing applicable order items", + "details": "At least one applicable order item with amount is required to redeem this GIFT_VOUCHER", + "request_id": "v-0bcccfd04085cf2540", + "error": { + "message": "Request should contain an amount for the item." } } + }, + "Metadata Validation Failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "location_id: must be an array, and every element: must be a string, must be equal to one of L1,L2,L3 (actual value is 'L1')", + "request_id": "v-0bcced27715305d3fa" + } } } } } + } + } + } + }, + "/client/v1/validate": { + "get": { + "operationId": "validate-voucher-client-side", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Voucher (client-side) [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.\n\n> ❗️ Specifying gift credits and loyalty points\n>\n> This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount. \n\n### Set customer identity (optional)\n\nVoucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.\n\nVoucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.\n\nThe returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `/validate` request, and the version encrypted and returned as part of the validation request.\n\n### Sample workflow\n\nCustomer tracking workflow in a nutshell:\n\n**Client-side:**\n * A customer visits your website.\n * A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.\n\n**Backend:**\n * Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.\n * A customer object is created and within the redemption response, you get a customer `id`.\n * You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.\n \nA customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](ref:get-customer). \n\n\n\n> 📘 Customer identifier\n>\n> The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=PAYINEUROS&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer=cust_4vMj8Twr5nBzvTrNCgipMb6M&[order][metadata][currency]=EUR&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=LOYALTY-CARD-ng3Kb9tM&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=GIFT-CARD-kW4aEsfB&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku&[item][4][sku_id]=sku_0b661e41fc0d35a8f1&[item][4][quantity]=4'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=REFERRAL-CODE-OxBakPYf&amount=10000'\n```\n\n### [JSFiddle Example](https://jsfiddle.net/voucherify/gfu2bgn5/)\n\n```javascript\n\n\n\n```\n\n### Examples with Query Parameters\n\n| **Query Parameters** | **Example URL** |\n|:---|:---|\n| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |\n| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |\n| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |\n\n### Reasons why a validation might fail\n\nVoucher validation might fail because of one of these reasons:\n\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of [start date - expiration date] timeframe\n* `voucher is disabled` - learn more about [disabled vouchers](ref:disable-voucher)\n* `customer does not match segment rules` - learn more customer tracking LINK\n* `order does not match validation rules` - learn more about validation rules LINK", + "parameters": [ + { + "$ref": "#/components/parameters/origin" }, - "/v1/publications/create": { - "get": { - "operationId": "create-publication-1", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Create Publication", - "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet.\n> ❗️ Limited access\n>\n> Access to this endpoint is limited. This endpoint is designed for specific integrations and the API keys need to be configured to access this endpoint. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> This endpoint does not support the publishing of multiple vouchers from a single campaign. In case you want to publish multiple vouchers within a single publication, you need to use a [dedicated endpoint](ref:create-publication). \n\n\n> 📘 Specifying the voucher to be published\n>\n> - In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign and in the query parameters specify the `campaign` without specifying the voucher.\n> - If you would like to publish a specific code from a specific campaign, then you need to provide the `campaign` and the `voucher` parameters.\n> - If you would like to publish a standalone voucher, then omit the campaign parameter and simply provide the `voucher` parameter. \n\n## Example Request \n```markdown Publication Query \n/publications/create?campaign=camp_T0bUgWGCAV6S0X3smH4MEboG&metadata[year]=2&metadata[Date]=2023-03-03&metadata[DateTime]=2023-03-03T14:06:08.311Z&metadata[Flag]=true&metadata[Number]=222&metadata[String]=stringy&metadata[ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&metadata[Object][payment][payment_tax]=9&metadata[Object][payment][payment_method]=Visa&metadata[Object][payment][payment_date]=2023-03-03&metadata[Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&metadata[Object][payment][payment_completed]=true&metadata[Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[source_id]=try-new-12&customer[name]=John%20Jimmy&customer[description]=This is testing the publication endpoint.&customer[email]=johnjimy2%40email.com&customer[phone]=%2B48%20123%20333%20333&customer[address][city]=Warsaw&customer[address][state]=Mazowieckie&customer[address][line_1]=4499%20Main%20St.&customer[address][line_2]=Blg%202%20APT%204&customer[address][country]=Poland&customer[address][postal_code]=122333&customer[birthday]=2222-01-22&customer[metadata][paid_bill]=true&customer[metadata][age]=22&customer[metadata][location]=Poland&customer[metadata][acquisition_date]=2022-09-09&customer[metadata][birth_date]=2023-03-20T18:44:19.215Z&customer[metadata][ImageURL]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][location-unknown][city]=Katowice&customer[metadata][location-unknown][state]=slask&customer[metadata][location-unknown][number]=2&customer[metadata][location-unknown][date]=2034-09-11&customer[metadata][location-unknown][dateTime]=2023-03-20T18:44:19.215Z&customer[metadata][Object][payment][payment_date]=2023-03-03&customer[metadata][Object][payment][payment_datetime]=2023-03-03T14:06:08.311Z&customer[metadata][Object][payment][payment_completed]=true&customer[metadata][Object][payment][payment_url]=https://user-images.githubusercontent.com/95409292/222734777-a6d9e41a-de3a-42a8-8cc7-24f31e857edd.png&customer[metadata][Object][payment][payment_tax]=9&customer[metadata][Object][payment][payment_method]=Visa```", - "parameters": [ - { - "schema": { - "type": "string", - "example": "custom_publication_source_id" - }, - "in": "query", - "name": "source_id", - "description": "The merchant’s publication ID if it is different from the Voucherify publication ID. It's an optional tracking identifier of a publication. It is really useful in case of an integration between multiple systems. It can be a publication ID from a CRM system, database or 3rd-party service." - }, + { + "schema": { + "type": "string", + "example": "7fjWdr" + }, + "in": "query", + "name": "code", + "description": "A code that identifies the voucher." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that validated the voucher. This identifier is generated during voucher validation based on your internal ID (e.g., email, database ID) during the first request. This is a hashed customer source ID. If the request is performed for the first time, pass the internal ID to track the customer. **Although not all information is required, the extra information helps prevent fraud.**" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "amount", + "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order. This amount is the sum of the order items' amounts." + }, + { + "schema": { + "type": "string", + "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" + }, + "in": "query", + "name": "session_key", + "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated." + }, + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "session_ttl", + "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session_ttl_unit` parameter." + }, + { + "schema": { + "type": "string", + "enum": [ + "HOURS", + "DAYS", + "MINUTES", + "SECONDS", + "MILLISECONDS", + "MICROSECONDS", + "NANOSECONDS" + ] + }, + "in": "query", + "name": "session_ttl_unit", + "description": "Defines the type of unit in which the session time is counted." + }, + { + "$ref": "#/components/parameters/metadata" + }, + { + "$ref": "#/components/parameters/item" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "session_type", + "description": "The session is required to establish a session between multiple parallel validation and redemption requests. This parameter is required to establish a new session. The session locks the **redemption quantity by 1** and additionally the redemption **gift credits** specified within the request for a gift card and the **loyalty points** for a loyalty card." + }, + { + "name": "customer", + "in": "query", + "required": false, + "schema": { + "anyOf": [ { - "schema": { - "type": "string", - "example": "PROMO-1LwwzYI" + "type": "object", + "title": "Customer details", + "description": "Customer source ID and/or customer metadata.", + "properties": { + "source_id": { + "type": "string", + "description": "Customer source ID.", + "example": "name.lastname@email.com" + }, + "metadata": { + "type": "object", + "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.", + "style": "deepObject", + "explode": true + } }, - "in": "query", - "name": "voucher", - "description": "Code of voucher being published. If there is a particular code that you would like to publish, then you can use this parameter to specify the code. You can omit this parameter if you would like to publish a random code from a campaign, where the campaign is in `AUTO_UPDATE` mode." - }, - { - "name": "metadata", - "in": "query", - "description": "The metadata object stores all custom attributes assigned to the publication. A set of key/value pairs that you can attach to a publication object. It can be useful for storing additional information about the publication in a structured format.", - "style": "deepObject", - "explode": true, - "schema": { - "type": "object" - } - }, - { - "name": "customer", - "in": "query", - "required": true, - "description": "Specify the customer who is to receive a code. You can either directly provide the respective ID's as strings or provide them in the form of an object.", "style": "deepObject", - "explode": true, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_customer" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_id" - }, - { - "$ref": "#/components/schemas/5_res_create_publication_customer_source_id" - }, - { - "$ref": "#/components/schemas/9_req_create_customer" - } - ] - } + "explode": true }, { - "name": "campaign", - "in": "query", - "required": true, - "description": "Name of voucher's parent campaign or unique campaign ID that was assigned by Voucherify, i.e. `camp_dphuwqH7BOVkgh4JmpDtS32l`. You can use this parameter without having to specify a particular `voucher` code if the campaign is in `AUTO_UPDATE` mode. This parameter not required for a standalone code, however, if you intend to use a code from a campaign, then this parameter is required.", - "style": "deepObject", - "explode": true, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/5_req_create_publication_campaign" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_campaign_id" - }, - { - "$ref": "#/components/schemas/5_req_create_publication_campaign_name" - } - ] - } + "type": "string", + "title": "Customer ID", + "description": "Unique customer ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`.", + "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + ] + }, + "description": "Customer details." + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "object", + "title": "Order details", + "description": "Order details.", + "properties": { + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.", + "style": "deepObject", + "explode": true } - ], - "responses": { - "200": { - "description": "Returns a publication object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_create_publication" - }, - "examples": { - "Example": { - "value": { - "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", - "object": "publication", - "created_at": "2022-09-30T16:30:32.924Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "pub_source_customer_5", - "metadata": { - "year": 2022 - }, - "channel": "myown", - "source_id": "publication_source_ID_10", - "result": "SUCCESS", - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "voucher": { - "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", - "code": "cEsMn0uA", - "campaign": "Test - Discount Effect - Amount - Items", - "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-30T16:30:32.956Z", - "updated_at": null, - "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "vouchers_id": [ - "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" - ] - } - } - } + }, + "style": "deepObject", + "explode": true + }, + "description": "Order details." + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on [validation sessions](doc:locking-validation-session).", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/6_res_validate_voucher" + }, + { + "$ref": "#/components/schemas/6_res_validate_voucher_false" } - } + ] }, - "400": { - "description": "Returns an error if the query parameters are incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "examples": { + "Wrong customer": { + "value": { + "valid": false, + "reason": "customer does not match validation rules", + "error": { + "message": "Only the gift card owner can apply credits from the gift card to the order." }, - "examples": { - "Missing customer": { - "value": { - "code": 400, - "key": "invalid_query_params", - "message": "Invalid query params", - "details": "Query should have required property 'customer'", - "request_id": "v-0c8b6423f3c80ed3e4" - } - }, - "Missing vouchers": { - "value": { - "code": 400, - "key": "missing_vouchers", - "message": "Missing vouchers", - "details": "Either Campaign or Voucher is required" - } - }, - "Voucher cannot be published": { - "value": { - "code": 400, - "key": "voucher_cannot_be_published", - "message": "Voucher cannot be published", - "details": "Voucher cannot be published. Customer already joined program.", - "request_id": "v-0c8b763544080efed2" - } - }, - "Voucher already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_vM7vQZmgV86k0wuz05cFAOfarj4s8BQE' has already been published", - "request_id": "v-0c8baebc67c80e97a0" + "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+o", + "code": "GIFT-CARD-kW4aEsfB", + "metadata": {} + } + }, + "Validation Rule Not Satisfied": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Discount Coupon cannot be redeemed because of violated validation rules: val_WuupvE7OVXyo", + "request_id": "v-0be54f4afa0357c12f" + }, + "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychk", + "code": "PAYINEUROS", + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + } + } + }, + "Validate Discount Coupon": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 13000, + "discount_amount": 1000, + "total_discount_amount": 1000, + "total_amount": 12000, + "applied_discount_amount": 1000, + "total_applied_discount_amount": 1000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } } + ], + "metadata": { + "currency": "EUR" }, - "Duplicate source ID": { - "value": { - "code": 400, - "key": "duplicate_source_id", - "message": "Duplicate source_id", - "details": "Publication with source_id: 'test_publication_source_id_test_voucher' already exists", - "request_id": "v-0c8b7e8f78c80e94a2" + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "PAYINEUROS", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 1000 + }, + "metadata": { + "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." + } + } + }, + "Validate Loyalty Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 121700, + "discount_amount": 5000, + "total_discount_amount": 5000, + "total_amount": 116700, + "applied_discount_amount": 5000, + "total_applied_discount_amount": 5000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bb4aa003890cb", + "quantity": 2, + "amount": 9000, + "price": 4500, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76bb4aa003890cb", + "source_id": "webinar_BF_pants_black_sweat_pants", + "name": "Black Sweat Pants", + "price": 4500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000ELDH", + "related_object": "sku", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "quantity": 3, + "amount": 89700, + "price": 29900, + "subtotal_amount": 89700, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } } + ], + "metadata": { + "currency": "EUR" }, - "Too many vouchers requested": { - "value": { - "code": 400, - "key": "too_many_vouchers_requested", - "message": "Too many vouchers requested", - "details": "Only up to 1 can be published", - "request_id": "v-0c8bac9a25c80e912d" + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "code": "LOYALTY-CARD-ng3Kb9tM", + "loyalty": { + "points_cost": 1000 + }, + "reward": { + "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", + "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy" + }, + "metadata": {}, + "campaign": "Loyalty Campaign", + "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" + } + }, + "Validate Gift Card": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", + "session": { + "key": "A", + "type": "LOCK", + "ttl": 1, + "ttl_unit": "NANOSECONDS" + }, + "order": { + "amount": 165700, + "discount_amount": 21500, + "total_discount_amount": 21500, + "total_amount": 144200, + "applied_discount_amount": 21500, + "total_applied_discount_amount": 21500, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 2, + "amount": 13000, + "price": 6500, + "subtotal_amount": 13000, + "product": { + "id": "prod_0bd76ca337954ca116", + "source_id": "webinar_BF_sweater_pink_sweater", + "name": "Pink Sweater", + "price": 6500 + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000, + "product": { + "id": "prod_0bd76b8656956a183f", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "name": "Gray Sweat Pants", + "price": 5000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bd76bb4aa003890cb", + "quantity": 2, + "amount": 9000, + "price": 4500, + "subtotal_amount": 9000, + "product": { + "id": "prod_0bd76bb4aa003890cb", + "source_id": "webinar_BF_pants_black_sweat_pants", + "name": "Black Sweat Pants", + "price": 4500 + } + }, + { + "object": "order_item", + "source_id": "M0E20000000ELDH", + "related_object": "sku", + "product_id": "prod_0b661d4bd2c7ec7d1f", + "quantity": 3, + "amount": 89700, + "price": 29900, + "subtotal_amount": 89700, + "product": { + "id": "prod_0b661d4bd2c7ec7d1f", + "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", + "name": "Casual jacket Michael Kors beige" + }, + "sku": { + "id": "sku_0b661e41fc8d35a8f8", + "source_id": "M0E20000000ELDH", + "sku": "Casual jacket Michael Kors beige", + "price": 29900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b661d4bd347ec7d26", + "sku_id": "sku_0b661e41fc0d35a8f1", + "quantity": 4, + "amount": 44000, + "price": 11000, + "subtotal_amount": 44000, + "product": { + "id": "prod_0b661d4bd347ec7d26", + "source_id": "975193eb-1911-444a-a0f0-f567efce1a8b", + "name": "Pumps ”Flex” Michael Kors black" + }, + "sku": { + "id": "sku_0b661e41fc0d35a8f1", + "source_id": "M0E20000000DMVX", + "sku": "Pumps ”Flex” Michael Kors black", + "price": 11000 + } } + ], + "metadata": { + "currency": "EUR" }, - "Metadata validation failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "ImageURL: must be a URL pointing to JPG/JPEG or PNG resource (actual value is 'http.com')", - "request_id": "v-0c8bcbd742080ee807" - } - } - } - } - } - }, - "403": { - "description": "Returns an error if you don't have a specific credentials set up. Navigate to the **Dashboard** → **Project Settings** → **General** → **Integration Keys** to set up a pair of API keys and use them to send the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_integration_key" + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "examples": { - "Example": { - "value": { - "code": 403, - "message": "Forbidden", - "key": "integration_api_key_required" - } - } - } + "code": "GIFT-CARD-kW4aEsfB", + "gift": { + "amount": 32000, + "balance": 21500, + "effect": "APPLY_TO_ORDER" + }, + "metadata": {}, + "campaign": "Gift Card Campaign", + "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" } - } - }, - "404": { - "description": "Returns an error if a resource is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Resource not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_xqA7DGj5eYPHg6PHVKwYRWiA", - "request_id": "v-0c8b6b35294af6f192", - "resource_id": "cust_xqA7DGj5eYPHg6PHVKwYRWiA", - "resource_type": "customer" - } - } - } + }, + "Validate Referral Code": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", + "order": { + "amount": 10000, + "discount_amount": 3000, + "total_discount_amount": 3000, + "total_amount": 7000, + "applied_discount_amount": 3000, + "total_applied_discount_amount": 3000, + "items": [], + "metadata": {}, + "referrer": { + "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "customer" + }, + "customer_id": null, + "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", + "object": "order" + }, + "code": "REFERRAL-CODE-OxBakPYf", + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 30 + }, + "metadata": {}, + "campaign": "Referral Campaign", + "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" } } } } } }, - "/v1/publications": { - "get": { - "operationId": "list-publications", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "List Publications", - "description": "Retrieve a list of publications. To return a **particular** publication, you can use the `source_id` query parameter and provide the `source_id` of the publication you are looking for specifically.\n\n## Pagination\n\n\n> 🚧 Important!\n>\n> If you want to scroll through a huge set of records, it is recommended to use the [Exports API](ref:create-export). This API will return an error `page_over_limit` if you reach a page above 1000.\n\n## Filter Query\n\nThe `filters` query parameter allows for joining multiple parameters with logical operators. The syntax looks as follows:\n\n\n```url\nfilters[][conditions][][]=\n```\n\n### Operators:\n\n\n```\n \"$in\"\n \"$not_in\"\n \"$is\"\n \"$is_not\"\n \"$has_value\"\n \"$is_unknown\"\n \"$contains\"\n \"$starts_with\"\n \"$ends_with\"\n \"$more_than\"\n \"$less_than\"\n \"$more_than_equal\"\n \"$less_than_equal\"\n```\n\n### Examples\n\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$in][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$in][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc\n```\n\n```url\nGET /v1/publications?filters[customer_id][conditions][$is][0]=cust_lUET6gRpO5Wxlg5p2j2gRCgL&filters[customer_id][conditions][$is][1]=cust_aR7NfHusxT7PdTMAKMfWDXnc&filters[junction]=OR\n```", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id", - "created_at", - "-created_at", - "channel", - "-channel" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign", - "description": "Filters by a given campaign name." - }, - { - "schema": { - "type": "string", - "example": "cust_jl33V8ZDQJp4goU1z8DmFioo" - }, - "in": "query", - "name": "customer", - "description": "Filters by a unique customer ID." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "voucher", - "description": "Filters by a given voucher code." - }, - { - "schema": { - "type": "string", - "enum": [ - "SUCCESS", - "FAILURE" - ] - }, - "in": "query", - "name": "result", - "description": "Filters by a publication result." - }, - { - "schema": { - "type": "string", - "enum": [ - "discount", - "loyalty", - "lucky_draw" - ] - }, - "in": "query", - "name": "voucher_type", - "description": "Filters by a voucher type." - }, - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "is_referral_code", - "description": "This filter works only for the `true` option. If set to `true`, the query returns only publications of codes from referral campaigns. " - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "filters", - "description": "Allows for combining the filters mentioned in the endpoint description." + "400": { + "description": "Returns an error if missing required parameters or tracking IDs come from the same origin.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "source_id", - "description": "Using this endpoint with a particular publication `source_id`, which was sent with the original request to create a publication, returns in the response, exactly the same code published initially because the code was assigned to the given publication. As a result, you can use this endpoint as a reference and return a code that was assigned in a publication by using a particular `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of publications you’ve previously created with [create publication](ref:create-publication) or implicitly by the distribution manager. The publications are returned in sorted order, with the most recent ones appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_list_publications" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "publications", - "publications": [ - { - "id": "pub_QzQT50e5i2y3bRoEVvhFgrKbZ7t6BRwu", - "object": "publication", - "created_at": "2022-09-28T13:31:23.522Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "cindy.jones@email.com", - "metadata": { - "distribution_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei", - "source_type": "distribution", - "source_id": "distr_WXm0CBttar2ug2hBx3EdPtS8Ei" - }, - "channel": "Automation", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Cindy Jones", - "email": "cindy.jones@email.com", - "source_id": "cindy.jones@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "voucher": { - "code": "FNV5IrtY", - "object": "voucher", - "campaign": "Loyalty Campaign", - "loyalty_card": { - "points": 0, - "balance": 0 - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_i3HOzVClfJUDia0qCu7TSuGfDj7c0dgD" - ] - }, - { - "id": "pub_8KOKHObAjuemuI0b6225emIhmWDL1ZoX", - "object": "publication", - "created_at": "2022-09-28T13:31:02.766Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "sandy.jones@email.com", - "metadata": {}, - "channel": "voucherify-website", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Sandy Jones", - "email": "sandy.jones@email.com", - "source_id": "sandy.jones@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "voucher": { - "code": "Voucher-1", - "object": "voucher", - "campaign": null, - "discount": { - "type": "AMOUNT", - "amount_off": 200, - "amount_off_formula": "IF(VOUCHER_PUBLISH_COUNT = 1;25;5)", - "effect": "APPLY_TO_ORDER" - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_1iEL92K634EIOqeYJw6AHrnjEhGPEdpu" - ] - }, - { - "id": "pub_DcQPfyVYzomtkQGXFW7dcdyNoJ6vQ4NV", - "object": "publication", - "created_at": "2022-09-13T06:15:08.249Z", - "customer_id": "cust_ur1hIPGflbaAe14mLlLdon3G", - "tracking_id": "1", - "metadata": {}, - "channel": "voucherify-website", - "source_id": null, - "result": "SUCCESS", - "customer": { - "id": "cust_ur1hIPGflbaAe14mLlLdon3G", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "1", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "voucher": { - "code": "GIFT-WOZaK5YF1Fs87tAX", - "object": "voucher", - "campaign": "Gift Cards", - "gift": { - "amount": 0, - "balance": 0 - }, - "is_referral_code": false - }, - "vouchers_id": [ - "v_yzOeb7vw63vbPfA30215dFm7aRXa8Xoc" - ] - } - ], - "total": 3 - } - } - } + "examples": { + "Missing customer": { + "value": { + "code": 400, + "key": "missing_customer", + "message": "Missing customer", + "details": "Customer is required to validate rules", + "request_id": "v-0be548ae620abb0a73" } - } - }, - "400": { - "description": "Returns an error if you request a page higher than 1000.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "page_over_limit", - "message": "Listing resource above 1000 page is not supported", - "details": "Property .page cannot be higher than 1000", - "request_id": "v-0bc2a39574c61362af" - } - } - } + }, + "Ambiguous tracking ID": { + "value": { + "code": 400, + "key": "ambiguous_tracking_id", + "message": "Ambiguous trackingId ('track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychkbEcMNB5RhcTj+zcKBEcGnUZkAXxg=' vs. 'track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==')", + "details": "The customer cannot be identified as two different identifiers have been used between requests from same origin.", + "request_id": "v-0be550a5a84abb30f8" } } } } + } + } + } + } + }, + "/v1/promotions/validation": { + "post": { + "operationId": "validate-promotions", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Promotions [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nUse this method to get valid promotions for a given customer and order.\n\n### Advanced validation filters\n\nYou can narrow down a validation to a specific promotion ID or tier metadata. Here are the examples of filtering queries you can use:\n\n| **Filter** | **Example** |\n|:---|:---|\n| promotion_id | [filters][promotion_id][conditions][$is]={{campaign_id}} |\n| tier metadata | [filters][metadata.{{promotion tier metadata key}}][conditions][$is]={{promotion tier metadata value}} |\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }'/\n 'https://api.voucherify.io/v1/promotions/validation?audienceRulesOnly=true'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n },\n \"metadata\": {\n \"store_names\": \"Store 1 - New York - Broadway\"\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][promotion_id][conditions][$is]=camp_nYcAyjFXmEaBU0nB7EQ4hVTr'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][metadata.has_budget][conditions][$is]=true'\n```", + "parameters": [ + { + "schema": { + "type": "string" }, - "post": { - "operationId": "create-publication", - "tags": [ - "PUBLICATIONS API" - ], - "summary": "Create Publication", - "description": "This method selects vouchers that are suitable for publication, adds a publish entry and returns the publication.\n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 🚧 Clearly define the source of the voucher\n>\n> You must clearly define which source you want to publish the voucher code from. It can either be a code from a campaign or a specific voucher identified by a code. \n\n> 🚧 Publish multiple vouchers\n> In case you want to publish multiple vouchers within a single publication, you need to specify the campaign name and number of vouchers you want to publish. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use an **auto-update** campaign.", - "parameters": [ - { - "schema": { - "type": "boolean" - }, - "in": "query", - "name": "join_once", - "description": "Through this flag, you can control if a particular person gets only one and always the same code even if the app sends multiple publication requests. It means that if you have a referral program, a referrer is assigned only to one code if an integration sends publication requests more than once for the same customer." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the publication parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_req_create_publication" - }, - "examples": { - "Example - Specific Voucher": { - "value": { - "campaign": { - "name": "campaign-name" - }, - "customer": { - "source_id": "source-id", - "Name": "Customer Name", - "email": "customer email" - }, - "voucher": "voucher-code", - "metadata": { - "key": "value" - } - } - }, - "Example - Random Voucher": { - "value": { - "campaign": { - "name": "campaign-name", - "count": 1 - }, - "customer": { - "source_id": "source-id", - "Name": "Customer Name", - "email": "customer email" - }, - "voucher": "voucher-code", - "metadata": { - "key": "value" - } - } - }, - "Example 3": { - "value": { - "source_id": "publication_source_ID_10", - "campaign": "Test - Discount Effect - Amount - Items", - "channel": "myown", - "customer": { - "source_id": "pub_source_customer_5", - "name": "Bob Jones", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "1901-12-01" - }, - "metadata": { - "year": 2022 - } - } - } - } - } + "in": "query", + "name": "audienceRulesOnly", + "description": "If you add a query param AudienceRulesOnly=true, the request will be validated against customer-related rules only, the rest of attached limits and rules will be ignored." + }, + { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "type": "object", + "title": "Promotion filters", + "description": "Promotion filter conditions.", + "properties": { + "metadata": { + "type": "object", + "description": "Allows you to create a filter based on the conditions set for promotion metadata values. The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that are attached to a promotion tier object. Stores additional information about the promotion tier in a structured format.", + "style": "deepObject", + "explode": true + }, + "promotion_id": { + "type": "object", + "description": "Allows you to create a filter based on the unique promotion ID.", + "style": "deepObject", + "explode": true } }, - "responses": { - "200": { - "description": "Returns a publication object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/5_res_create_publication" - }, - "examples": { - "Example": { - "value": { - "id": "pub_ocaXCa023ayJ3WL1ARxUeKgIvg3JcEGh", - "object": "publication", - "created_at": "2022-09-30T16:30:32.924Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "pub_source_customer_5", - "metadata": { - "year": 2022 - }, - "channel": "myown", - "source_id": "publication_source_ID_10", - "result": "SUCCESS", - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "voucher": { - "id": "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf", - "code": "cEsMn0uA", - "campaign": "Test - Discount Effect - Amount - Items", - "campaign_id": "camp_dphuwqH7BOVkgh4JmpDtS32l", - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ+6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX188XVmOotyCyR2j3G8sJR8HzS3DQ%2B6J1OElPWSmjlEnthuJc7rkc7WIVxjT4pTl1JVVkHEuGXNXdzRik11H8S18HQeQFJFiuwLZ2mzEC2zZitEinyUxtZwhnEHoi0eGAgYCG7iVMNuOQA%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn+wFkfzcIZGBtUlxrI2KsXciCqF+c93AKzsymq5Yw8eEAFF/FK5f94z4/sgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18wDd9CcLM0Ef7aBfUSXZUoCQpuNpk4CHGOipbn%2BwFkfzcIZGBtUlxrI2KsXciCqF%2Bc93AKzsymq5Yw8eEAFF%2FFK5f94z4%2FsgzaLDvyBmPCXHuS11Ew9S4ZEMjdTkUJftER2IlxWaCARA%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-30T16:30:32.956Z", - "updated_at": null, - "holder_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "redemption": { - "quantity": 1, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/cEsMn0uA/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/cEsMn0uA/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "vouchers_id": [ - "v_6Hy5FdNlu3dP65fJu5BgXma31Sl3rgkf" - ] + "style": "deepObject", + "explode": true + }, + "description": "Filter conditions." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the customer and order context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_promotion" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "source-id", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "category" + ] + }, + "order": { + "amount": 10000, + "items": [ + { + "product_id": "product-id", + "quantity": "1", + "price": 10000, + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } } - } + ] + }, + "metadata": { + "key": "value" } } }, - "400": { - "description": "Returns an error if a publication with the same source ID already exists in the system or some request body parameter is missing.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Missing Parameters": { - "value": { - "code": 400, - "key": "missing_vouchers", - "message": "Missing vouchers", - "details": "Either Campaign or Voucher is required" - } + "Customer Rules Only": { + "value": { + "customer": { + "id": "cust_gN9KgORZECfdhG9qT6n82Zr7" + }, + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 }, - "Already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_Y5P4UZ1yilkiYOIJmAAgWazUi1wfkNwF' has already been published", - "request_id": "v-0bc40bb800d5651137" - } + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 }, - "Duplicate Source ID": { - "value": { - "code": 400, - "key": "duplicate_source_id", - "message": "Duplicate source_id", - "details": "Publication with source_id: 'publication_source_ID_1' already exists", - "request_id": "v-0bc40bf81555651191" - } + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] } + }, + "options": { + "expand": [ + "category" + ] } } }, - "404": { - "description": "Returns an error if a resource is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id 1", - "request_id": "v-0bc40546e5d56508e5", - "resource_id": "1", - "resource_type": "campaign" - } + "Campaign Specific": { + "value": { + "customer": { + "source_id": "test-user@email.com" + }, + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] } + }, + "options": { + "expand": [ + "category" + ] + }, + "metadata": { + "store_names": "Store 1 - New York - Broadway" } } - } - } - } - }, - "/v1/validation-object": { - "get": { - "operationId": "validation-object", - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validation Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Object", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher" - } + }, + "Promotion Tier Metadata": { + "value": { + "customer": { + "name": "Joe McDonald", + "email": "joey@email.com", + "source_id": "123_source_id" + }, + "order": { + "items": [ + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1 + }, + { + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": "1" + }, + { + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1 + }, + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1 + }, + { + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1 + } + ], + "metadata": { + "payment_mean": [ + "credit-card" ] } + }, + "options": { + "expand": [ + "category" + ] } } } } } - }, - "/v1/vouchers/{code}/validate": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns a list of valid promotions for a given context (customer and order). You can then choose which promotion to apply, i.e. the highest discount amount.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "Testing7fjWdr" - }, - "name": "code", - "in": "path", - "required": true, - "description": "A code that identifies the voucher." - } - ], - "post": { - "operationId": "validate-voucher", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Voucher [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by a customer, you can use this method. It is designed for a server side integration, which means that is accessible only through private keys. \n\n\n> ❗️ Important \n>\n> This endpoint supports the validation of a single promo code. If you need to validate more than one incentive, you can use the [Stackable discounts API](ref:stackable-discounts-api). The stacking discounts API lets you validate up to 5 incentives per call. Before integrating Voucherify, choose which validation endpoint you prefer to use.\n\n#### Gift Vouchers - validate Gift Card and control amount to redeem\nVoucherify also gives the possibility to create a gift card, which allows using credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition. \n\nThis operation returns information about the validity of the code. Moreover, it returns a hashed source identifier which can be used as a tracking ID in future calls.\n\nIf a validation session is established, then the session details will be returned as well. Read more about sessions [here](doc:locking-validation-session).\n\nVoucher validation might fail because of one of these reasons:\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of start date - expiration date time frame\n* `voucher is disabled` - learn more about a [disabled voucher](ref:disable-voucher)\n* `customer does not match segment rules` - learn more [customer tracking](doc:customers#customer-tracking) \n* `order does not match validation rules` - learn more about [validation rules](doc:validation-rules)", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the voucher validation context using the request body parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_voucher" - }, - "examples": { - "Free Shipping": { - "value": { - "customer": { - "id": "cust_4vMj8Twr5nBzvTrNCgipMb6M" + "$ref": "#/components/schemas/6_res_validate_promotion" + }, + "examples": { + "Customer Rules Only": { + "value": { + "valid": true, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", "order": { + "amount": 9351000, + "initial_amount": 72100, + "items_discount_amount": 9340400, + "total_discount_amount": 9340400, + "total_amount": 10600, + "items_applied_discount_amount": 9340400, + "total_applied_discount_amount": 9340400, "items": [ { - "product_id": "prod_0ba621bae5d39762ce", - "quantity": "1" + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { - "product_id": "prod_0b661d404787ec6d3b", - "quantity": "1", - "price": 3100 - } - ] - } - } - }, - "Multiple Product Variants": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP" - } - } - }, - "Unit - Add order items": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8" - }, - "session": { - "type": "LOCK", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } - }, - "Fixed": { - "value": { - "customer": { - "source_id": "08dd9b5a-26de-44aa-a1d4-d9adfa9e8ec2" - }, - "order": { - "items": [ + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 23, + "discount_quantity": 22, + "initial_quantity": 1, + "amount": 39100, + "discount_amount": 37400, + "initial_amount": 1700, + "applied_discount_amount": 37400, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } }, { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 222, + "discount_quantity": 222, + "initial_quantity": 1, + "amount": 333000, + "discount_amount": 333000, + "initial_amount": 1500, + "applied_discount_amount": 333000, + "price": 1500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 111, + "discount_quantity": 111, + "initial_quantity": 1, + "amount": 6660000, + "discount_amount": 6660000, + "initial_amount": 60000, + "applied_discount_amount": 6660000, + "price": 60000, + "subtotal_amount": 0, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } }, { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 11, + "discount_quantity": 11, + "initial_quantity": 0, + "amount": 2310000, + "discount_amount": 2310000, + "initial_amount": 0, + "applied_discount_amount": 2310000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } } - ] - }, - "session": { - "type": "LOCK" - } - } - }, - "Percentage": { - "value": { - "customer": { - "source_id": "your_customer_source_ID", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, + ], "metadata": { - "lang": "en", - "test": true + "payment_mean": [ + "credit-card" + ] }, - "birthday": "1960-12-01" + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "order": { - "items": [ - { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" - }, + "id": "promo_ByIIAHC1Mz9ouJsitzAWsush", + "name": "Multiple", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" + "effect": "ADD_MISSING_ITEMS", + "unit_off": 11, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" + }, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" + } }, { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" + "effect": "ADD_NEW_ITEMS", + "unit_off": 22, + "unit_type": "sku_0b7d7dfb090be5c619", + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1" + }, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1" + } }, { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" + "effect": "ADD_MISSING_ITEMS", + "unit_off": 111, + "unit_type": "prod_0b7d7c4e814be5c502", + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12" + } }, { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" + "effect": "ADD_MISSING_ITEMS", + "unit_off": 222, + "unit_type": "prod_0b72b0bd64d198e3ae", + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage" + } } ] }, - "session": { - "type": "LOCK", - "key": "your_custom_key", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } - }, - "Amount": { - "value": { - "customer": { - "source_id": "your_customer_source_ID", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "1960-12-01" + "campaign": { + "id": "camp_JtoaZ8Qgpf6FkMAy2wWiOJWH", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "discount_amount": 9340400, + "applied_discount_amount": 9340400, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", "order": { + "amount": 9522100, + "initial_amount": 72100, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 72100, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, "items": [ { - "source_id": "webinar_BF_sweater_pink_sweater", - "quantity": "1", - "price": 6500, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { - "source_id": "webinar_BF_pants_navy_sweat_pants", - "quantity": "1", - "price": 6000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } }, { - "source_id": "5h1pp1ng", - "quantity": "1", - "price": 2000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { - "source_id": "webinar_BF_pants_gray_sweat_pants", - "quantity": "2", - "price": 5000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } }, { - "source_id": "webinar_BF_sweater_pearl", - "quantity": "2", - "price": 11000, - "related_object": "product" + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, + "discount_amount": 9450000, + "initial_amount": 0, + "applied_discount_amount": 9450000, + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } } ], "metadata": { - "currency": "EUR" + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "name": "Add new SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 45, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" + }, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" } }, - "session": { - "type": "LOCK", - "key": "your_custom_key", - "ttl_unit": "NANOSECONDS", - "ttl": 1 - } - } - }, - "Loyalty Card": { - "value": { + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 4, + "discount_amount": 9450000, + "applied_discount_amount": 9450000, + "metadata": {}, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", "order": { + "amount": 109500, + "initial_amount": 72100, + "items_discount_amount": 39100, + "total_discount_amount": 39100, + "total_amount": 70400, + "items_applied_discount_amount": 39100, + "total_applied_discount_amount": 39100, "items": [ { - "product_id": "prod_0bd76fc58f8038b043", - "quantity": "1" + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 23, + "discount_quantity": 23, + "initial_quantity": 1, + "amount": 39100, + "discount_amount": 39100, + "initial_amount": 1700, + "applied_discount_amount": 39100, + "price": 1700, + "subtotal_amount": 0, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { - "product_id": "prod_0bd76bd0e204542738", - "quantity": "1" + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } } - ] - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "points": 10 - } - } - }, - "Gift Card": { - "value": { - "customer": { - "source_id": "286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d" - }, - "order": { - "amount": 1000, + ], "metadata": { - "currency": "USD" - } - }, - "gift": { - "credits": 2 - }, - "metadata": { - "location_id": [ - "L1" - ] - } - } - }, - "Referral Code": { - "value": { - "customer": { - "source_id": "earlybirdcust" + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "order": { - "amount": 20000, - "metadata": { - "currency": "USD" + "id": "promo_NcdD0zLo6FUhKWpNrNuP3Pte", + "name": "Add missing SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 23, + "unit_type": "sku_0b7d7dfb090be5c619", + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1" + }, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1" } }, - "metadata": { - "location_id": [ - "L1" - ] - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the request body.", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher" + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - } - ] - }, - "examples": { - "False": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Gift Card cannot be redeemed because of violated validation rules: val_wvipKm99CJuL", - "request_id": "v-0bccef7a9585cf63b6" - }, - "tracking_id": "track_ZGPtmYcM+Mw=", - "code": "vBQvYFEM", - "metadata": {} - } - }, - "Free Shipping": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "order": { - "amount": 4300, - "total_amount": 4300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0ba621bae5d39762ce", - "quantity": 1, - "amount": 1200, - "price": 1200, - "subtotal_amount": 1200, - "product": { - "id": "prod_0ba621bae5d39762ce", - "source_id": "arabica_plus", - "name": "Arabica Coffee 250g", - "price": 1200 - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d404787ec6d3b", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0b661d404787ec6d3b", - "source_id": "7717f389-4621-4c7a-a6db-d4acfe051a97", - "name": "Kate Moss by Mario Testino" - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "Test - Discount - Free Shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "metadata": {} - } + "hierarchy": 3, + "discount_amount": 39100, + "applied_discount_amount": 39100, + "metadata": {}, + "object": "promotion_tier" }, - "Multiple Product Varients": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", - "created_at": "2022-09-21T13:09:25.773Z", - "updated_at": "2022-09-21T13:09:27.139Z", - "status": "PAID", - "amount": 237300, - "initial_amount": 28000, - "discount_amount": 8400, - "items_discount_amount": 209300, - "total_discount_amount": 217700, - "total_amount": 19600, - "items_applied_discount_amount": 209300, - "total_applied_discount_amount": 209300, - "items": [ - { - "object": "order_item", - "source_id": "A0E20000000295J", - "related_object": "sku", - "product_id": "prod_0b661d31134b299cc2", - "quantity": 1, - "amount": 9500, - "price": 9500, - "subtotal_amount": 9500, - "product": { - "id": "prod_0b661d31134b299cc2", - "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", - "name": "Keychain D‘Amico" - }, - "sku": { - "id": "sku_0b661d6265cb29ae52", - "source_id": "A0E20000000295J", - "sku": "Keychain D‘Amico", - "metadata": {}, - "price": 9500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000EAT6", - "related_object": "sku", - "quantity": 1, - "amount": 18500, - "price": 18500, - "subtotal_amount": 18500, - "product": { - "name": "Jogging pants Paolo Pecora light grey" - }, - "sku": { - "sku": "Jogging pants Paolo Pecora light grey", - "metadata": {} - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f7", - "quantity": 3, - "discount_quantity": 3, - "initial_quantity": 0, - "amount": 89700, - "discount_amount": 89700, - "initial_amount": 0, - "applied_discount_amount": 89700, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f7", - "source_id": "M0E20000000ELDG", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f6", - "quantity": 4, - "discount_quantity": 4, - "initial_quantity": 0, - "amount": 119600, - "discount_amount": 119600, - "initial_amount": 0, - "applied_discount_amount": 119600, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f6", - "source_id": "M0E20000000ELDF", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 76100, + "initial_amount": 72100, + "items_discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 72100, + "items_applied_discount_amount": 4000, + "total_applied_discount_amount": 4000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 } - ], - "metadata": {}, - "customer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" }, - "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bb9c69ca9d5a364b2": { - "date": "2022-09-21T13:09:25.799Z", - "related_object_type": "redemption", - "related_object_id": "r_0bb9c69ca9d5a364b2", - "stacked": [ - "r_0bb9c69ca9d5a364b3", - "r_0bb9c69ca9d5a364b4" - ] + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 } - } - }, - "code": "Test - Discount - Unit - Multiple - Product Variants", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 3, - "unit_type": "sku_0b661e41fc8d35a8f7", - "sku": { - "id": "sku_0b661e41fc8d35a8f7", - "source_id": "M0E20000000ELDG", - "sku": "Casual jacket Michael Kors beige" - }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } - }, - { - "effect": "ADD_NEW_ITEMS", - "unit_off": 4, - "unit_type": "sku_0b661e41fc8d35a8f6", - "sku": { - "id": "sku_0b661e41fc8d35a8f6", - "source_id": "M0E20000000ELDF", - "sku": "Casual jacket Michael Kors beige" - }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 } - ] - }, - "metadata": {} - } - }, - "Unit - Add order items": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "ssn_K7DV3RbAGNCRVrPNZxJfld3FdwAQwOGl", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "id": "ord_FDdsDI3FppuiqHa4s7drZEMP", - "source_id": "47f491d1-a697-4f92-95ca-2ba1f463efa8", - "created_at": "2022-09-21T13:09:25.773Z", - "updated_at": "2022-09-21T13:09:27.139Z", - "status": "PAID", - "amount": 117700, - "initial_amount": 28000, - "discount_amount": 8400, - "items_discount_amount": 89700, - "total_discount_amount": 98100, - "total_amount": 19600, - "items_applied_discount_amount": 89700, - "total_applied_discount_amount": 89700, - "items": [ - { - "object": "order_item", - "source_id": "A0E20000000295J", - "related_object": "sku", - "product_id": "prod_0b661d31134b299cc2", - "quantity": 1, - "amount": 9500, - "price": 9500, - "subtotal_amount": 9500, - "product": { - "id": "prod_0b661d31134b299cc2", - "source_id": "2c446063-d582-4d7e-9651-23971b3e56f7", - "name": "Keychain D‘Amico" - }, - "sku": { - "id": "sku_0b661d6265cb29ae52", - "source_id": "A0E20000000295J", - "sku": "Keychain D‘Amico", - "metadata": {}, - "price": 9500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000EAT6", - "related_object": "sku", - "quantity": 1, - "amount": 18500, - "price": 18500, - "subtotal_amount": 18500, - "product": { - "name": "Jogging pants Paolo Pecora light grey" - }, - "sku": { - "sku": "Jogging pants Paolo Pecora light grey", - "metadata": {} - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "sku_id": "sku_0b661e41fc8d35a8f8", - "quantity": 3, - "discount_quantity": 3, - "initial_quantity": 0, - "amount": 89700, - "discount_amount": 89700, - "initial_amount": 0, - "applied_discount_amount": 89700, - "price": 29900, - "subtotal_amount": 0, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 } - ], - "metadata": {}, - "customer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" }, - "customer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bb9c69ca9d5a364b2": { - "date": "2022-09-21T13:09:25.799Z", - "related_object_type": "redemption", - "related_object_id": "r_0bb9c69ca9d5a364b2", - "stacked": [ - "r_0bb9c69ca9d5a364b3", - "r_0bb9c69ca9d5a364b4" - ] + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 } - } - }, - "code": "Test - Discount - Unit - Add new order items", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 3, - "unit_type": "sku_0b661e41fc8d35a8f8", - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige" }, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - } - }, - "metadata": {} - } - }, - "Fixed": { - "value": { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "strict": false, - "price": 2000, - "price_formula": "IF(ORDER_AMOUNT > 400;0;20)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "products_collection", - "id": "pc_2KWKXn09Dk8neCfymqd4xOq8", - "strict": false, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "products_collection", - "id": "pc_x7HELQo52g2uI6nDuuOTRjAW", - "strict": false, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 200;ORDER_ITEM_PRICE * 0.9;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "strict": true, - "price": 99900, - "price_formula": "IF(ORDER_AMOUNT > 300;ORDER_ITEM_PRICE * 0.8;ORDER_ITEM_PRICE)", - "effect": "APPLY_TO_EVERY" + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 } - ], - "total": 7, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "ssn_u8rvi3Ac70S5ZRELWrxYsR2bnolpVWNg", - "type": "LOCK", - "ttl": 7, - "ttl_unit": "DAYS" - }, - "order": { - "amount": 46500, - "items_discount_amount": 9300, - "total_discount_amount": 9300, - "total_amount": 37200, - "items_applied_discount_amount": 9300, - "total_applied_discount_amount": 9300, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "discount_amount": 1300, - "applied_discount_amount": 1300, - "price": 6500, - "subtotal_amount": 5200, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "discount_amount": 600, - "applied_discount_amount": 600, - "price": 6000, - "subtotal_amount": 5400, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "discount_amount": 2000, - "applied_discount_amount": 2000, - "price": 2000, - "subtotal_amount": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 5000, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "discount_amount": 4400, - "applied_discount_amount": 4400, - "price": 11000, - "subtotal_amount": 17600, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } + }, + { + "object": "order_item", + "product_id": "prod_0b72b00ffed198e344", + "quantity": 8, + "discount_quantity": 8, + "initial_quantity": 0, + "amount": 4000, + "discount_amount": 4000, + "initial_amount": 0, + "applied_discount_amount": 4000, + "price": 500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b00ffed198e344", + "source_id": "roses_1", + "name": "Bouquet - Romantic Roses", + "price": 500 } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "SPENDMOREGETMORE-DaIXFJvn", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" - }, + } + ], "metadata": { - "shoutout": "Order more than 200€ to get 10% off pants, more than 300€ to get 20% off sweaters, and more than 400€ to get free shipping." - }, - "campaign": "SPENDMOREGETMORE", - "campaign_id": "camp_Nwb2mppeDTtk23s1FVo6riwp" - } - }, - "Voucher expired": { - "value": { - "valid": false, - "reason": "voucher expired", - "error": { - "code": 400, - "key": "voucher_expired", - "message": "voucher expired", - "details": "EarlyBird-tB6zCApA", - "request_id": "v-0be43067028abb6ca8" + "payment_mean": [ + "credit-card" + ] }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "code": "EarlyBird-tB6zCApA", - "metadata": { - "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_nGr1SWuy9vduABkbbJkl8cHb", + "name": "Add new order items", + "banner": "Add Romantic Roses", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 8, + "unit_type": "prod_0b72b00ffed198e344", + "product": { + "id": "prod_0b72b00ffed198e344", + "source_id": "roses_1", + "name": "Bouquet - Romantic Roses" } - } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 4000, + "applied_discount_amount": 4000, + "metadata": {}, + "object": "promotion_tier" }, - "Percentage": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "session": { - "key": "your_custom_key", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 46500, - "discount_amount": 4650, - "total_discount_amount": 4650, - "total_amount": 41850, - "applied_discount_amount": 4650, - "total_applied_discount_amount": 4650, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 78100, + "initial_amount": 72100, + "items_discount_amount": 7500, + "total_discount_amount": 7500, + "total_amount": 70600, + "items_applied_discount_amount": 7500, + "total_applied_discount_amount": 7500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "EarlyBird-tB6zCApA", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 10 - }, - "expiration_date": "2022-10-29T00:00:00.000Z", - "metadata": { - "shoutout": "Get an early bird special. The earlier you order, the better discount you will get." - }, - "campaign": "Webinar - Early Bird Scenario", - "campaign_id": "camp_z1g3iFqQe5qiZ9TTYFVpMwC0" - } - }, - "Amount": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_4Wb/eeza4PDXKElxYR/QtlDQOVFpY9mP", - "session": { - "key": "your_custom_key", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 46500, - "discount_amount": 1000, - "total_discount_amount": 1000, - "total_amount": 45500, - "applied_discount_amount": 1000, - "total_applied_discount_amount": 1000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping", - "price": 0 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000, - "product": { - "id": "prod_0bd76f59f98617518e", - "source_id": "webinar_BF_sweater_pearl", - "name": "Pearl Sweater", - "price": 11000 - } + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 } - ], - "metadata": { - "currency": "EUR" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "PAYINEUROS", - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 1000 - }, - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." - } - } - }, - "Loyalty points exceeded": { - "value": { - "valid": false, - "reason": "loyalty card points exceeded", - "error": { - "code": 400, - "key": "loyalty_card_points_exceeded", - "message": "loyalty card points exceeded", - "details": "LOYALTY-CARD-ng3Kb9tM", - "request_id": "v-0be434ae35cabb018a" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "LOYALTY-CARD-ng3Kb9tM", - "metadata": {} - } - }, - "Loyalty Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "order": { - "amount": 14500, - "discount_amount": 50, - "total_discount_amount": 50, - "total_amount": 14450, - "applied_discount_amount": 50, - "total_applied_discount_amount": 50, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bd76fc58f8038b043", - "quantity": 1, - "amount": 8500, - "price": 8500, - "subtotal_amount": 8500, - "product": { - "id": "prod_0bd76fc58f8038b043", - "source_id": "webinar_BF_sweater_yellow", - "name": "Yellow Sweater", - "price": 8500 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bd0e204542738", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000, - "product": { - "id": "prod_0bd76bd0e204542738", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "name": "Navy Sweat Pants", - "price": 6000 - } + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "LOYALTY-CARD-ng3Kb9tM", - "loyalty": { - "points_cost": 10 - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy", - "points": 10 - }, - "metadata": {}, - "campaign": "Loyalty Campaign", - "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" - } - }, - "Voucher disabled": { - "value": { - "valid": false, - "reason": "voucher is disabled", - "error": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "GIFT-CARD-kW4aEsfB", - "request_id": "v-0be43817d7121a437d" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "GIFT-CARD-kW4aEsfB", - "metadata": {} - } - }, - "Gift Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "order": { - "amount": 1000, - "discount_amount": 2, - "total_discount_amount": 2, - "total_amount": 998, - "applied_discount_amount": 2, - "total_applied_discount_amount": 2, - "metadata": { - "currency": "USD" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "GIFT-CARD-kW4aEsfB", - "gift": { - "amount": 32000, - "balance": 21500, - "effect": "APPLY_TO_ORDER" - }, - "metadata": {}, - "campaign": "Gift Card Campaign", - "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" - } - }, - "Cannot be redeemed by referrer": { - "value": { - "valid": false, - "reason": "voucher cannot be redeemed by referrer", - "error": { - "code": 400, - "key": "referrer_not_permitted_to_redeem", - "message": "voucher cannot be redeemed by referrer", - "details": "REFERRAL-CODE-OxBakPYf", - "request_id": "v-0be43a8a110abb1bd3" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "code": "REFERRAL-CODE-OxBakPYf", - "metadata": {} - } - }, - "Referral Code": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", - "order": { - "amount": 20000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 14000, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "metadata": { - "currency": "USD" + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } }, - "referrer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 5, + "discount_quantity": 5, + "initial_quantity": 1, + "amount": 7500, + "discount_amount": 7500, + "initial_amount": 1500, + "applied_discount_amount": 7500, + "price": 1500, + "subtotal_amount": 0, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, - "customer_id": null, - "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "order" - }, - "code": "REFERRAL-CODE-OxBakPYf", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 30 + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] }, - "metadata": {}, - "campaign": "Referral Campaign", - "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" - } - } - } - } - } - }, - "400": { - "description": "Returns an error if request body is missing parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error" - }, - "examples": { - "Missing reward": { - "value": { - "code": 400, - "key": "missing_reward", - "message": "Missing reward", - "details": "A reward is required when redeeming a LOYALTY_CARD", - "request_id": "v-0bcb925c6d90f7f8fc", - "error": { - "message": "Missing reward = please add one." - } - } - }, - "Missing Parameter": { - "value": { - "code": 400, - "key": "missing_order_items_amount", - "message": "Missing applicable order items", - "details": "At least one applicable order item with amount is required to redeem this GIFT_VOUCHER", - "request_id": "v-0bcccfd04085cf2540", - "error": { - "message": "Request should contain an amount for the item." + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae", + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage" } - } - }, - "Metadata Validation Failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "location_id: must be an array, and every element: must be a string, must be equal to one of L1,L2,L3 (actual value is 'L1')", - "request_id": "v-0bcced27715305d3fa" - } - } - } - } - } - } - } - } - }, - "/client/v1/validate": { - "get": { - "operationId": "validate-voucher-client-side", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Voucher (client-side) [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher validation, and we do not recommend using it. The new [Stackable Discounts API](ref:validate-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify a voucher code given by customer, you can use this method. It is designed for client side integration which means that is accessible only through public keys. This method is designed to be run directly either in web browsers or mobile apps.\n\n> ❗️ Specifying gift credits and loyalty points\n>\n> This endpoint does not support specifying the specific amount of gift credits to apply to an order nor the specific amount of loyalty points to an order. It calculates the amount that is available on the card and applies as much credits or points as possible to cover the total amount. \n\n### Set customer identity (optional)\n\nVoucherify can help you track anonymous customers. Once you integrate Voucherify into your web app and call the validate method, Voucherify will return a tracking ID and the script will store it in a cookie. Each subsequent validate call will use the same tracking ID.\n\nVoucherify tracks a user using a tracking ID to see if the user who is validating vouchers is the same as the one who consuming them. Voucherify does this by setting up an identity for the user. A `tracking_id` will be generated on the server side, unless you specify your own `tracking_id`. In both cases, you will receive the `tracking_id` in the validation response.\n\nThe returned `tracking_id` field should be used as the customer `source_id` in subsequent redemption requests. Moreover, the `tracking_id` returned from Validation API is encoded. Voucherify will recognize both values for identifying customer - the one before encryption sent as a query parameter to the **GET** `/validate` request, and the version encrypted and returned as part of the validation request.\n\n### Sample workflow\n\nCustomer tracking workflow in a nutshell:\n\n**Client-side:**\n * A customer visits your website.\n * A customer validates a voucher code. That triggers a validate request to be sent to Voucherify. In the request, you pass the tracking_id or customer.source_id. As a result, the API call to this endpoint returns an **encoded** `tracking_id`.\n\n**Backend:**\n * Once the customer finishes the checkout process, your website passes the `tracking_id` to your backend during a redemption call. The `tracking_id` is sent as a value assigned to the property *source_id* in a customer object.\n * A customer object is created and within the redemption response, you get a customer `id`.\n * You can use the customer `id` or the customer `source_id` to fetch or modify the customer details.\n \nA customer is created (upserted) automatically with a redemption call. Alternatively, you can create a new profile by creating a customer via a dedicated API method. Take a look at the customer object to understand the [entity's structure](ref:get-customer). \n\n\n\n> 📘 Customer identifier\n>\n> The source id of the customer may either be an already hashed version of the `tracking_id`, which you received in a response from a validation request or a custom ID you predefined (i.e. an email address). Nevertheless, we recommend using identifiers delivered by Voucherify API.\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=PAYINEUROS&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer=cust_4vMj8Twr5nBzvTrNCgipMb6M&[order][metadata][currency]=EUR&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=LOYALTY-CARD-ng3Kb9tM&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=GIFT-CARD-kW4aEsfB&session_type=LOCK&session_key=A&session_ttl=1&session_ttl_unit=NANOSECONDS&customer[source_id]=286401dc-6f4c-4ebb-8ca2-9f78b3e84c7d&[order][metadata][currency]=EUR&[customer][metadata][age]=24&[customer][metadata][acquisition_channel]=Facebook&[metadata][location_id][0]=L1&[item][0][source_id]=webinar_BF_sweater_pink_sweater&[item][0][quantity]=2&[item][0][related_object]=product&[item][1][source_id]=webinar_BF_pants_gray_sweat_pants&[item][1][quantity]=2&[item][1][related_object]=product&[item][2][product_id]=prod_0bd76bb4aa003890cb&[item][2][quantity]=2&[item][3][source_id]=M0E20000000ELDH&[item][3][quantity]=3&[item][3][related_object]=sku&[item][4][sku_id]=sku_0b661e41fc0d35a8f1&[item][4][quantity]=4'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -H \"origin: yourdomain.com\" \\\n 'https://api.voucherify.io/client/v1/validate?code=REFERRAL-CODE-OxBakPYf&amount=10000'\n```\n\n### [JSFiddle Example](https://jsfiddle.net/voucherify/gfu2bgn5/)\n\n```javascript\n\n\n\n```\n\n### Examples with Query Parameters\n\n| **Query Parameters** | **Example URL** |\n|:---|:---|\n| Shortcut - `customer` query param instead of `customer[source_id]` | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=customer_id` |\n| Pass `customer`'s and `redemption`'s context `metadata` in query parameters | `https://api.voucherify.io/client/v1/validate?code=sKKFCKLZ&amount=10100&customer=sure_he_is_new&metadata[shop]=1&customer[metadata][propsy]=2&metadata[test]=true` |\n| Use `tracking_id` instead of `source_id` | `https://api.voucherify.io/client/v1/validate?code=IKU-mvS-JOG&amount=10100&tracking_id=sure_he_is_new_5&metadata[shop]=1&metadata[test]=true` |\n\n### Reasons why a validation might fail\n\nVoucher validation might fail because of one of these reasons:\n\n* `voucher not found` - voucher doesn't exist or was [deleted](ref:delete-voucher)\n* `voucher expired` - voucher is out of [start date - expiration date] timeframe\n* `voucher is disabled` - learn more about [disabled vouchers](ref:disable-voucher)\n* `customer does not match segment rules` - learn more customer tracking LINK\n* `order does not match validation rules` - learn more about validation rules LINK", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - }, - { - "schema": { - "type": "string", - "example": "7fjWdr" - }, - "in": "query", - "name": "code", - "description": "A code that identifies the voucher." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that validated the voucher. This identifier is generated during voucher validation based on your internal ID (e.g., email, database ID) during the first request. This is a hashed customer source ID. If the request is performed for the first time, pass the internal ID to track the customer. **Although not all information is required, the extra information helps prevent fraud.**" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "amount", - "description": "A positive integer in the smallest currency unit (that is, 100 cents for $1.00) representing the total amount of the order. This amount is the sum of the order items' amounts." - }, - { - "schema": { - "type": "string", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "in": "query", - "name": "session_key", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated." - }, - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "session_ttl", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session_ttl_unit` parameter." - }, - { - "schema": { - "type": "string", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "in": "query", - "name": "session_ttl_unit", - "description": "Defines the type of unit in which the session time is counted." - }, - { - "$ref": "#/components/parameters/metadata" - }, - { - "$ref": "#/components/parameters/item" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "session_type", - "description": "The session is required to establish a session between multiple parallel validation and redemption requests. This parameter is required to establish a new session. The session locks the **redemption quantity by 1** and additionally the redemption **gift credits** specified within the request for a gift card and the **loyalty points** for a loyalty card." - }, - { - "name": "customer", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "type": "object", - "title": "Customer details", - "description": "Customer source ID and/or customer metadata.", - "properties": { - "source_id": { - "type": "string", - "description": "Customer source ID.", - "example": "name.lastname@email.com" }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs that you can attach to a customer. The metadata object stores all custom attributes assigned to the customer. It can be useful for storing additional information about the customer in a structured format. This metadata can be used for validating whether the customer qualifies for a discount or it can be used in building customer segments.", - "style": "deepObject", - "explode": true - } - }, - "style": "deepObject", - "explode": true - }, - { - "type": "string", - "title": "Customer ID", - "description": "Unique customer ID assigned by Voucherify, i.e. `cust_eWgXlBBiY6THFRJwX45Iakv4`.", - "example": "cust_eWgXlBBiY6THFRJwX45Iakv4" - } - ] - }, - "description": "Customer details." - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "object", - "title": "Order details", - "description": "Order details.", - "properties": { - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the order. A set of key/value pairs that are attached to an order object. Stores additional information about the order in a structured format.", - "style": "deepObject", - "explode": true - } - }, - "style": "deepObject", - "explode": true - }, - "description": "Order details." - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns information whether the voucher is valid in the context of the parameter values provided in the query parameters. Moreover, it returns a hashed source identifier which can be used as tracking ID in future calls. If a validation session is established, then the session details will be returned as well. Read more on [validation sessions](doc:locking-validation-session).", - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher" + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - } - ] - }, - "examples": { - "Wrong customer": { - "value": { - "valid": false, - "reason": "customer does not match validation rules", - "error": { - "message": "Only the gift card owner can apply credits from the gift card to the order." - }, - "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+o", - "code": "GIFT-CARD-kW4aEsfB", - "metadata": {} - } - }, - "Validation Rule Not Satisfied": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Discount Coupon cannot be redeemed because of violated validation rules: val_WuupvE7OVXyo", - "request_id": "v-0be54f4afa0357c12f" - }, - "tracking_id": "track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychk", - "code": "PAYINEUROS", - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." - } - } + "hierarchy": 1, + "discount_amount": 7500, + "applied_discount_amount": 7500, + "metadata": {}, + "object": "promotion_tier" }, - "Validate Discount Coupon": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_rynPcKGW2z7+kd2Vry4p12+Rx2NtyXZyiApdGWEXPrdX+44Fg6LRBQ==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 13000, - "discount_amount": 1000, - "total_discount_amount": 1000, - "total_amount": 12000, - "applied_discount_amount": 1000, - "total_applied_discount_amount": 1000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "order": { + "amount": 72100, + "total_amount": 72100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 } - ], - "metadata": { - "currency": "EUR" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "PAYINEUROS", - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 1000 - }, - "metadata": { - "shoutout": "Pay in euros to get 10 Euros off, any other currency to get 5 off in that currency." - } - } - }, - "Validate Loyalty Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 121700, - "discount_amount": 5000, - "total_discount_amount": 5000, - "total_amount": 116700, - "applied_discount_amount": 5000, - "total_applied_discount_amount": 5000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bb4aa003890cb", - "quantity": 2, - "amount": 9000, - "price": 4500, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76bb4aa003890cb", - "source_id": "webinar_BF_pants_black_sweat_pants", - "name": "Black Sweat Pants", - "price": 4500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000ELDH", - "related_object": "sku", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "quantity": 3, - "amount": 89700, - "price": 29900, - "subtotal_amount": 89700, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 } - ], - "metadata": { - "currency": "EUR" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "LOYALTY-CARD-ng3Kb9tM", - "loyalty": { - "points_cost": 1000 - }, - "reward": { - "id": "rew_4ZF6Y69U2PXE3GLIZxfozgg1", - "assignment_id": "rewa_WkeBlLhj0sRae70J5AAvLbmy" - }, - "metadata": {}, - "campaign": "Loyalty Campaign", - "campaign_id": "camp_ZNb23Xtw1WuGCm7gdax84PUi" - } - }, - "Validate Gift Card": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==", - "session": { - "key": "A", - "type": "LOCK", - "ttl": 1, - "ttl_unit": "NANOSECONDS" - }, - "order": { - "amount": 165700, - "discount_amount": 21500, - "total_discount_amount": 21500, - "total_amount": 144200, - "applied_discount_amount": 21500, - "total_applied_discount_amount": 21500, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 2, - "amount": 13000, - "price": 6500, - "subtotal_amount": 13000, - "product": { - "id": "prod_0bd76ca337954ca116", - "source_id": "webinar_BF_sweater_pink_sweater", - "name": "Pink Sweater", - "price": 6500 - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000, - "product": { - "id": "prod_0bd76b8656956a183f", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "name": "Gray Sweat Pants", - "price": 5000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bd76bb4aa003890cb", - "quantity": 2, - "amount": 9000, - "price": 4500, - "subtotal_amount": 9000, - "product": { - "id": "prod_0bd76bb4aa003890cb", - "source_id": "webinar_BF_pants_black_sweat_pants", - "name": "Black Sweat Pants", - "price": 4500 - } - }, - { - "object": "order_item", - "source_id": "M0E20000000ELDH", - "related_object": "sku", - "product_id": "prod_0b661d4bd2c7ec7d1f", - "quantity": 3, - "amount": 89700, - "price": 29900, - "subtotal_amount": 89700, - "product": { - "id": "prod_0b661d4bd2c7ec7d1f", - "source_id": "facdc58f-ff7c-40c4-a22f-ab0a084a9107", - "name": "Casual jacket Michael Kors beige" - }, - "sku": { - "id": "sku_0b661e41fc8d35a8f8", - "source_id": "M0E20000000ELDH", - "sku": "Casual jacket Michael Kors beige", - "price": 29900 - } + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 }, - { - "object": "order_item", - "product_id": "prod_0b661d4bd347ec7d26", - "sku_id": "sku_0b661e41fc0d35a8f1", - "quantity": 4, - "amount": 44000, - "price": 11000, - "subtotal_amount": 44000, - "product": { - "id": "prod_0b661d4bd347ec7d26", - "source_id": "975193eb-1911-444a-a0f0-f567efce1a8b", - "name": "Pumps ”Flex” Michael Kors black" - }, - "sku": { - "id": "sku_0b661e41fc0d35a8f1", - "source_id": "M0E20000000DMVX", - "sku": "Pumps ”Flex” Michael Kors black", - "price": 11000 - } + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 } - ], - "metadata": { - "currency": "EUR" }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "code": "GIFT-CARD-kW4aEsfB", - "gift": { - "amount": 32000, - "balance": 21500, - "effect": "APPLY_TO_ORDER" - }, - "metadata": {}, - "campaign": "Gift Card Campaign", - "campaign_id": "camp_ZjoZEdmnyUCPYwMPN0IVbvDK" - } - }, - "Validate Referral Code": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_p6hPsnZj2VSvyXDjH9o6aQ==", - "order": { - "amount": 10000, - "discount_amount": 3000, - "total_discount_amount": 3000, - "total_amount": 7000, - "applied_discount_amount": 3000, - "total_applied_discount_amount": 3000, - "items": [], - "metadata": {}, - "referrer": { - "id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "customer" + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, - "customer_id": null, - "referrer_id": "cust_nM4jqPiaXUvQdVSA6vTRUnix", - "object": "order" - }, - "code": "REFERRAL-CODE-OxBakPYf", - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 30 - }, - "metadata": {}, - "campaign": "Referral Campaign", - "campaign_id": "camp_TnOf5NB4Jtjxwoq38WckMJfy" - } - } - } - } - } - }, - "400": { - "description": "Returns an error if missing required parameters or tracking IDs come from the same origin.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Missing customer": { - "value": { - "code": 400, - "key": "missing_customer", - "message": "Missing customer", - "details": "Customer is required to validate rules", - "request_id": "v-0be548ae620abb0a73" - } - }, - "Ambiguous tracking ID": { - "value": { - "code": 400, - "key": "ambiguous_tracking_id", - "message": "Ambiguous trackingId ('track_0nmdnu/6xIb6NTN0Ea40oFmM4wD5QYlxAgKdSn6wh+oychkbEcMNB5RhcTj+zcKBEcGnUZkAXxg=' vs. 'track_Mcg5qK0jIStHAopLoM+nM6ua9crMFQrLt+qSe2YCbmTrTT8932kSlg==')", - "details": "The customer cannot be identified as two different identifiers have been used between requests from same origin.", - "request_id": "v-0be550a5a84abb30f8" - } - } - } - } - } - } - } - } - }, - "/v1/promotions/validation": { - "post": { - "operationId": "validate-promotions", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Promotions [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for qualification, and we do not recommend using it. The new [Qualifications API](ref:examine-qualification) introduces additional features and improvements while maintaining backward compatibility. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nUse this method to get valid promotions for a given customer and order.\n\n### Advanced validation filters\n\nYou can narrow down a validation to a specific promotion ID or tier metadata. Here are the examples of filtering queries you can use:\n\n| **Filter** | **Example** |\n|:---|:---|\n| promotion_id | [filters][promotion_id][conditions][$is]={{campaign_id}} |\n| tier metadata | [filters][metadata.{{promotion tier metadata key}}][conditions][$is]={{promotion tier metadata value}} |\n\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }'/\n 'https://api.voucherify.io/v1/promotions/validation?audienceRulesOnly=true'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n },\n \"metadata\": {\n \"store_names\": \"Store 1 - New York - Broadway\"\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][promotion_id][conditions][$is]=camp_nYcAyjFXmEaBU0nB7EQ4hVTr'\n```\n\n```cURL\ncurl -X GET \\\n -H \"X-Client-Application-Id: 011240bf-d5fc-4ef1-9e82-11eb68c43bf5\" \\\n -H \"X-Client-Token: 9e2230c5-71fb-460a-91c6-fbee64707a20\" \\\n -H \"Content-Type: application/json\" \\\n -d `{\n \"customer\": {\n \"id\": \"cust_gN9KgORZECfdhG9qT6n82Zr7\"\n },\n \"order\": {\n \"items\": [\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9aeddb019a42db\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0a9f9ab4ab019a42d5\",\n \"quantity\": \"1\"\n },\n {\n \"sku_id\": \"sku_0b7d7dfb090be5c619\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b72b0bd64d198e3ae\",\n \"quantity\": 1\n },\n {\n \"product_id\": \"prod_0b7d7c4e814be5c502\",\n \"quantity\": 1\n }\n ],\n \"metadata\":{\n \"payment_mean\": [\"credit-card\"]\n }\n },\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n }`\\\n 'https://api.voucherify.io/v1/promotions/validation?[filters][metadata.has_budget][conditions][$is]=true'\n```", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "audienceRulesOnly", - "description": "If you add a query param AudienceRulesOnly=true, the request will be validated against customer-related rules only, the rest of attached limits and rules will be ignored." - }, - { - "name": "filters", - "in": "query", - "required": false, - "schema": { - "type": "object", - "title": "Promotion filters", - "description": "Promotion filter conditions.", - "properties": { - "metadata": { - "type": "object", - "description": "Allows you to create a filter based on the conditions set for promotion metadata values. The metadata object stores all custom attributes assigned to the promotion tier. A set of key/value pairs that are attached to a promotion tier object. Stores additional information about the promotion tier in a structured format.", - "style": "deepObject", - "explode": true - }, - "promotion_id": { - "type": "object", - "description": "Allows you to create a filter based on the unique promotion ID.", - "style": "deepObject", - "explode": true - } - }, - "style": "deepObject", - "explode": true - }, - "description": "Filter conditions." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the customer and order context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_promotion" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "source-id", + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + } + ], "metadata": { - "key": "value" + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", + "name": "Get", + "banner": "Free shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" } }, - "options": { - "expand": [ - "category" - ] + "campaign": { + "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" }, - "order": { - "amount": 10000, - "items": [ + "hierarchy": 1, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [ { - "product_id": "product-id", - "quantity": "1", - "price": 10000, - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "sku", + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "product_source_id": "Books", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" } - ] + ], + "total": 6, + "data_ref": "data", + "object": "list" }, - "metadata": { - "key": "value" - } - } - }, - "Customer Rules Only": { - "value": { - "customer": { - "id": "cust_gN9KgORZECfdhG9qT6n82Zr7" + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", "order": { + "amount": 72100, + "items_discount_amount": 67300, + "total_discount_amount": 67300, + "total_amount": 4800, + "items_applied_discount_amount": 67300, + "total_applied_discount_amount": 67300, "items": [ { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 + "quantity": 1, + "amount": 3100, + "discount_amount": 2300, + "applied_discount_amount": 2300, + "price": 3100, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } }, { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 + "quantity": 1, + "amount": 1700, + "discount_amount": 900, + "applied_discount_amount": 900, + "price": 1700, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } }, { + "object": "order_item", "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 + "quantity": 1, + "amount": 1500, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 1500, + "subtotal_amount": 800, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { + "object": "order_item", "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 + "quantity": 1, + "amount": 60000, + "discount_amount": 59200, + "applied_discount_amount": 59200, + "price": 60000, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } } ], "metadata": { "payment_mean": [ "credit-card" ] - } + }, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "options": { - "expand": [ - "category" - ] - } + "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", + "name": "Get Amount Off", + "banner": "Every product is worth 8", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "campaign": { + "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 67300, + "applied_discount_amount": 67300, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" } - }, - "Campaign Specific": { - "value": { - "customer": { - "source_id": "test-user@email.com" + ] + } + }, + "Campaign specific": { + "value": { + "valid": true, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", "order": { + "amount": 72100, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 72000, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, "items": [ { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } }, { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } }, { + "object": "order_item", "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { + "object": "order_item", "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } } ], "metadata": { "payment_mean": [ "credit-card" ] - } + }, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "options": { - "expand": [ - "category" - ] + "id": "promo_g83qUzYZpfX0OMAFOVoQuOYG", + "name": "1", + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 100 }, - "metadata": { - "store_names": "Store 1 - New York - Broadway" - } + "campaign": { + "id": "camp_nYcAyjFXmEaBU0nB7EQ4hVTr", + "start_date": null, + "expiration_date": null, + "active": true, + "categories": [ + { + "id": "cat_0b5f66bc97ce5be3c6", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T08:27:14.926Z", + "object": "category" + } + ], + "object": "campaign" + }, + "hierarchy": 1, + "discount_amount": 100, + "applied_discount_amount": 100, + "metadata": {}, + "object": "promotion_tier" } - }, - "Promotion Tier Metadata": { - "value": { - "customer": { - "name": "Joe McDonald", - "email": "joey@email.com", - "source_id": "123_source_id" + ] + } + }, + "Promotion Tier Metadata": { + "value": { + "valid": true, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", + "promotions": [ + { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" }, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", "order": { + "amount": 72100, + "total_amount": 72100, "items": [ { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1 + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1 + "quantity": 1, + "amount": 3100, + "price": 3100, + "subtotal_amount": 3100, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } }, { + "object": "order_item", "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": "1" + "quantity": 1, + "amount": 2900, + "price": 2900, + "subtotal_amount": 2900, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1 + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } }, { + "object": "order_item", "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1 + "quantity": 1, + "amount": 1500, + "price": 1500, + "subtotal_amount": 1500, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { + "object": "order_item", "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1 + "quantity": 1, + "amount": 60000, + "price": 60000, + "subtotal_amount": 60000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } + }, + { + "object": "order_item", + "product_id": "prod_5h1pp1ng", + "quantity": 1, + "discount_quantity": 1, + "initial_quantity": 0, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } } ], "metadata": { "payment_mean": [ "credit-card" ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", + "name": "Get", + "banner": "Free shipping", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" } }, - "options": { - "expand": [ - "category" - ] - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a list of valid promotions for a given context (customer and order). You can then choose which promotion to apply, i.e. the highest discount amount.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_res_validate_promotion" - }, - "examples": { - "Customer Rules Only": { - "value": { - "valid": true, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "promotions": [ + "campaign": { + "id": "camp_wCEdu2igBcyv7CNna9ughGKc", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" + }, + { + "valid": true, + "applicable_to": { + "data": [ { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 9351000, - "initial_amount": 72100, - "items_discount_amount": 9340400, - "total_discount_amount": 9340400, - "total_amount": 10600, - "items_applied_discount_amount": 9340400, - "total_applied_discount_amount": 9340400, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 23, - "discount_quantity": 22, - "initial_quantity": 1, - "amount": 39100, - "discount_amount": 37400, - "initial_amount": 1700, - "applied_discount_amount": 37400, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 222, - "discount_quantity": 222, - "initial_quantity": 1, - "amount": 333000, - "discount_amount": 333000, - "initial_amount": 1500, - "applied_discount_amount": 333000, - "price": 1500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 111, - "discount_quantity": 111, - "initial_quantity": 1, - "amount": 6660000, - "discount_amount": 6660000, - "initial_amount": 60000, - "applied_discount_amount": 6660000, - "price": 60000, - "subtotal_amount": 0, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 11, - "discount_quantity": 11, - "initial_quantity": 0, - "amount": 2310000, - "discount_amount": 2310000, - "initial_amount": 0, - "applied_discount_amount": 2310000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ByIIAHC1Mz9ouJsitzAWsush", - "name": "Multiple", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 11, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" - }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" - } - }, - { - "effect": "ADD_NEW_ITEMS", - "unit_off": 22, - "unit_type": "sku_0b7d7dfb090be5c619", - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1" - }, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1" - } - }, - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 111, - "unit_type": "prod_0b7d7c4e814be5c502", - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12" - } - }, - { - "effect": "ADD_MISSING_ITEMS", - "unit_off": 222, - "unit_type": "prod_0b72b0bd64d198e3ae", - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage" - } - } - ] - }, - "campaign": { - "id": "camp_JtoaZ8Qgpf6FkMAy2wWiOJWH", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "discount_amount": 9340400, - "applied_discount_amount": 9340400, - "metadata": {}, - "object": "promotion_tier" + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "price": 800, + "effect": "APPLY_TO_EVERY" }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 9522100, - "initial_amount": 72100, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 72100, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "name": "Add new SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 45, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" - }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 4, - "discount_amount": 9450000, - "applied_discount_amount": 9450000, - "metadata": {}, - "object": "promotion_tier" + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 109500, - "initial_amount": 72100, - "items_discount_amount": 39100, - "total_discount_amount": 39100, - "total_amount": 70400, - "items_applied_discount_amount": 39100, - "total_applied_discount_amount": 39100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 23, - "discount_quantity": 23, - "initial_quantity": 1, - "amount": 39100, - "discount_amount": 39100, - "initial_amount": 1700, - "applied_discount_amount": 39100, - "price": 1700, - "subtotal_amount": 0, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_NcdD0zLo6FUhKWpNrNuP3Pte", - "name": "Add missing SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 23, - "unit_type": "sku_0b7d7dfb090be5c619", - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1" - }, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 3, - "discount_amount": 39100, - "applied_discount_amount": 39100, - "metadata": {}, - "object": "promotion_tier" + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 76100, - "initial_amount": 72100, - "items_discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 72100, - "items_applied_discount_amount": 4000, - "total_applied_discount_amount": 4000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b00ffed198e344", - "quantity": 8, - "discount_quantity": 8, - "initial_quantity": 0, - "amount": 4000, - "discount_amount": 4000, - "initial_amount": 0, - "applied_discount_amount": 4000, - "price": 500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b00ffed198e344", - "source_id": "roses_1", - "name": "Bouquet - Romantic Roses", - "price": 500 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_nGr1SWuy9vduABkbbJkl8cHb", - "name": "Add new order items", - "banner": "Add Romantic Roses", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 8, - "unit_type": "prod_0b72b00ffed198e344", - "product": { - "id": "prod_0b72b00ffed198e344", - "source_id": "roses_1", - "name": "Bouquet - Romantic Roses" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 2, - "discount_amount": 4000, - "applied_discount_amount": 4000, - "metadata": {}, - "object": "promotion_tier" + "object": "sku", + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "product_source_id": "Books", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 78100, - "initial_amount": 72100, - "items_discount_amount": 7500, - "total_discount_amount": 7500, - "total_amount": 70600, - "items_applied_discount_amount": 7500, - "total_applied_discount_amount": 7500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 5, - "discount_quantity": 5, - "initial_quantity": 1, - "amount": 7500, - "discount_amount": 7500, - "initial_amount": 1500, - "applied_discount_amount": 7500, - "price": 1500, - "subtotal_amount": 0, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae", - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "discount_amount": 7500, - "applied_discount_amount": 7500, - "metadata": {}, - "object": "promotion_tier" + "object": "product", + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "strict": true, + "price": 800, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 6, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", + "order": { + "amount": 72100, + "items_discount_amount": 67300, + "total_discount_amount": 67300, + "total_amount": 4800, + "items_applied_discount_amount": 67300, + "total_applied_discount_amount": 67300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "total_amount": 72100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", - "name": "Get", - "banner": "Free shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "campaign": { - "id": "camp_wCEdu2igBcyv7CNna9ughGKc", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 1, + "amount": 3100, + "discount_amount": 2300, + "applied_discount_amount": 2300, + "price": 3100, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9aeddb019a42db", + "name": "Blue T-Shirt", + "price": 3100 + } }, { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "sku", - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "product_source_id": "Books", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 6, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "items_discount_amount": 67300, - "total_discount_amount": 67300, - "total_amount": 4800, - "items_applied_discount_amount": 67300, - "total_applied_discount_amount": 67300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "discount_amount": 2300, - "applied_discount_amount": 2300, - "price": 3100, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "discount_amount": 900, - "applied_discount_amount": 900, - "price": 1700, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 1500, - "subtotal_amount": 800, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "discount_amount": 59200, - "applied_discount_amount": 59200, - "price": 60000, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", - "name": "Get Amount Off", - "banner": "Every product is worth 8", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" - }, - "campaign": { - "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 2, - "discount_amount": 67300, - "applied_discount_amount": 67300, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" - } - ] - } - }, - "Campaign specific": { - "value": { - "valid": true, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "promotions": [ + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 2900, + "discount_amount": 2100, + "applied_discount_amount": 2100, + "price": 2900, + "subtotal_amount": 800, + "product": { + "id": "prod_0a9f9ab4ab019a42d5", + "name": "Red T-Shirt", + "price": 2900 + } + }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "order": { - "amount": 72100, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 72000, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_g83qUzYZpfX0OMAFOVoQuOYG", - "name": "1", - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 100 - }, - "campaign": { - "id": "camp_nYcAyjFXmEaBU0nB7EQ4hVTr", - "start_date": null, - "expiration_date": null, - "active": true, - "categories": [ - { - "id": "cat_0b5f66bc97ce5be3c6", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T08:27:14.926Z", - "object": "category" - } - ], - "object": "campaign" + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "discount_amount": 900, + "applied_discount_amount": 900, + "price": 1700, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 }, - "hierarchy": 1, - "discount_amount": 100, - "applied_discount_amount": 100, - "metadata": {}, - "object": "promotion_tier" - } - ] - } - }, - "Promotion Tier Metadata": { - "value": { - "valid": true, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "promotions": [ + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "order": { - "amount": 72100, - "total_amount": 72100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "price": 3100, - "subtotal_amount": 3100, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "price": 2900, - "subtotal_amount": 2900, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "price": 1500, - "subtotal_amount": 1500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "price": 60000, - "subtotal_amount": 60000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - }, - { - "object": "order_item", - "product_id": "prod_5h1pp1ng", - "quantity": 1, - "discount_quantity": 1, - "initial_quantity": 0, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_jp2l6wRcTL4cARG5E8XRo42A", - "name": "Get", - "banner": "Free shipping", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - "campaign": { - "id": "camp_wCEdu2igBcyv7CNna9ughGKc", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 1500, + "subtotal_amount": 800, + "product": { + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 + } }, { - "valid": true, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "sku", - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "product_source_id": "Books", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "strict": true, - "price": 800, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 6, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_oNgl7cQ8tVTg/fIVul/GKA==", - "order": { - "amount": 72100, - "items_discount_amount": 67300, - "total_discount_amount": 67300, - "total_amount": 4800, - "items_applied_discount_amount": 67300, - "total_applied_discount_amount": 67300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 1, - "amount": 3100, - "discount_amount": 2300, - "applied_discount_amount": 2300, - "price": 3100, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9aeddb019a42db", - "name": "Blue T-Shirt", - "price": 3100 - } - }, - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 2900, - "discount_amount": 2100, - "applied_discount_amount": 2100, - "price": 2900, - "subtotal_amount": 800, - "product": { - "id": "prod_0a9f9ab4ab019a42d5", - "name": "Red T-Shirt", - "price": 2900 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "discount_amount": 900, - "applied_discount_amount": 900, - "price": 1700, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 1500, - "subtotal_amount": 800, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 60000, - "discount_amount": 59200, - "applied_discount_amount": 59200, - "price": 60000, - "subtotal_amount": 800, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000 - } - } - ], - "metadata": { - "payment_mean": [ - "credit-card" - ] - }, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", - "name": "Get Amount Off", - "banner": "Every product is worth 8", - "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS" - }, - "campaign": { - "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 2, - "discount_amount": 67300, - "applied_discount_amount": 67300, - "metadata": { - "has_budget": true, - "audience_restricted": false - }, - "object": "promotion_tier" + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 60000, + "discount_amount": 59200, + "applied_discount_amount": 59200, + "price": 60000, + "subtotal_amount": 800, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000 + } } - ] - } + ], + "metadata": { + "payment_mean": [ + "credit-card" + ] + }, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_WEloFBBJ8JJDCxrtR1FPy6t1", + "name": "Get Amount Off", + "banner": "Every product is worth 8", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ITEMS" + }, + "campaign": { + "id": "camp_Ds2u0MSFGuKhDuR3jEa5dHBx", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 2, + "discount_amount": 67300, + "applied_discount_amount": 67300, + "metadata": { + "has_budget": true, + "audience_restricted": false + }, + "object": "promotion_tier" } - } + ] } } } } } + } + } + } + }, + "/v1/promotions/tiers/{tierId}/validation": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/promotions/tiers/{tierId}/validation": { - "parameters": [ - { - "schema": { - "type": "string" + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique promotion tier ID." + } + ], + "post": { + "operationId": "validate-promotion-tier", + "deprecated": true, + "tags": [ + "VALIDATIONS API" + ], + "summary": "Validate Promotion Tier [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify whether the promotion tier discount can be applied to an order. This method is designed for server side integration which means that it is accessible only through private keys.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the customer and order context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_req_validate_promotion_tier" + }, + "examples": { + "Using IDs": { + "value": { + "customer": { + "source_id": "test-user@email.io" + }, + "order": { + "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS" + } + } }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique promotion tier ID." - } - ], - "post": { - "operationId": "validate-promotion-tier", - "deprecated": true, - "tags": [ - "VALIDATIONS API" - ], - "summary": "Validate Promotion Tier [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo verify whether the promotion tier discount can be applied to an order. This method is designed for server side integration which means that it is accessible only through private keys.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the customer and order context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_req_validate_promotion_tier" + "Using Redemption Metadata": { + "value": { + "customer": { + "source_id": "test-user@email.com" }, - "examples": { - "Using IDs": { - "value": { - "customer": { - "source_id": "test-user@email.io" - }, - "order": { - "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS" - } - } - }, - "Using Redemption Metadata": { - "value": { - "customer": { - "source_id": "test-user@email.com" - }, - "order": { - "amount": 200000, - "items": [ - { - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2 - }, - { - "sku_id": "sku_0KtP4rvwEECQ2U", - "related_object": "sku", - "quantity": 1 - } - ] - }, - "metadata": { - "store_names": "Store 1 - New York - Broadway" - } + "order": { + "amount": 200000, + "items": [ + { + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2 + }, + { + "sku_id": "sku_0KtP4rvwEECQ2U", + "related_object": "sku", + "quantity": 1 } - } + ] + }, + "metadata": { + "store_names": "Store 1 - New York - Broadway" } } } - }, - "responses": { - "200": { - "description": "Returns validation result in `valid` key of the promotion tier object. Returns `true` if the promotion tier rules and validation rules are satisfied given the request body parameters. Returns `false` if the data provided in the payload does not meet validation rules or promotion tier requirements.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/6_res_validate_promotion_tier" - }, - "examples": { - "Promotion Valid": { - "value": { - "valid": true, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "tracking_id": "track_OWyBVb1mg1qnieLLNygh19A0Ia7FsJck", - "order": { - "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS", - "source_id": null, - "created_at": "2022-11-17T12:17:55.096Z", - "updated_at": null, - "status": "CREATED", - "amount": 9918200, - "initial_amount": 468200, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 468200, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pink_sweater", - "related_object": "product", - "quantity": 1, - "amount": 6500, - "price": 6500, - "subtotal_amount": 6500 - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_navy_sweat_pants", - "related_object": "product", - "quantity": 1, - "amount": 6000, - "price": 6000, - "subtotal_amount": 6000 - }, - { - "object": "order_item", - "source_id": "5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 2000, - "price": 2000, - "subtotal_amount": 2000, - "product": { - "id": "prod_5h1pp1ng", - "source_id": "5h1pp1ng", - "name": "Shipping" - } - }, - { - "object": "order_item", - "source_id": "webinar_BF_pants_gray_sweat_pants", - "related_object": "product", - "quantity": 2, - "amount": 10000, - "price": 5000, - "subtotal_amount": 10000 - }, - { - "object": "order_item", - "source_id": "webinar_BF_sweater_pearl", - "related_object": "product", - "quantity": 2, - "amount": 22000, - "price": 11000, - "subtotal_amount": 22000 - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1700 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae32322150fd0546", - "quantity": 2, - "amount": 420000, - "price": 210000, - "subtotal_amount": 420000, - "product": { - "id": "prod_0bae32322150fd0546", - "name": "Samsung Phone", - "price": 210000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "name": "Add new SKU", - "discount": { - "type": "UNIT", - "effect": "ADD_NEW_ITEMS", - "unit_off": 45, - "unit_type": "sku_0bae3b28f610fd0da1", - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB" - }, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1" - } - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" + } + } + } + }, + "responses": { + "200": { + "description": "Returns validation result in `valid` key of the promotion tier object. Returns `true` if the promotion tier rules and validation rules are satisfied given the request body parameters. Returns `false` if the data provided in the payload does not meet validation rules or promotion tier requirements.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/6_res_validate_promotion_tier" + }, + "examples": { + "Promotion Valid": { + "value": { + "valid": true, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "tracking_id": "track_OWyBVb1mg1qnieLLNygh19A0Ia7FsJck", + "order": { + "id": "ord_71uW6qnB5CFZlLHCeCNC4qtS", + "source_id": null, + "created_at": "2022-11-17T12:17:55.096Z", + "updated_at": null, + "status": "CREATED", + "amount": 9918200, + "initial_amount": 468200, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 468200, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, + "items": [ + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pink_sweater", + "related_object": "product", + "quantity": 1, + "amount": 6500, + "price": 6500, + "subtotal_amount": 6500 + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_navy_sweat_pants", + "related_object": "product", + "quantity": 1, + "amount": 6000, + "price": 6000, + "subtotal_amount": 6000 + }, + { + "object": "order_item", + "source_id": "5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 2000, + "price": 2000, + "subtotal_amount": 2000, + "product": { + "id": "prod_5h1pp1ng", + "source_id": "5h1pp1ng", + "name": "Shipping" + } + }, + { + "object": "order_item", + "source_id": "webinar_BF_pants_gray_sweat_pants", + "related_object": "product", + "quantity": 2, + "amount": 10000, + "price": 5000, + "subtotal_amount": 10000 + }, + { + "object": "order_item", + "source_id": "webinar_BF_sweater_pearl", + "related_object": "product", + "quantity": 2, + "amount": 22000, + "price": 11000, + "subtotal_amount": 22000 + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100 }, - "hierarchy": 4, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1700 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae32322150fd0546", + "quantity": 2, + "amount": 420000, + "price": 210000, + "subtotal_amount": 420000, + "product": { + "id": "prod_0bae32322150fd0546", + "name": "Samsung Phone", + "price": 210000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, "discount_amount": 9450000, + "initial_amount": 0, "applied_discount_amount": 9450000, - "metadata": {}, - "object": "promotion_tier" - } - }, - "Promotion Invalid with Error Message": { - "value": { - "valid": false, - "reason": "redemption does not match validation rules", - "error": { - "code": 400, - "key": "redemption_rules_violated", - "message": "redemption does not match validation rules", - "details": "Promotion Tier cannot be redeemed because of violated validation rules: val_eqSA1dXOv491", - "request_id": "v-0c034585fd16cf6958" - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae" - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true - }, - "object": "promotion_tier" + "price": 210000, + "subtotal_amount": 0, + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 + } } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "name": "Add new SKU", + "discount": { + "type": "UNIT", + "effect": "ADD_NEW_ITEMS", + "unit_off": 45, + "unit_type": "sku_0bae3b28f610fd0da1", + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB" }, - "Promotion Invalid with Custom Message": { - "value": { - "valid": false, - "reason": "Inactive Promotion", - "error": { - "message": "Promotion is inactive this weekend." - }, - "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", - "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", - "name": "Add missing order items", - "banner": "Add Boho Vintage", - "discount": { - "type": "UNIT", - "effect": "ADD_MISSING_ITEMS", - "unit_off": 5, - "unit_type": "prod_0b72b0bd64d198e3ae" - }, - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks", - "start_date": null, - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "hierarchy": 1, - "metadata": { - "has_budget": true - }, - "object": "promotion_tier" - } + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1" } - } + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 4, + "discount_amount": 9450000, + "applied_discount_amount": 9450000, + "metadata": {}, + "object": "promotion_tier" + } + }, + "Promotion Invalid with Error Message": { + "value": { + "valid": false, + "reason": "redemption does not match validation rules", + "error": { + "code": 400, + "key": "redemption_rules_violated", + "message": "redemption does not match validation rules", + "details": "Promotion Tier cannot be redeemed because of violated validation rules: val_eqSA1dXOv491", + "request_id": "v-0c034585fd16cf6958" + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae" + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true + }, + "object": "promotion_tier" + } + }, + "Promotion Invalid with Custom Message": { + "value": { + "valid": false, + "reason": "Inactive Promotion", + "error": { + "message": "Promotion is inactive this weekend." + }, + "tracking_id": "track_OWyBVb1mg1oMY1lADmgwuXCw/qYHp5h0", + "id": "promo_R50x0A66V6jmPhM7YYOcFZfL", + "name": "Add missing order items", + "banner": "Add Boho Vintage", + "discount": { + "type": "UNIT", + "effect": "ADD_MISSING_ITEMS", + "unit_off": 5, + "unit_type": "prod_0b72b0bd64d198e3ae" + }, + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks", + "start_date": null, + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "hierarchy": 1, + "metadata": { + "has_budget": true + }, + "object": "promotion_tier" } } } } } - }, - "/v1/redemption-object": { - "get": { - "operationId": "redemption-object", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redemption Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Redemption Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_obj_redemption_object" - } - } - } + } + } + } + }, + "/v1/redemption-object": { + "get": { + "operationId": "redemption-object", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redemption Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Redemption Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_redemption_object" } } } - }, - "/v1/rollback-redemption-object": { - "get": { - "operationId": "rollback-redemption-object", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Rollback Redemption Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Rollback Redemption Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended" - } - } - } + } + } + } + }, + "/v1/rollback-redemption-object": { + "get": { + "operationId": "rollback-redemption-object", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Rollback Redemption Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Rollback Redemption Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_rollback_redemption_object_extended" } } } - }, - "/v1/stackable-redemptions-object": { - "get": { - "operationId": "stackable-redemptions-object", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Stackable Redemptions Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Stackable Redemptions Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" - } - } - } + } + } + } + }, + "/v1/stackable-redemptions-object": { + "get": { + "operationId": "stackable-redemptions-object", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Stackable Redemptions Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Stackable Redemptions Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" } } } + } + } + } + }, + "/v1/redemptions": { + "get": { + "operationId": "list-redemptions", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "List Redemptions", + "description": "Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. \n\n## Filtering results\nThe result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date:\n`https://api.voucherify.io/v1/redemptions?limit=3&[created_at][before]=2017-09-08T13:52:18.227Z`. A filter based on the object `created_at` field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: `[created_at][after]`, `[created_at][before]`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`.\n\n## Failed Redemptions\n\nA redemption may fail for various reasons. You can figure out an exact reason from the `failure_code`:\n- `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "/v1/redemptions": { - "get": { - "operationId": "list-redemptions", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "List Redemptions", - "description": "Returns a list of redemptions previously created. The redemptions are returned in a sorted order, with the most recent redemptions appearing first. The response returns a list of redemptions of all vouchers. \n\n## Filtering results\nThe result can be narrowed according to specified (or default) filters, for example, you can sort redemptions by date:\n`https://api.voucherify.io/v1/redemptions?limit=3&[created_at][before]=2017-09-08T13:52:18.227Z`. A filter based on the object `created_at` field narrows down the results and lists redemptions done before or after a particular date time. You can use the following options: `[created_at][after]`, `[created_at][before]`. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). An example: `[created_at][before]=2017-09-08T13:52:18.227Z`.\n\n## Failed Redemptions\n\nA redemption may fail for various reasons. You can figure out an exact reason from the `failure_code`:\n- `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "result", - "description": "A filter on the list based on the redemption result. Available options are: `SUCCESS`, `FAILURE`. You can provide multiple values by repeating the param." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign", - "description": "A filter by the campaign **name** that the redemption resources originate from." - }, - { - "schema": { - "type": "string", - "example": "cust_IkrTR674vvQvr9a4rDMiqglY" - }, - "in": "query", - "name": "customer", - "description": "Return redemptions performed by the customer with given `id`." - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "id", - "-id", - "voucher_code", - "-voucher_code", - "tracking_id", - "-tracking_id", - "customer_id", - "-customer_id" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "result", + "description": "A filter on the list based on the redemption result. Available options are: `SUCCESS`, `FAILURE`. You can provide multiple values by repeating the param." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign", + "description": "A filter by the campaign **name** that the redemption resources originate from." + }, + { + "schema": { + "type": "string", + "example": "cust_IkrTR674vvQvr9a4rDMiqglY" + }, + "in": "query", + "name": "customer", + "description": "Return redemptions performed by the customer with given `id`." + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "id", + "-id", + "voucher_code", + "-voucher_code", + "tracking_id", + "-tracking_id", + "customer_id", + "-customer_id" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "name": "filters", + "in": "query", + "schema": { + "type": "object", + "properties": { + "voucher_code": { + "type": "object", + "description": "Unique voucher code.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } }, - { - "$ref": "#/components/parameters/created_at" + "related_object_id": { + "type": "object", + "description": "Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } }, - { - "name": "filters", - "in": "query", - "schema": { - "type": "object", - "properties": { - "voucher_code": { - "type": "object", - "description": "Unique voucher code.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "related_object_id": { - "type": "object", - "description": "Unique related object ID, i.e. v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "related_object_parent_id": { - "type": "object", - "description": "Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "parent_redemption_id": { - "type": "object", - "description": "Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "failure_code": { - "type": "object", - "description": "Failure code, i.e. quantity_exceeded.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "result": { - "type": "object", - "description": "Result, i.e. `SUCCESS` or `FAILURE`.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "object": { - "type": "object", - "description": "Specify which type of object to return, i.e. `redemption` or `redemption_rollback`.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "customer_id": { - "type": "object", - "description": "Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "campaign_name": { - "type": "object", - "description": "Campaign name.", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - }, - "user_login": { - "type": "object", - "description": "User login used to login to Voucherify, i.e. name.lastname@email.com", - "style": "deepObject", - "explode": true, - "properties": { - "conditions": { - "$ref": "#/components/schemas/7_filter_conditions_string" - }, - "junction": { - "$ref": "#/components/schemas/16_filter_junction" - } - } - } + "related_object_parent_id": { + "type": "object", + "description": "Unique related object parent ID, i.e. camp_22noMlhTADb7Fq2UL3vWu3d1.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "parent_redemption_id": { + "type": "object", + "description": "Unique parent redemption ID, i.e. r_0c5952900bcbfd54b6.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } - }, - "description": "Filters for listing responses.", + } + }, + "failure_code": { + "type": "object", + "description": "Failure code, i.e. quantity_exceeded.", "style": "deepObject", - "explode": true - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of redemption objects. Each entry in the array is a separate redemption object. If no more redemptions are available, the resulting array will be empty. If you provide a non-existent customer ID, this call returns an empty object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_list_redemptions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "redemptions", - "redemptions": [ - { - "id": "r_0c0469eaf705889d99", - "object": "redemption", - "date": "2022-11-18T12:30:32.622Z", - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulhyMBo7VratI", - "metadata": { - "store_names": "Store 2 - Florida - Miami" - }, - "result": "SUCCESS", - "order": { - "id": "ord_ndw5rQJt12zvZ4upF72a3ljh", - "source_id": null, - "created_at": "2022-11-18T12:30:31.338Z", - "updated_at": null, - "status": "PAID", - "amount": 9680000, - "items_discount_amount": 9450000, - "total_discount_amount": 9450000, - "total_amount": 230000, - "items_applied_discount_amount": 9450000, - "total_applied_discount_amount": 9450000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bae2dc5a090fd0184", - "sku_id": "sku_0bae3b28f610fd0da1", - "quantity": 45, - "discount_quantity": 45, - "initial_quantity": 0, - "amount": 9450000, - "discount_amount": 9450000, - "initial_amount": 0, - "applied_discount_amount": 9450000, - "price": 210000, - "subtotal_amount": 0, - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000 - }, - "sku": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", - "price": 210000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "object": "customer" - }, - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c0469eaf705889d99": { - "date": "2022-11-18T12:30:31.388Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "related_object_parent_id": "camp_40LC42P5NFbkkD4RWoJ4btks" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5_a", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "voucher": null, - "promotion_tier": { - "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", - "campaign": { - "id": "camp_40LC42P5NFbkkD4RWoJ4btks" - } - } - }, - { - "id": "r_0bf9cf0a8b12dc5ba6", - "object": "redemption", - "date": "2022-11-10T06:49:03.835Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "amount": 200, - "result": "SUCCESS", - "order": { - "id": "ord_jAifScsbOqxgb12hLu7hXrLU", - "source_id": null, - "created_at": "2022-11-10T06:49:02.703Z", - "updated_at": null, - "status": "PAID", - "amount": 4500, - "discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 500, - "applied_discount_amount": 4000, - "total_applied_discount_amount": 4000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 3, - "amount": 4500, - "price": 1500, - "subtotal_amount": 4500, - "product": { - "id": "prod_0b72b0bd64d198e3ae", - "source_id": "vase_1", - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bf9cf0a8b12dc5ba6": { - "date": "2022-11-10T06:49:02.764Z", - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "related_object_parent_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", - "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "voucher": { - "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "code": "LT1-wMPnRhxb", - "campaign": "Loyalty Campaign - Tiers - 1", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "reward": { - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", - "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 - }, - "object": "customer" - }, - "assignment_id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", - "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "object": "reward", - "name": "100 Points = $20", - "created_at": "2022-09-09T06:41:54.496Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 200 - } - }, - { - "id": "rf_0bf9caf744d2dc593a", - "object": "redemption", - "date": "2022-11-10T06:31:15.477Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "FAILURE", - "failure_code": "loyalty_card_points_exceeded", - "failure_message": "loyalty card points exceeded", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bobby McDonald", - "email": "bobby.mcdonald@email.com", - "source_id": "bobby.mcdonald@email.com", - "metadata": { - "acquisition_channel": "Facebook", - "customer_life_time_value": 100 - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "voucher": { - "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", - "code": "LT1-wMPnRhxb", - "campaign": "Loyalty Campaign - Tiers - 1", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" - } - }, - { - "id": "rf_0bf8c023eb4d4aa4ad", - "object": "redemption", - "date": "2022-11-09T11:05:28.074Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "FAILURE", - "failure_code": "customer_rules_violated", - "failure_message": "customer does not match validation rules", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "source_id": "bob.smith@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "voucher": { - "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "code": "3rqWOTAh", - "campaign_id": null - } - }, - { - "id": "r_0ba9fa02fcd28ed8f1", - "object": "redemption", - "date": "2022-09-09T06:38:20.085Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", - "source_id": null, - "created_at": "2022-09-09T06:38:17.984Z", - "updated_at": null, - "status": "PAID", - "amount": 4600, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 4300, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0a65b3ff8592d7a5b5", - "quantity": 1, - "amount": 3000, - "discount_amount": 300, - "applied_discount_amount": 300, - "price": 3000, - "subtotal_amount": 2700, - "product": { - "id": "prod_0a65b3ff8592d7a5b5", - "name": "Koffee Cup", - "price": 3000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fa02fcd28ed8f1": { - "date": "2022-09-09T06:38:18.099Z", - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "Bob Smith", - "email": "bob.smith@email.com", - "source_id": "bob.smith@email.com", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "voucher": { - "id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "code": "vTcguVLE", - "campaign": "SL-Gift", - "campaign_id": "camp_hC2GdqYtOmTT45zfhib62cK1" - }, - "gift": { - "amount": 300 - } - }, - { - "id": "rf_0bf8bfe0808d4aa473", - "object": "redemption", - "date": "2022-11-09T11:04:19.062Z", - "customer_id": null, - "tracking_id": null, - "metadata": {}, - "result": "FAILURE", - "failure_code": "missing_customer", - "failure_message": "Missing customer", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": null, - "related_object_type": "voucher", - "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "voucher": { - "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", - "code": "3rqWOTAh", - "campaign_id": null - } - } - ], - "total": 6 - } - } - } + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "result": { + "type": "object", + "description": "Result, i.e. `SUCCESS` or `FAILURE`.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "object": { + "type": "object", + "description": "Specify which type of object to return, i.e. `redemption` or `redemption_rollback`.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "customer_id": { + "type": "object", + "description": "Unique customer ID, i.e. cust_sehkNIi8Uq2qQuRqSr7xn4Zi.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "campaign_name": { + "type": "object", + "description": "Campaign name.", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" + } + } + }, + "user_login": { + "type": "object", + "description": "User login used to login to Voucherify, i.e. name.lastname@email.com", + "style": "deepObject", + "explode": true, + "properties": { + "conditions": { + "$ref": "#/components/schemas/7_filter_conditions_string" + }, + "junction": { + "$ref": "#/components/schemas/16_filter_junction" } } } } }, - "post": { - "operationId": "redeem-stacked-discounts", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Redeem Stackable Discounts", - "description": "Use this method to redeem up to 5 redeemables in a single API request.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions). \n\n\n> 📘 Also available on client-side\n>\n> This method is also accessible through public keys which you can use in client-side​ apps: mobile and web browser apps. Go to the dedicated [endpoint](ref:redeem-stacked-discounts-client-side) to learn more.\n> - Use `X-Client-Application-Id` as the application ID header.\n> - Use `X-Client-Token` as the appliction secret key header.\n> - Use client-side base URL.\n> - Use an `origin` header for your custom domain.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_redemptions" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" - } - ], - "session": { - "type": "LOCK", - "key": "session_key" + "description": "Filters for listing responses.", + "style": "deepObject", + "explode": true + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of redemption objects. Each entry in the array is a separate redemption object. If no more redemptions are available, the resulting array will be empty. If you provide a non-existent customer ID, this call returns an empty object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_list_redemptions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "redemptions", + "redemptions": [ + { + "id": "r_0c0469eaf705889d99", + "object": "redemption", + "date": "2022-11-18T12:30:32.622Z", + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulhyMBo7VratI", + "metadata": { + "store_names": "Store 2 - Florida - Miami" }, + "result": "SUCCESS", "order": { - "amount": 55000, + "id": "ord_ndw5rQJt12zvZ4upF72a3ljh", + "source_id": null, + "created_at": "2022-11-18T12:30:31.338Z", + "updated_at": null, "status": "PAID", + "amount": 9680000, + "items_discount_amount": 9450000, + "total_discount_amount": 9450000, + "total_amount": 230000, + "items_applied_discount_amount": 9450000, + "total_applied_discount_amount": 9450000, "items": [ { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, "product": { - "metadata": { - "key": "value" - } + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } }, { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", + "object": "order_item", + "product_id": "prod_0bae2dc5a090fd0184", + "sku_id": "sku_0bae3b28f610fd0da1", + "quantity": 45, + "discount_quantity": 45, + "initial_quantity": 0, + "amount": 9450000, + "discount_amount": 9450000, + "initial_amount": 0, + "applied_discount_amount": 9450000, + "price": 210000, + "subtotal_amount": 0, "product": { - "metadata": { - "key": "value" - } + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000 + }, + "sku": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 210000 } } ], - "metadata": { - "key": "value" - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
                  `array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
                  `object` | Represents the final effect of all child redemptions executed during the request. |\n| order
                  `object` | Represents order details after all discounts are applied. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" - } - } - } - } - } - } - }, - "/v1/redemptions/{redemptionId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "redemptionId", - "in": "path", - "required": true, - "description": "ID of previously created redemption." - } - ], - "get": { - "operationId": "get-redemption", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Get Redemption", - "description": "Return a redemption or redemption rollback object. This object can either be a successfull or failed redemption or redemption rollback.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_get_redemption" - }, - "examples": { - "Discount Voucher": { - "value": { - "id": "r_0bade27c428db5873e", - "object": "redemption", - "date": "2022-09-12T07:29:28.211Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_ebmAU9uv3dTE2Khqyh7i5ka7", - "source_id": null, - "created_at": "2022-09-12T07:29:26.245Z", - "updated_at": null, - "status": "PAID", - "amount": 22500, - "discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 22200, - "applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 1, - "amount": 22500, - "price": 22500, - "subtotal_amount": 22500, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bade27c428db5873e": { - "date": "2022-09-12T07:29:26.282Z", - "related_object_type": "voucher", - "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, + "id": "cust_qBwHpagDOFu71Z3F22UzR80X", "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", - "voucher": { - "id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", - "code": "FB-metadata-string", - "campaign": null, - "campaign_id": null, - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - } - } - }, - "Loyalty Card - Material Reward Product Type": { - "value": { - "id": "r_0c5bf0e6d601c7d7de", - "object": "redemption", - "date": "2023-01-25T12:08:09.503Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 4, - "result": "SUCCESS", - "order": { - "id": "ord_dSOsWkNCRT24lHPkMu8o5QbX", - "source_id": null, - "created_at": "2023-01-25T12:08:07.750Z", - "updated_at": null, - "status": "PAID", - "items": [], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf0e6d601c7d7de": { - "date": "2023-01-25T12:08:07.768Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c0469eaf705889d99": { + "date": "2022-11-18T12:30:31.388Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "related_object_parent_id": "camp_40LC42P5NFbkkD4RWoJ4btks" } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5_a", + "metadata": { + "lang": "en", + "test": true }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "name": "[Sample] Tiered Wire Basket", - "price": 11995, - "attributes": [], - "metadata": { - "source": "bigcommerce", - "bigcommerce_product_categories": [ - 21, - 23 - ] - }, - "image_url": null, - "created_at": "2022-06-03T13:36:16.084Z", - "updated_at": "2022-06-07T09:10:44.644Z", - "object": "product" - }, - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", - "object": "reward", - "name": "Present", - "created_at": "2022-06-13T06:59:01.694Z", - "updated_at": null, - "parameters": { - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "sku_id": null - } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 4 + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "voucher": null, + "promotion_tier": { + "id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm", + "campaign": { + "id": "camp_40LC42P5NFbkkD4RWoJ4btks" } } }, - "Loyalty Card - Material Reward SKU Type": { - "value": { - "id": "r_0c5bf18dad48a34392", - "object": "redemption", - "date": "2023-01-25T12:11:00.543Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 6, - "result": "SUCCESS", - "order": { - "id": "ord_dwb6bpqjIlMuXFS71NuHed9S", - "source_id": null, - "created_at": "2023-01-25T12:10:58.598Z", - "updated_at": null, - "status": "PAID", - "items": [], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf18dad48a34392": { - "date": "2023-01-25T12:10:58.613Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", - "product": { - "id": "prod_5h0wc453_2", - "source_id": "jonah-nystrom-bourbon", - "name": "Johan & Nyström - Bourbon", - "price": null, - "attributes": [ - "categories", - "description", - "weight" - ], - "metadata": { - "company": "Johan & Nyström", - "showcase": true - }, - "image_url": null, - "created_at": "2021-12-01T08:00:49.418Z", - "updated_at": null, - "object": "product" - }, - "sku": { - "id": "sku_0a3efc9044dd121803", - "source_id": "jonah-nystrom-bourbon-250g", - "product_id": "prod_5h0wc453_2", - "sku": "250g", - "price": 1750, - "currency": null, - "attributes": { - "categories": "Coffee, Whole Bean", - "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", - "weight": 250 - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-01T08:00:49.427Z", - "updated_at": null, - "object": "sku" - }, - "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", - "object": "reward", - "name": "Present - SKU", - "created_at": "2023-01-25T12:10:16.060Z", - "updated_at": null, - "parameters": { + { + "id": "r_0bf9cf0a8b12dc5ba6", + "object": "redemption", + "date": "2022-11-10T06:49:03.835Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "amount": 200, + "result": "SUCCESS", + "order": { + "id": "ord_jAifScsbOqxgb12hLu7hXrLU", + "source_id": null, + "created_at": "2022-11-10T06:49:02.703Z", + "updated_at": null, + "status": "PAID", + "amount": 4500, + "discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 500, + "applied_discount_amount": 4000, + "total_applied_discount_amount": 4000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 3, + "amount": 4500, + "price": 1500, + "subtotal_amount": 4500, "product": { - "id": "prod_5h0wc453_2", - "sku_id": "sku_0a3efc9044dd121803" + "id": "prod_0b72b0bd64d198e3ae", + "source_id": "vase_1", + "name": "Vase - Boho Vintage", + "price": 1500 } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 6 - } - } - }, - "Loyalty Card - Pay with Points": { - "value": { - "id": "r_0b5e402ad54a3afe9c", - "object": "redemption", - "date": "2022-07-12T11:00:26.247Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 5, - "redemption": "r_0b5e402ad50a3afe98", - "result": "SUCCESS", - "order": { - "id": "ord_9akjPYZNskEhKZ4zCZt6TKwq", - "source_id": null, - "created_at": "2022-07-12T11:00:26.224Z", - "amount": 20000, - "discount_amount": 5100, - "total_discount_amount": 5100, - "total_amount": 14900, - "applied_discount_amount": 500, - "total_applied_discount_amount": 500, - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, + } + ], + "metadata": {}, "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "assignment_id": "rewa_X3jnD5XFxP6GXCzPZUNknDck", - "id": "rew_6rhNwuuWFQJLvTPO34ilg6jq", - "object": "reward", - "name": "Pay with Points", - "created_at": "2022-07-11T08:18:18.205Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 1, - "points_ratio": 1 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 5 + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bf9cf0a8b12dc5ba6": { + "date": "2022-11-10T06:49:02.764Z", + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "related_object_parent_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + } } - } - }, - "Loyalty Card - Digital Reward - Discount Voucher": { - "value": { - "id": "r_0c5bf3323008a35032", - "object": "redemption", - "date": "2023-01-25T12:18:10.707Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", "metadata": { - "redemption_location": { - "city": "Warsaw", - "state": "Polyork" - } - }, - "amount": 2, - "result": "SUCCESS", - "order": { - "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", - "source_id": null, - "created_at": "2023-01-25T12:18:09.203Z", - "updated_at": null, - "status": "PAID", - "amount": 2100, - "total_amount": 2100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 3, - "amount": 2100, - "price": 700, - "subtotal_amount": 2100, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf3323008a35032": { - "date": "2023-01-25T12:18:09.216Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "voucher": { + "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "code": "LT1-wMPnRhxb", + "campaign": "Loyalty Campaign - Tiers - 1", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "reward": { "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 }, "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", - "code": "HAPPY-ORDER5My", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "21ceb848-4869-4dac-ba41-f854bda3a101", - "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" - }, - "barcode": { - "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" - } - }, - "is_referral_code": false, - "created_at": "2023-01-25T12:18:09.256Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 2 - } - } - }, - "Loyalty Card - Digital Reward - Credits on Gift Card": { - "value": { - "id": "r_0c5c1435d053202118", - "object": "redemption", - "date": "2023-01-25T14:42:25.206Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 1, - "result": "SUCCESS", - "order": { - "id": "ord_v0r7JfUQgWRpw28UJm9Z5AaH", - "source_id": null, - "created_at": "2023-01-25T14:42:23.637Z", - "updated_at": null, - "status": "PAID", - "amount": 22500, - "total_amount": 22500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 1, - "amount": 22500, - "price": 22500, - "subtotal_amount": 22500, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5c1435d053202118": { - "date": "2023-01-25T14:42:23.681Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } + "assignment_id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", + "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "object": "reward", + "name": "100 Points = $20", + "created_at": "2022-09-09T06:41:54.496Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 } }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 55080, - "balance": 44780 - }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2023-01-11T15:23:02.789Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", - "object": "reward", - "name": "Present Credits on Gift Card", - "created_at": "2023-01-25T14:41:31.858Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "balance": 4000, - "type": "GIFT_VOUCHERS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 - } + "type": "COIN" + }, + "loyalty_card": { + "points": 200 } }, - "Loyalty Card - Digital Reward - Points on Loyalty Card": { - "value": { - "id": "r_0c5c226f498f1a93f0", - "object": "redemption", - "date": "2023-01-25T15:44:34.317Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": {}, - "amount": 1, - "result": "SUCCESS", - "order": { - "id": "ord_1fv4ITwpUQra6iDTHFPVfnRR", - "source_id": null, - "created_at": "2023-01-25T15:44:32.494Z", - "updated_at": null, - "status": "PAID", - "amount": 700, - "total_amount": 700, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "price": 700, - "subtotal_amount": 700, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5c226f498f1a93f0": { - "date": "2023-01-25T15:44:32.550Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 1000, - "balance": 870 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-11T08:19:28.780Z", - "updated_at": "2022-10-01T00:02:05.604Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 26, - "redeemed_points": 130, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", - "object": "reward", - "name": "Present on Loyalty Card", - "created_at": "2023-01-25T15:43:40.716Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "balance": 20, - "type": "LOYALTY_PROGRAM" - } - }, - "type": "CAMPAIGN" + { + "id": "rf_0bf9caf744d2dc593a", + "object": "redemption", + "date": "2022-11-10T06:31:15.477Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "FAILURE", + "failure_code": "loyalty_card_points_exceeded", + "failure_message": "loyalty card points exceeded", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bobby McDonald", + "email": "bobby.mcdonald@email.com", + "source_id": "bobby.mcdonald@email.com", + "metadata": { + "acquisition_channel": "Facebook", + "customer_life_time_value": 100 }, - "loyalty_card": { - "points": 1 - } + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "voucher": { + "id": "v_Xak3ViMbxCH8Lb4ZG0lWwC0goMRBXWB4", + "code": "LT1-wMPnRhxb", + "campaign": "Loyalty Campaign - Tiers - 1", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N" } }, - "Gift Card": { - "value": { - "id": "r_0b5e7d29ba4fb72ee4", - "object": "redemption", - "date": "2022-07-12T15:26:52.777Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 5000, - "redemption": "r_0b5e7d29ba0fb72ee2", - "result": "SUCCESS", - "order": { - "id": "ord_5iOTjTG4I3Yo2G2bH1qHk66a", - "source_id": null, - "created_at": "2022-07-12T15:26:52.773Z", - "amount": 30200, - "discount_amount": 9530, - "total_discount_amount": 9530, - "total_amount": 20670, - "applied_discount_amount": 5000, - "total_applied_discount_amount": 5000, - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" + { + "id": "rf_0bf8c023eb4d4aa4ad", + "object": "redemption", + "date": "2022-11-09T11:05:28.074Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "FAILURE", + "failure_code": "customer_rules_violated", + "failure_message": "customer does not match validation rules", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "source_id": "bob.smith@email.com", + "metadata": { + "acquisition_channel": "Facebook" }, - "gift": { - "amount": 5000 - } + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "voucher": { + "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "code": "3rqWOTAh", + "campaign_id": null } }, - "Promotion Tier": { - "value": { - "id": "r_0c5d6689b35320059a", - "object": "redemption", - "date": "2023-01-26T15:20:35.916Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_4kVJ1PiXP3TNfik3pM79KZsn", - "source_id": null, - "created_at": "2023-01-26T15:20:34.216Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ - { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } - }, - "metadata": { - "series": "2022-783CV" - } + { + "id": "r_0ba9fa02fcd28ed8f1", + "object": "redemption", + "date": "2022-09-09T06:38:20.085Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", + "source_id": null, + "created_at": "2022-09-09T06:38:17.984Z", + "updated_at": null, + "status": "PAID", + "amount": 4600, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 4300, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 1600 }, - { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "price": 1600 } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5d6689b35320059a": { - "date": "2023-01-26T15:20:34.253Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + { + "object": "order_item", + "product_id": "prod_0a65b3ff8592d7a5b5", + "quantity": 1, + "amount": 3000, + "discount_amount": 300, + "applied_discount_amount": 300, + "price": 3000, + "subtotal_amount": 2700, + "product": { + "id": "prod_0a65b3ff8592d7a5b5", + "name": "Koffee Cup", + "price": 3000 } } - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, + ], + "metadata": {}, "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", "object": "customer" }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "action": null, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": null, - "expiration_date": null, - "object": "campaign" - }, - "campaign_id": null, - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fa02fcd28ed8f1": { + "date": "2022-09-09T06:38:18.099Z", + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "Bob Smith", + "email": "bob.smith@email.com", + "source_id": "bob.smith@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "voucher": { + "id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "code": "vTcguVLE", + "campaign": "SL-Gift", + "campaign_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + }, + "gift": { + "amount": 300 } }, - "Stacked Redemption": { - "value": { - "id": "r_0b5e3e2b7f851d0192", - "object": "redemption", - "date": "2022-07-12T10:51:33.098Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_qjnno0eUQ1fs0RMjejfbZp7q", - "source_id": null, - "created_at": "2022-07-12T10:51:31.687Z", - "updated_at": null, - "status": "PAID", - "amount": 20000, - "discount_amount": 6100, - "total_discount_amount": 6100, - "total_amount": 13900, - "applied_discount_amount": 6100, - "total_applied_discount_amount": 6100, - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0b5e3e2b7f851d0192": { - "date": "2022-07-12T10:51:31.711Z", - "related_object_type": "redemption", - "related_object_id": "r_0b5e3e2b7f851d0192", - "stacked": [ - "r_0b5e3e2b7f851d0193", - "r_0b5e3e2b7fc51d0194", - "r_0b5e3e2b7fc51d0195", - "r_0b5e3e2b7fc51d0196", - "r_0b5e3e2b7fc51d0197" - ] - } - } - }, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "accepts_marketing": false - }, - "object": "customer" - }, - "related_object_type": "redemption", - "related_object_id": "r_0b5e3e2b7f851d0192", - "voucher": null + { + "id": "rf_0bf8bfe0808d4aa473", + "object": "redemption", + "date": "2022-11-09T11:04:19.062Z", + "customer_id": null, + "tracking_id": null, + "metadata": {}, + "result": "FAILURE", + "failure_code": "missing_customer", + "failure_message": "Missing customer", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": null, + "related_object_type": "voucher", + "related_object_id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "voucher": { + "id": "v_FGQjOjqasEbbdpnySdCpUoalJio3OHWK", + "code": "3rqWOTAh", + "campaign_id": null } - }, - "Failed Voucher": { - "value": { - "id": "rf_0c5bd3c15701c78243", - "object": "redemption", - "date": "2023-01-25T10:00:47.812Z", - "customer_id": "cust_w1aRTTkpzeTGtOauISc8CKUN", - "tracking_id": "track_hr0jh/qNQqZWu7gkCEcVwEg27bNVrn2+", + } + ], + "total": 6 + } + } + } + } + } + } + } + }, + "post": { + "operationId": "redeem-stacked-discounts", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Redeem Stackable Discounts", + "description": "Use this method to redeem up to 5 redeemables in a single API request.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions). \n\n\n> 📘 Also available on client-side\n>\n> This method is also accessible through public keys which you can use in client-side​ apps: mobile and web browser apps. Go to the dedicated [endpoint](ref:redeem-stacked-discounts-client-side) to learn more.\n> - Use `X-Client-Application-Id` as the application ID header.\n> - Use `X-Client-Token` as the appliction secret key header.\n> - Use client-side base URL.\n> - Use an `origin` header for your custom domain.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_redemptions" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK", + "key": "session_key" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { "metadata": { - "location_id": [], - "redemption_location": { - "city": "Albany", - "state": "New York" - } - }, - "result": "FAILURE", - "failure_code": "voucher_disabled", - "failure_message": "voucher is disabled", - "order": null, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_w1aRTTkpzeTGtOauISc8CKUN", - "name": "Bobby's Friend", - "email": null, - "source_id": "create_order_referrer_1", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", - "voucher": { - "id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", - "code": "PROMO-CODE2", - "campaign": null, - "campaign_id": null, - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" + "key": "value" } } }, - "Failed Promotion Tier": { - "value": { - "id": "rf_0c5d6e47050156bfc2", - "object": "redemption", - "date": "2023-01-26T15:54:23.508Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "FAILURE", - "failure_code": "promotion_inactive", - "failure_message": "Inactive Promotion", - "order": null, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "action": null, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": null, - "expiration_date": null, - "object": "campaign" - }, - "campaign_id": null, - "summary": { - "redemptions": { - "total_redeemed": 0 - }, - "orders": { - "total_amount": 0, - "total_discount_amount": 0 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" } } - }, - "Failed Redemption": { - "value": { - "id": "rf_0c5bde8dfc0156f0e3", - "object": "redemption", - "date": "2023-01-25T10:47:58.578Z", - "customer_id": null, - "tracking_id": null, - "metadata": null, - "result": "FAILURE", - "failure_code": "not_found", - "failure_message": "Resource not found", - "order": null, - "channel": { - "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", - "channel_type": "API" - }, - "customer": null, - "related_object_type": "redemption", - "related_object_id": "rf_0c5bde8dfc0156f0e3", - "voucher": null - } } + ], + "metadata": { + "key": "value" } } } } } } - }, - "/v1/vouchers/{code}/redemption": { - "parameters": [ - { - "$ref": "#/components/parameters/code" - } - ], - "get": { - "operationId": "get-voucher-redemptions", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Get Voucher's Redemptions", - "description": "Retrieve the number of times a voucher was redeemed and each of the redemption details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + }, + "responses": { + "200": { + "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
                  `array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
                  `object` | Represents the final effect of all child redemptions executed during the request. |\n| order
                  `object` | Represents order details after all discounts are applied. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" } - ], - "responses": { - "200": { - "description": "A dictionary with a `redemption_entries` property that contains an array of voucher's redemptions.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_get_vouchers_redemptions" - }, - "examples": { - "Example": { - "value": { - "quantity": null, - "redeemed_quantity": 6, - "object": "list", - "url": "/v1/vouchers/Test - FB - Vouchers - 9/redemptions?page=1&limit=10", - "data_ref": "redemption_entries", - "total": 6, - "redemption_entries": [ - { - "id": "r_0bc92f81a6801f9bca", - "object": "redemption", - "date": "2022-10-03T12:24:58.008Z", - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_bhp1EH2SDz7UwkkurPFPLPhi", - "source_id": null, - "created_at": "2022-10-03T12:24:56.179Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 229900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "object": "customer" - }, - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92f81a6801f9bca": { - "date": "2022-10-03T12:24:56.219Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "name": null, - "email": null, - "source_id": "johnnyy@email.com", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc92e6a68050e118c", - "object": "redemption", - "date": "2022-10-03T12:20:11.873Z", - "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmKhuFqhawWj", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_rBsuJYqf4eFZgqj6IxeJgEcN", - "source_id": null, - "created_at": "2022-10-03T12:20:10.222Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 229900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "object": "customer" - }, - "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92e6a68050e118c": { - "date": "2022-10-03T12:20:10.272Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_4", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc92db6e6001f9aa8", - "object": "redemption", - "date": "2022-10-03T12:17:07.780Z", - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmYlx396Pk4X", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_JvZbg1LFcXdQ67no5SENGldH", - "source_id": null, - "created_at": "2022-10-03T12:17:06.404Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 1200, - "total_discount_amount": 1200, - "total_amount": 228800, - "applied_discount_amount": 1200, - "total_applied_discount_amount": 1200, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "object": "customer" - }, - "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc92db6e6001f9aa8": { - "date": "2022-10-03T12:17:06.456Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", - "name": "Bob Jones", - "email": "bob.smith@email.com", - "source_id": "pub_source_customer_5", - "metadata": { - "lang": "en", - "test": true - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2dc6404426c0ab3", - "object": "redemption", - "date": "2022-09-28T14:30:56.199Z", - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_6uuhGraDuXMOpVRTJT251kKW", - "source_id": null, - "created_at": "2022-09-28T14:30:54.681Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 800, - "total_discount_amount": 800, - "total_amount": 229200, - "applied_discount_amount": 800, - "total_applied_discount_amount": 800, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "object": "customer" - }, - "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2dc6404426c0ab3": { - "date": "2022-09-28T14:30:54.737Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", - "name": null, - "email": null, - "source_id": "jonny@email.com", - "metadata": {}, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2d6f0ebc95f1783", - "object": "redemption", - "date": "2022-09-28T14:07:07.516Z", - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "tracking_id": "track_ThofCMTQe4EVIo0zvvOlTor1twaQNd7E", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_ZQevc2J2sBegsnp5DwanXHsa", - "source_id": null, - "created_at": "2022-09-28T14:07:06.073Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 0, - "total_discount_amount": 0, - "total_amount": 230000, - "applied_discount_amount": 0, - "total_applied_discount_amount": 0, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" - }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2d6f0ebc95f1783": { - "date": "2022-09-28T14:07:06.159Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "name": "Bob Smith", - "email": "bob.smith.1@email.com", - "source_id": "bob.smith.1@email.com", - "metadata": { - "lang": "en", - "test": false - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - }, - { - "id": "r_0bc2d3c4f7495f159a", - "object": "redemption", - "date": "2022-09-28T13:53:16.057Z", - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", - "metadata": {}, - "result": "SUCCESS", - "order": { - "id": "ord_ff6rwr58kmdyuLsi5orplnVW", - "source_id": null, - "created_at": "2022-09-28T13:53:14.604Z", - "updated_at": null, - "status": "PAID", - "amount": 230000, - "discount_amount": 800, - "total_discount_amount": 800, - "total_amount": 229200, - "applied_discount_amount": 800, - "total_applied_discount_amount": 800, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bae45ffc7003ffc52", - "quantity": 1, - "amount": 230000, - "price": 230000, - "subtotal_amount": 230000, - "product": { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0bc2d3c4f7495f159a": { - "date": "2022-09-28T13:53:14.717Z", - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" - } - } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "name": "John Smith", - "email": "john.smith@email.com", - "source_id": "john.smith@email.com", - "metadata": { - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "voucher": { - "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", - "code": "Test - FB - Vouchers - 9", - "campaign_id": null - } - } + } + } + } + } + } + }, + "/v1/redemptions/{redemptionId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "redemptionId", + "in": "path", + "required": true, + "description": "ID of previously created redemption." + } + ], + "get": { + "operationId": "get-redemption", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Get Redemption", + "description": "Return a redemption or redemption rollback object. This object can either be a successfull or failed redemption or redemption rollback.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_get_redemption" + }, + "examples": { + "Discount Voucher": { + "value": { + "id": "r_0bade27c428db5873e", + "object": "redemption", + "date": "2022-09-12T07:29:28.211Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ebmAU9uv3dTE2Khqyh7i5ka7", + "source_id": null, + "created_at": "2022-09-12T07:29:26.245Z", + "updated_at": null, + "status": "PAID", + "amount": 22500, + "discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 22200, + "applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 1, + "amount": 22500, + "price": 22500, + "subtotal_amount": 22500, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bade27c428db5873e": { + "date": "2022-09-12T07:29:26.282Z", + "related_object_type": "voucher", + "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", + "voucher": { + "id": "v_c1yOEjZXOyVIe89VAYiRvL3QimZjXo8h", + "code": "FB-metadata-string", + "campaign": null, + "campaign_id": null, + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + } + } + }, + "Loyalty Card - Material Reward Product Type": { + "value": { + "id": "r_0c5bf0e6d601c7d7de", + "object": "redemption", + "date": "2023-01-25T12:08:09.503Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 4, + "result": "SUCCESS", + "order": { + "id": "ord_dSOsWkNCRT24lHPkMu8o5QbX", + "source_id": null, + "created_at": "2023-01-25T12:08:07.750Z", + "updated_at": null, + "status": "PAID", + "items": [], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf0e6d601c7d7de": { + "date": "2023-01-25T12:08:07.768Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "name": "[Sample] Tiered Wire Basket", + "price": 11995, + "attributes": [], + "metadata": { + "source": "bigcommerce", + "bigcommerce_product_categories": [ + 21, + 23 ] + }, + "image_url": null, + "created_at": "2022-06-03T13:36:16.084Z", + "updated_at": "2022-06-07T09:10:44.644Z", + "object": "product" + }, + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", + "object": "reward", + "name": "Present", + "created_at": "2022-06-13T06:59:01.694Z", + "updated_at": null, + "parameters": { + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "sku_id": null + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 4 + } + } + }, + "Loyalty Card - Material Reward SKU Type": { + "value": { + "id": "r_0c5bf18dad48a34392", + "object": "redemption", + "date": "2023-01-25T12:11:00.543Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 6, + "result": "SUCCESS", + "order": { + "id": "ord_dwb6bpqjIlMuXFS71NuHed9S", + "source_id": null, + "created_at": "2023-01-25T12:10:58.598Z", + "updated_at": null, + "status": "PAID", + "items": [], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf18dad48a34392": { + "date": "2023-01-25T12:10:58.613Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", + "product": { + "id": "prod_5h0wc453_2", + "source_id": "jonah-nystrom-bourbon", + "name": "Johan & Nyström - Bourbon", + "price": null, + "attributes": [ + "categories", + "description", + "weight" + ], + "metadata": { + "company": "Johan & Nyström", + "showcase": true + }, + "image_url": null, + "created_at": "2021-12-01T08:00:49.418Z", + "updated_at": null, + "object": "product" + }, + "sku": { + "id": "sku_0a3efc9044dd121803", + "source_id": "jonah-nystrom-bourbon-250g", + "product_id": "prod_5h0wc453_2", + "sku": "250g", + "price": 1750, + "currency": null, + "attributes": { + "categories": "Coffee, Whole Bean", + "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", + "weight": 250 + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-01T08:00:49.427Z", + "updated_at": null, + "object": "sku" + }, + "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", + "object": "reward", + "name": "Present - SKU", + "created_at": "2023-01-25T12:10:16.060Z", + "updated_at": null, + "parameters": { + "product": { + "id": "prod_5h0wc453_2", + "sku_id": "sku_0a3efc9044dd121803" + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 6 } } - } - } - } - }, - "post": { - "operationId": "redeem-voucher", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Voucher [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher. \n\n## How discounts and order amounts are calculated in the API response?\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |\n| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |\n| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |\n| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n## SDKs \n\nYou can invoke the redemption endpoint with one of the official libraries: \n\n\n[block:html]\n{\n \"html\": \"
                  \\n\\n
                  \\n \\n
                  \\n\\n
                  \\n\\n
                  \\n\\n\\n
                  \\n\\n\\n\\n\\n\\n
                  \\n\\n
                  \\n
                  \\n\\n\"\n}\n[/block]\n\n## Customer tracking\n\nThe redeem operation is a key part of [Customer tracking] (doc:customer-tracking) workflow. There're 3 ways you can identify your end customer in Voucherify within this request. You can either provide a tracking ID (e.g. your customer's login or a generated id), a customer ID (if the customer is already stored in Voucherify) or a full `customer` object in the payload. Note that you can pass and thus store any customer-related metadata. See examples on the right.\n\n\n```json\n\"customer\": {\n \"source_id\": \"alice.morgan\",\n \"name\": \"Alice Morgan\",\n \"email\": \"alice@morgan.com\",\n \"description\": \"\",\n \"metadata\": {\n \"locale\": \"en-GB\",\n \"shoeSize\": 5,\n \"favourite_brands\": [\"Armani\", \"L’Autre Chose\", \"Vicini\"]\n }\n}\n```\n\nIf you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the redeem function or explicitly by invoking the [Create Customer](ref:create-customer) method, you can identify your customer in redemptions by a generated ID (starting with `cust_`). \n\n\n```json title=Example Customer Identifier [object]\n\"customer\": {\n \"id\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier\n{\n \"customer\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier by Source ID\n{\n \"customer\": \"alice.morgan\"\n}\n```\n\n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).\n\n## Redemption failures\n\nThere are several reasons why a redemption may fail. You will get the reason in the error key:\n - `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified\n\n## Order object\n\nThe purchase of previously defined products (products are stored in Voucherify) by end customers is handled through the order object. You are obligated to pass the order object in case you use validation rules. You can learn more about the [validation rules structure] (doc:validation-rules). \n\n| **Attributes** | **Description** |\n|:---|:---|\n| amount
                  `integer` | A positive integer representing the total amount for the order. |\n| items
                  `list` | List of items constituting the order. Order items can be defined either by `product_id` or `sku_id`. Along with every item you must define the `quantity`.

                  Child attributes:

                  - `product_id` (*string*) - The ID of the associated product object for this line item.

                  - `sku_id` (*string*) - The ID of the associated variant (sku) object for this line item.

                  - `quantity` (*integer*) - A positive integer representing the number of instances of the item that are included in this order line.

                  - `price` (*integer*) - A positive integer representing the cost of an item.

                  - `amount` (*integer*) - `quantity` * `price` (you should provide it to retrieve `discount_amount` for a particular order item if the discount is applied only to this item learn more |\n\n\n\n\n> 🚧 Order ID\n>\n> If you use the same order id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order. [Read more in this guide] (https://docs.voucherify.io/docs/manage-stackable-discounts).\n\n\n```json title=Example Order\n\"order\": {\n \"amount\": 10000,\n \"items\": [\n {\n \"product_id\": \"prod_Bi7sRr3kwvxH2I\",\n \"quantity\": 1\n }\n ]\n}\n```\n## Gift Vouchers - redeem Gift Card and control redeemed amount\n\nIn Voucherify,you can also create a gift card for customers. Customers then can use gift card credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.\n\nWhen the user wants to define how many gift credits are to be used from the gift card to complete the order, the `credits` property can be assigned the equivalent value in the lowest currency in the request body. The value of credits being applied to the order cannot be higher than the current balance on the gift card.\n\n\n```cURL title=Example Request - control redeemed amount\ncurl -i -X POST \\\n -H \"Content-Type:application/json\" \\\n -H \"X-App-Id:c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token:3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -d '{\n \"order\": {\n \"amount\": 2500\n },\n \"gift\": {\n \"credits\": 1500\n }\n }' \\ \n 'https://api.voucherify.io/v1/vouchers/aDm4CRR3/redemption'\n```\n## Loyalty Coins - redeem loyalty card and pay with points\n\nVoucherify offers the possibility to set up a reward type in the Loyalty Program, which allows using loyalty points as gift credits. The available balance of credits is counted based on policy rules attached to the reward definition.\n\nIf a user configures just one reward type of paying in points, in the redemption request, there is no additional information required. Voucherify will automatically select as a proper reward definition and will calculate the discount based on the attached policy. \n\n\n```json title=Example Request\n{\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_zv5Qn7cF68RbVX4foKxgwUi1\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:44:20Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 250,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_Tgi2ApelDyl86sm5AYDKCBMZ\",\n \"created_at\": \"2020-05-24T13:44:20Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": \"ltr_3q5dW6GaRC4QkA1oYmfGy1k1\",\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-23T08:18:55Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 489,\n \"balance\": 23\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 8,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 466\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:44:20Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nIn case the user wants to define how much he spends in points, it is configurable by property `points` in a request body.\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 10\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_NJIfNYD8uc2lNm3YBAqXr3FF\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T16:28:29Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_70kKdXIKCSx5cfglKSpz9aHy\",\n \"created_at\": \"2020-05-24T16:28:29Z\",\n \"discount_amount\": 250\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-24T13:44:26Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 539,\n \"balance\": 63\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 9,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 476\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T16:28:29Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nMoreover, it is possible to define many levels of reward in which collected points can be used as gift credits. Per each tier, we can implement different conversion factors. Having many options in the rewards catalog, we will need to select a coins calculation policy (reward ID) that we want to use for calculating a final discount in the redemption request.\n\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 30,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\"\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_se17sLon6YX5wMhYVzfQa2dc\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:41:16Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_EfMmve84JzQIg2MCM3cAvLgF\",\n \"created_at\": \"2020-05-24T13:41:16Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_g3QQwQfhJrjBYzEa1NJkub7N\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\",\n \"name\": \"1 point 25$\",\n \"created_at\": \"2020-05-24T12:57:19Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 25.0\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 439,\n \"balance\": 223\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 7,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 216\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:41:16Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```", - "parameters": [ - { - "schema": { - "type": "string" }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returnee by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. **Although not all information is required, the extra info helps prevent fraud.**" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_voucher" + "Loyalty Card - Pay with Points": { + "value": { + "id": "r_0b5e402ad54a3afe9c", + "object": "redemption", + "date": "2022-07-12T11:00:26.247Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 5, + "redemption": "r_0b5e402ad50a3afe98", + "result": "SUCCESS", + "order": { + "id": "ord_9akjPYZNskEhKZ4zCZt6TKwq", + "source_id": null, + "created_at": "2022-07-12T11:00:26.224Z", + "amount": 20000, + "discount_amount": 5100, + "total_discount_amount": 5100, + "total_amount": 14900, + "applied_discount_amount": 500, + "total_applied_discount_amount": 500, + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "assignment_id": "rewa_X3jnD5XFxP6GXCzPZUNknDck", + "id": "rew_6rhNwuuWFQJLvTPO34ilg6jq", + "object": "reward", + "name": "Pay with Points", + "created_at": "2022-07-11T08:18:18.205Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 1, + "points_ratio": 1 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 5 + } } - } - } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_redeem_voucher" + }, + "Loyalty Card - Digital Reward - Discount Voucher": { + "value": { + "id": "r_0c5bf3323008a35032", + "object": "redemption", + "date": "2023-01-25T12:18:10.707Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": { + "redemption_location": { + "city": "Warsaw", + "state": "Polyork" + } }, - "examples": { - "Gift Voucher": { - "value": { - "id": "r_0c5e8a38730ccec0d5", - "object": "redemption", - "date": "2023-01-27T12:34:57.100Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2000, - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 4000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 0, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", - "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T12:34:57.102Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 18, - "redeemed_quantity": 1, - "redeemed_amount": 2000, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "gift": { - "amount": 2000 + "amount": 2, + "result": "SUCCESS", + "order": { + "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", + "source_id": null, + "created_at": "2023-01-25T12:18:09.203Z", + "updated_at": null, + "status": "PAID", + "amount": 2100, + "total_amount": 2100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 3, + "amount": 2100, + "price": 700, + "subtotal_amount": 2100, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 } } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Discount Coupon": { - "value": { - "id": "r_0c5e8ef10842da0aad", - "object": "redemption", - "date": "2023-01-27T12:55:34.689Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 5700, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "discount_amount": 148, - "applied_discount_amount": 148, - "price": 3000, - "subtotal_amount": 3152 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "discount_amount": 152, - "applied_discount_amount": 152, - "price": 3000, - "subtotal_amount": 3248 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf3323008a35032": { + "date": "2023-01-25T12:18:09.216Z", "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T12:55:34.690Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", + "code": "HAPPY-ORDER5My", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "21ceb848-4869-4dac-ba41-f854bda3a101", + "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" + }, + "barcode": { + "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" + } + }, + "is_referral_code": false, + "created_at": "2023-01-25T12:18:09.256Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 2 + } + } + }, + "Loyalty Card - Digital Reward - Credits on Gift Card": { + "value": { + "id": "r_0c5c1435d053202118", + "object": "redemption", + "date": "2023-01-25T14:42:25.206Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 1, + "result": "SUCCESS", + "order": { + "id": "ord_v0r7JfUQgWRpw28UJm9Z5AaH", + "source_id": null, + "created_at": "2023-01-25T14:42:23.637Z", + "updated_at": null, + "status": "PAID", + "amount": 22500, + "total_amount": 22500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 1, + "amount": 22500, + "price": 22500, + "subtotal_amount": 22500, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 } } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Loyalty Card": { - "value": { - "id": "r_0c5e8f2cd78497a372", - "object": "redemption", - "date": "2023-01-27T12:56:35.934Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_MGTimoN4VtSj7iT75bP01FsH", - "source_id": null, - "created_at": "2023-01-27T12:56:35.923Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 0, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8f2cd78497a372": { - "date": "2023-01-27T12:56:35.934Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5c1435d053202118": { + "date": "2023-01-25T14:42:23.681Z", "related_object_type": "voucher", "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 6500, - "balance": 5086 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-01-27T12:56:35.935Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1414, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 300 - } + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 55080, + "balance": 44780 + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" + }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2023-01-11T15:23:02.789Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", + "object": "reward", + "name": "Present Credits on Gift Card", + "created_at": "2023-01-25T14:41:31.858Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "balance": 4000, + "type": "GIFT_VOUCHERS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 } } - } - }, - "400": { - "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Voucher disabled": { - "value": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "AnsvocvP", - "request_id": "v-0c5d710a63c4110ae9", - "resource_id": "rf_0c5d710a87c8a31f86", - "resource_type": "redemption", - "error": { - "message": "The voucher has been disabled and cannot be used." + }, + "Loyalty Card - Digital Reward - Points on Loyalty Card": { + "value": { + "id": "r_0c5c226f498f1a93f0", + "object": "redemption", + "date": "2023-01-25T15:44:34.317Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": {}, + "amount": 1, + "result": "SUCCESS", + "order": { + "id": "ord_1fv4ITwpUQra6iDTHFPVfnRR", + "source_id": null, + "created_at": "2023-01-25T15:44:32.494Z", + "updated_at": null, + "status": "PAID", + "amount": 700, + "total_amount": 700, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "price": 700, + "subtotal_amount": 700, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 } } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Invalid Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Customer must be a holder of a loyalty card.", - "details": "AnsvocvP", - "request_id": "v-0c5e628bd14411244b", - "resource_id": "rf_0c5e628bf841c7f248", - "resource_type": "redemption", - "error": { - "message": "The customer is invalid." - } + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5c226f498f1a93f0": { + "date": "2023-01-25T15:44:32.550Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" }, - "Voucher Inactive": { - "value": { - "code": 400, - "key": "voucher_not_active_now", - "message": "voucher not active now", - "details": "CODE14", - "request_id": "v-0c5e89b9300d820994", - "resource_id": "rf_0c5e89b945d33b9c02", - "resource_type": "redemption", - "error": { - "message": "The voucher is not active in the given timeframe." + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 1000, + "balance": 870 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" } + }, + "is_referral_code": false, + "created_at": "2022-07-11T08:19:28.780Z", + "updated_at": "2022-10-01T00:02:05.604Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 26, + "redeemed_points": 130, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", + "object": "reward", + "name": "Present on Loyalty Card", + "created_at": "2023-01-25T15:43:40.716Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "balance": 20, + "type": "LOYALTY_PROGRAM" } - } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 } } - } - } - } - } - }, - "/client/v1/redeem": { - "post": { - "operationId": "redeem-voucher-client-side", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Voucher (client-side) [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps). \n\nThe client-side redemption works similar to the server-side [voucher redemption](ref:redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.\n\n\n> 📘 Opt-in \n>\n> By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.\n\n\n> ❗️ Security Threat \n>\n> Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.\n\n### Expand Response\nYou may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.\n\n```json\n{\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n}\n```", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "code", - "description": "Voucher code being redeemed.", - "required": true - }, - { - "schema": { - "type": "string" }, - "in": "query", - "name": "tracking_id", - "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud." - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_voucher" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_redeem_voucher" + "Gift Card": { + "value": { + "id": "r_0b5e7d29ba4fb72ee4", + "object": "redemption", + "date": "2022-07-12T15:26:52.777Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 5000, + "redemption": "r_0b5e7d29ba0fb72ee2", + "result": "SUCCESS", + "order": { + "id": "ord_5iOTjTG4I3Yo2G2bH1qHk66a", + "source_id": null, + "created_at": "2022-07-12T15:26:52.773Z", + "amount": 30200, + "discount_amount": 9530, + "total_discount_amount": 9530, + "total_amount": 20670, + "applied_discount_amount": 5000, + "total_applied_discount_amount": 5000, + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" }, - "examples": { - "Gift Voucher": { - "value": { - "id": "r_0c5e8a38730ccec0d5", - "object": "redemption", - "date": "2023-01-27T12:34:57.100Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2000, - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 4000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 0, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", + "gift": { + "amount": 5000 + } + } + }, + "Promotion Tier": { + "value": { + "id": "r_0c5d6689b35320059a", + "object": "redemption", + "date": "2023-01-26T15:20:35.916Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_4kVJ1PiXP3TNfik3pM79KZsn", + "source_id": null, + "created_at": "2023-01-26T15:20:34.216Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "name": "Apple iPhone 8", "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T12:34:57.102Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": 18, - "redeemed_quantity": 1, - "redeemed_amount": 2000, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "shop": "citycenter", + "category": "electronics" } }, - "gift": { - "amount": 2000 + "metadata": { + "series": "2022-783CV" } - } - }, - "Discount Coupon": { - "value": { - "id": "r_0c5e8ef10842da0aad", - "object": "redemption", - "date": "2023-01-27T12:55:34.689Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 5700, - "items_applied_discount_amount": 300, - "total_applied_discount_amount": 300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "discount_amount": 148, - "applied_discount_amount": 148, - "price": 3000, - "subtotal_amount": 3152 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "discount_amount": 152, - "applied_discount_amount": 152, - "price": 3000, - "subtotal_amount": 3248 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T12:55:34.690Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_HesdqEzt5e9c0T56", - "rule_id": "val_gZft0NKZSUWK", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "related_object_type": "voucher", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 2, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0a9f9ab4ab019a42d5", - "source_id": "prod_0a9f9ab4ab019a42d5", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0a9f9aeddb019a42db", - "source_id": "prod_0a9f9aeddb019a42db", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" + "category": "electronics" } } } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" }, - "Loyalty Card": { - "value": { - "id": "r_0c5e8f2cd78497a372", - "object": "redemption", - "date": "2023-01-27T12:56:35.934Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 300, - "result": "SUCCESS", - "order": { - "id": "ord_MGTimoN4VtSj7iT75bP01FsH", - "source_id": null, - "created_at": "2023-01-27T12:56:35.923Z", - "updated_at": null, - "status": "PAID", - "amount": 6000, - "discount_amount": 6000, - "total_discount_amount": 6000, - "total_amount": 0, - "applied_discount_amount": 6000, - "total_applied_discount_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8f2cd78497a372": { - "date": "2023-01-27T12:56:35.934Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 6500, - "balance": 5086 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-01-27T12:56:35.935Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1414, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 300 - } + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5d6689b35320059a": { + "date": "2023-01-26T15:20:34.253Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" } } + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "action": null, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": null, + "expiration_date": null, + "object": "campaign" + }, + "campaign_id": null, + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } - } - }, - "400": { - "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Voucher disabled": { - "value": { - "code": 400, - "key": "voucher_disabled", - "message": "voucher is disabled", - "details": "AnsvocvP", - "request_id": "v-0c5d710a63c4110ae9", - "resource_id": "rf_0c5d710a87c8a31f86", - "resource_type": "redemption", - "error": { - "message": "The voucher has been disabled and cannot be used." - } - } + }, + "Stacked Redemption": { + "value": { + "id": "r_0b5e3e2b7f851d0192", + "object": "redemption", + "date": "2022-07-12T10:51:33.098Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_qjnno0eUQ1fs0RMjejfbZp7q", + "source_id": null, + "created_at": "2022-07-12T10:51:31.687Z", + "updated_at": null, + "status": "PAID", + "amount": 20000, + "discount_amount": 6100, + "total_discount_amount": 6100, + "total_amount": 13900, + "applied_discount_amount": 6100, + "total_applied_discount_amount": 6100, + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Invalid Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Customer must be a holder of a loyalty card.", - "details": "AnsvocvP", - "request_id": "v-0c5e628bd14411244b", - "resource_id": "rf_0c5e628bf841c7f248", - "resource_type": "redemption", - "error": { - "message": "The customer is invalid." - } + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0b5e3e2b7f851d0192": { + "date": "2022-07-12T10:51:31.711Z", + "related_object_type": "redemption", + "related_object_id": "r_0b5e3e2b7f851d0192", + "stacked": [ + "r_0b5e3e2b7f851d0193", + "r_0b5e3e2b7fc51d0194", + "r_0b5e3e2b7fc51d0195", + "r_0b5e3e2b7fc51d0196", + "r_0b5e3e2b7fc51d0197" + ] } + } + }, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "accepts_marketing": false }, - "Voucher Inactive": { - "value": { - "code": 400, - "key": "voucher_not_active_now", - "message": "voucher not active now", - "details": "CODE14", - "request_id": "v-0c5e89b9300d820994", - "resource_id": "rf_0c5e89b945d33b9c02", - "resource_type": "redemption", - "error": { - "message": "The voucher is not active in the given timeframe." - } + "object": "customer" + }, + "related_object_type": "redemption", + "related_object_id": "r_0b5e3e2b7f851d0192", + "voucher": null + } + }, + "Failed Voucher": { + "value": { + "id": "rf_0c5bd3c15701c78243", + "object": "redemption", + "date": "2023-01-25T10:00:47.812Z", + "customer_id": "cust_w1aRTTkpzeTGtOauISc8CKUN", + "tracking_id": "track_hr0jh/qNQqZWu7gkCEcVwEg27bNVrn2+", + "metadata": { + "location_id": [], + "redemption_location": { + "city": "Albany", + "state": "New York" + } + }, + "result": "FAILURE", + "failure_code": "voucher_disabled", + "failure_message": "voucher is disabled", + "order": null, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_w1aRTTkpzeTGtOauISc8CKUN", + "name": "Bobby's Friend", + "email": null, + "source_id": "create_order_referrer_1", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", + "voucher": { + "id": "v_zr4XJD6b6JtldZq9EorHf4jxRbahjkfi", + "code": "PROMO-CODE2", + "campaign": null, + "campaign_id": null, + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + } + } + }, + "Failed Promotion Tier": { + "value": { + "id": "rf_0c5d6e47050156bfc2", + "object": "redemption", + "date": "2023-01-26T15:54:23.508Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "FAILURE", + "failure_code": "promotion_inactive", + "failure_message": "Inactive Promotion", + "order": null, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "action": null, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": null, + "expiration_date": null, + "object": "campaign" + }, + "campaign_id": null, + "summary": { + "redemptions": { + "total_redeemed": 0 + }, + "orders": { + "total_amount": 0, + "total_discount_amount": 0 } - } + }, + "object": "promotion_tier", + "validation_rule_assignments": null } } + }, + "Failed Redemption": { + "value": { + "id": "rf_0c5bde8dfc0156f0e3", + "object": "redemption", + "date": "2023-01-25T10:47:58.578Z", + "customer_id": null, + "tracking_id": null, + "metadata": null, + "result": "FAILURE", + "failure_code": "not_found", + "failure_message": "Resource not found", + "order": null, + "channel": { + "channel_id": "abcdefg-efgj-ijkl-mnop-qrstuvxyz", + "channel_type": "API" + }, + "customer": null, + "related_object_type": "redemption", + "related_object_id": "rf_0c5bde8dfc0156f0e3", + "voucher": null + } } } } } - }, - "/v1/redemptions/{redemptionId}/rollback": { - "parameters": [ - { + } + } + } + }, + "/v1/vouchers/{code}/redemption": { + "parameters": [ + { + "$ref": "#/components/parameters/code" + } + ], + "get": { + "operationId": "get-voucher-redemptions", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Get Voucher's Redemptions", + "description": "Retrieve the number of times a voucher was redeemed and each of the redemption details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "A dictionary with a `redemption_entries` property that contains an array of voucher's redemptions.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "redemptionId", - "in": "path", - "required": true, - "description": "The original redemption ID to be rolled back (undone)." - } - ], - "post": { - "operationId": "rollback-redemption", - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Rollback Redemption", - "description": "Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. \n\n ## Effect \nThe operation \n- creates a rollback entry in voucher's redemption history (`redemption.redemption_entries`) and \n- gives 1 redemption back to the pool (decreases `redeemed_quantity` by 1). \n## Returned funds \nIn case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "reason", - "description": "Reason for the rollback." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_rollback_redemption" - }, - "examples": { - "Promotion": { - "value": { - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemons", - "email": "annie@lemon.com", - "phone": "+1 933 222 3334", - "birthday": "1900-12-02", - "birthdate": "1900-12-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "country": "United States", - "postal_code": "100012" + "$ref": "#/components/schemas/7_res_get_vouchers_redemptions" + }, + "examples": { + "Example": { + "value": { + "quantity": null, + "redeemed_quantity": 6, + "object": "list", + "url": "/v1/vouchers/Test - FB - Vouchers - 9/redemptions?page=1&limit=10", + "data_ref": "redemption_entries", + "total": 6, + "redemption_entries": [ + { + "id": "r_0bc92f81a6801f9bca", + "object": "redemption", + "date": "2022-10-03T12:24:58.008Z", + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_bhp1EH2SDz7UwkkurPFPLPhi", + "source_id": null, + "created_at": "2022-10-03T12:24:56.179Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 229900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "object": "customer" }, - "metadata": { - "age": 23 + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92f81a6801f9bca": { + "date": "2022-10-03T12:24:56.219Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } } }, - "order": { - "source_id": "test_rollback_8" + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" }, - "metadata": { - "location_id": [ - "L2" - ] + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "name": null, + "email": null, + "source_id": "johnnyy@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a redemption rollback object indicating the result of the rollback.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_res_rollback_redemption" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "rr_0c5eba630bc4979e70", - "object": "redemption_rollback", - "date": "2023-01-27T16:05:23.631Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": -2, - "redemption": "r_0c5bf3323008a35032", - "reason": "A UI rollback to check for result in API response to listing.", - "result": "SUCCESS", - "order": { - "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", - "source_id": null, - "created_at": "2023-01-25T12:18:09.203Z", - "updated_at": "2023-01-27T16:05:23.687Z", - "status": "CANCELED", - "amount": 2100, - "total_amount": 2100, - "items": [ - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 3, - "amount": 2100, - "price": 700, - "subtotal_amount": 2100, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5bf3323008a35032": { - "date": "2023-01-25T12:18:09.216Z", - "rollback_id": "rr_0c5eba630bc4979e70", - "rollback_date": "2023-01-27T16:05:23.631Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + }, + { + "id": "r_0bc92e6a68050e118c", + "object": "redemption", + "date": "2022-10-03T12:20:11.873Z", + "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmKhuFqhawWj", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_rBsuJYqf4eFZgqj6IxeJgEcN", + "source_id": null, + "created_at": "2022-10-03T12:20:10.222Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 229900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } } - }, - "channel": { - "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", - "channel_type": "USER" - }, + ], + "metadata": {}, "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, + "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "categories": [], - "discount": null, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "additional_info": null, - "assets": { - "qr": {}, - "barcode": {} - }, - "updated_at": null, - "object": "voucher" + "customer_id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92e6a68050e118c": { + "date": "2022-10-03T12:20:10.272Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_TzWOhveicr7BI1Qg4bCFrrQQ", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_4", + "metadata": { + "lang": "en", + "test": true }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", - "code": "HAPPY-ORDER5My", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "21ceb848-4869-4dac-ba41-f854bda3a101", - "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" - }, - "barcode": { - "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" - } - }, - "is_referral_code": false, - "created_at": "2023-01-25T12:18:09.256Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc92db6e6001f9aa8", + "object": "redemption", + "date": "2022-10-03T12:17:07.780Z", + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "tracking_id": "track_5DQxXbK0C0pvAaHk7mnulmYlx396Pk4X", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_JvZbg1LFcXdQ67no5SENGldH", + "source_id": null, + "created_at": "2022-10-03T12:17:06.404Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 1200, + "total_discount_amount": 1200, + "total_amount": 228800, + "applied_discount_amount": 1200, + "total_applied_discount_amount": 1200, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } - }, - "type": "CAMPAIGN" + } + ], + "metadata": {}, + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "object": "customer" }, - "loyalty_card": { - "points": -2 + "customer_id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc92db6e6001f9aa8": { + "date": "2022-10-03T12:17:06.456Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_BB6F97yf0XqCe7hxVUV7M4sS", + "name": "Bob Jones", + "email": "bob.smith@email.com", + "source_id": "pub_source_customer_5", + "metadata": { + "lang": "en", + "test": true + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null } }, - "Discount Coupon": { - "value": { - "id": "rr_0c5eb002b40cce9d62", - "object": "redemption_rollback", - "date": "2023-01-27T15:20:03.536Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "redemption": "r_0c5e8ef10842da0aad", - "result": "SUCCESS", - "order": { - "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", - "source_id": null, - "created_at": "2023-01-27T12:55:34.673Z", - "updated_at": "2023-01-27T15:20:03.743Z", - "status": "CANCELED", - "amount": 6000, - "total_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8ef10842da0aad": { - "date": "2023-01-27T12:55:34.689Z", - "rollback_id": "rr_0c5eb002b40cce9d62", - "rollback_date": "2023-01-27T15:20:03.536Z", - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + { + "id": "r_0bc2dc6404426c0ab3", + "object": "redemption", + "date": "2022-09-28T14:30:56.199Z", + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "tracking_id": "track_fxEMFisanb6bqeHALcTMxy9fmc+1Azdq951CZwGFCweQF8eGLowFHg==", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_6uuhGraDuXMOpVRTJT251kKW", + "source_id": null, + "created_at": "2022-09-28T14:30:54.681Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 800, + "total_discount_amount": 800, + "total_amount": 229200, + "applied_discount_amount": 800, + "total_applied_discount_amount": 800, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } } - }, + ], + "metadata": {}, "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "voucher": { - "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "code": "2CpRCE2c", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 300, - "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" - }, - "gift": null, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-19T10:06:07.932Z", - "updated_at": "2023-01-27T15:20:03.707Z", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "object": "list", - "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" - }, - "object": "voucher" + "customer_id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2dc6404426c0ab3": { + "date": "2022-09-28T14:30:54.737Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_i8t5Tt6eiKG5K79KQlJ0Vs64", + "name": null, + "email": null, + "source_id": "jonny@email.com", + "metadata": {}, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null } - }, - "Gift Card": { - "value": { - "id": "rr_0c5eb099214ccea115", - "object": "redemption_rollback", - "date": "2023-01-27T15:22:37.573Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": -2000, - "redemption": "r_0c5e8a38730ccec0d5", - "result": "SUCCESS", - "order": { - "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", - "source_id": null, - "created_at": "2023-01-27T12:34:57.086Z", - "updated_at": "2023-01-27T15:22:37.628Z", - "status": "CANCELED", - "amount": 6000, - "total_amount": 6000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0a9f9ab4ab019a42d5", - "quantity": 1, - "amount": 3300, - "price": 3000, - "subtotal_amount": 3300 - }, - { - "object": "order_item", - "product_id": "prod_0a9f9aeddb019a42db", - "quantity": 2, - "amount": 3400, - "price": 3000, - "subtotal_amount": 3400 - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c5e8a38730ccec0d5": { - "date": "2023-01-27T12:34:57.100Z", - "rollback_id": "rr_0c5eb099214ccea115", - "rollback_date": "2023-01-27T15:22:37.573Z", - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + }, + { + "id": "r_0bc2d6f0ebc95f1783", + "object": "redemption", + "date": "2022-09-28T14:07:07.516Z", + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "tracking_id": "track_ThofCMTQe4EVIo0zvvOlTor1twaQNd7E", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ZQevc2J2sBegsnp5DwanXHsa", + "source_id": null, + "created_at": "2022-09-28T14:07:06.073Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 0, + "total_discount_amount": 0, + "total_amount": 230000, + "applied_discount_amount": 0, + "total_applied_discount_amount": 0, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } } - }, + ], + "metadata": {}, "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", "object": "customer" }, - "related_object_type": "voucher", - "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "voucher": { - "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", - "code": "CODE14", - "campaign": "Gift Card Campaign", - "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", - "category": "Second", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 2000, - "balance": 2000, - "effect": null - }, - "loyalty_card": null, - "start_date": "2020-08-16T00:00:00.000Z", - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": "secret-code1", - "metadata": { - "region": "APAC", - "season": "Fall" - }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-09-23T11:05:42.164Z", - "updated_at": "2023-01-27T15:22:37.595Z", - "redemption": { - "quantity": 18, - "redeemed_quantity": 0, - "redeemed_amount": 0, - "object": "list", - "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 0, - "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "gift": { - "amount": -2000 + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2d6f0ebc95f1783": { + "date": "2022-09-28T14:07:06.159Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } } - } - }, - "Promotion Tier": { - "value": { - "id": "rr_0ca286e96cc03f3e76", - "object": "redemption_rollback", - "date": "2023-03-21T07:57:12.526Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "name": "Bob Smith", + "email": "bob.smith.1@email.com", + "source_id": "bob.smith.1@email.com", "metadata": { - "location_id": [ - "L2" - ] + "lang": "en", + "test": false }, - "redemption": "r_0ca286d222d2f7dc1f", - "reason": "To undo a redemption.", - "result": "SUCCESS", - "order": { - "id": "ord_0FR01SqYIxV4ITzgs1yZjkK6", - "source_id": "test_rollback_8", - "created_at": "2023-03-21T07:56:48.634Z", - "updated_at": "2023-03-21T07:57:12.546Z", - "status": "CANCELED", - "amount": 200000, - "total_amount": 200000, - "items": [ - { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } - }, - "metadata": { - "series": "2022-783CV" - } - }, - { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ca286d222d2f7dc1f": { - "date": "2023-03-21T07:56:48.651Z", - "rollback_id": "rr_0ca286e96cc03f3e76", - "rollback_date": "2023-03-21T07:57:12.526Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null + } + }, + { + "id": "r_0bc2d3c4f7495f159a", + "object": "redemption", + "date": "2022-09-28T13:53:16.057Z", + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "tracking_id": "track_fxEMFisanb4sbl4Z4yCnJyDW013IrRbJmqKByTNHbXE=", + "metadata": {}, + "result": "SUCCESS", + "order": { + "id": "ord_ff6rwr58kmdyuLsi5orplnVW", + "source_id": null, + "created_at": "2022-09-28T13:53:14.604Z", + "updated_at": null, + "status": "PAID", + "amount": 230000, + "discount_amount": 800, + "total_discount_amount": 800, + "total_amount": 229200, + "applied_discount_amount": 800, + "total_applied_discount_amount": 800, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bae45ffc7003ffc52", + "quantity": 1, + "amount": 230000, + "price": 230000, + "subtotal_amount": 230000, + "product": { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000 } } - }, - "channel": { - "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", - "channel_type": "API" - }, + ], + "metadata": {}, "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemons", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 23 - }, + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", "object": "customer" }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 5 - }, - "orders": { - "total_amount": 616000, - "total_discount_amount": 246400 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": null, - "category_id": null, - "categories": [] + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0bc2d3c4f7495f159a": { + "date": "2022-09-28T13:53:14.717Z", + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno" + } } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "name": "John Smith", + "email": "john.smith@email.com", + "source_id": "john.smith@email.com", + "metadata": { + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "voucher": { + "id": "v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno", + "code": "Test - FB - Vouchers - 9", + "campaign_id": null } } - } + ] } } - }, - "400": { - "description": "Returns an error if the rollback redemption process failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Already rolledback": { - "value": { - "code": 400, - "key": "already_rolled_back", - "message": "Already rolled back", - "details": "Redemption has been already rolled back.", - "request_id": "v-0c5eb3bd81cd7e3a39", - "resource_id": "rrf_0c5eb3bd884497ed05", - "resource_type": "redemption_rollback" + } + } + } + } + } + }, + "post": { + "operationId": "redeem-voucher", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Voucher [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you create a redemption object. It increments the redemption counter and updates the history of the voucher. \n\n## How discounts and order amounts are calculated in the API response?\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | total_amount = amount - total_discount_amount | This field shows the order amount after applying all the discounts |\n| discount_amount | discount_amount = previous_discount_amount + applied_discount_amount | This field sums up all order-level discounts applied to a patricular order |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts applied to this order |\n| total_discount_amount | total_discount_amount = discount_amount + items_discount_amount | This field sums up all order-level and all product-specific discounts applied to this order |\n| applied_discount_amount | N/A | This field shows order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | total_applied_discount_amount = applied_discount_amount + items_applied_discount_amount | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n## SDKs \n\nYou can invoke the redemption endpoint with one of the official libraries: \n\n\n[block:html]\n{\n \"html\": \"
                  \\n\\n
                  \\n \\n
                  \\n\\n
                  \\n\\n
                  \\n\\n\\n
                  \\n\\n\\n\\n\\n\\n
                  \\n\\n
                  \\n
                  \\n\\n\"\n}\n[/block]\n\n## Customer tracking\n\nThe redeem operation is a key part of [Customer tracking] (doc:customer-tracking) workflow. There're 3 ways you can identify your end customer in Voucherify within this request. You can either provide a tracking ID (e.g. your customer's login or a generated id), a customer ID (if the customer is already stored in Voucherify) or a full `customer` object in the payload. Note that you can pass and thus store any customer-related metadata. See examples on the right.\n\n\n```json\n\"customer\": {\n \"source_id\": \"alice.morgan\",\n \"name\": \"Alice Morgan\",\n \"email\": \"alice@morgan.com\",\n \"description\": \"\",\n \"metadata\": {\n \"locale\": \"en-GB\",\n \"shoeSize\": 5,\n \"favourite_brands\": [\"Armani\", \"L’Autre Chose\", \"Vicini\"]\n }\n}\n```\n\nIf you already created a customer profile in Voucherify's database, whether it was implicitly by providing it to the redeem function or explicitly by invoking the [Create Customer](ref:create-customer) method, you can identify your customer in redemptions by a generated ID (starting with `cust_`). \n\n\n```json title=Example Customer Identifier [object]\n\"customer\": {\n \"id\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier\n{\n \"customer\": \"cust_C9qJ3xKgZFqkpMw7b21MF2ow\"\n}\n```\n\n```json title=Example Customer Identifier by Source ID\n{\n \"customer\": \"alice.morgan\"\n}\n```\n\n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).\n\n## Redemption failures\n\nThere are several reasons why a redemption may fail. You will get the reason in the error key:\n - `resource_not_found` - voucher with given code does not exist\n- `voucher_not_active` - voucher is not active yet (before start date)\n- `voucher_expired` - voucher has already expired (after expiration date)\n- `voucher_disabled` - voucher has been disabled (`active: false`)\n- `quantity_exceeded` - voucher's redemptions limit has been exceeded\n- `gift_amount_exceeded` - gift amount has been exceeded\n- `customer_rules_violated` - customer did not match the segment\n- `order_rules_violated` - order did not match validation rules\n- `invalid_order` - order was specified incorrectly\n- `invalid_amount` - order amount was specified incorrectly\n- `missing_amount` - order amount was not specified\n- `missing_order_items` - order items were not specified\n- `missing_customer` - customer was not specified\n\n## Order object\n\nThe purchase of previously defined products (products are stored in Voucherify) by end customers is handled through the order object. You are obligated to pass the order object in case you use validation rules. You can learn more about the [validation rules structure] (doc:validation-rules). \n\n| **Attributes** | **Description** |\n|:---|:---|\n| amount
                  `integer` | A positive integer representing the total amount for the order. |\n| items
                  `list` | List of items constituting the order. Order items can be defined either by `product_id` or `sku_id`. Along with every item you must define the `quantity`.

                  Child attributes:

                  - `product_id` (*string*) - The ID of the associated product object for this line item.

                  - `sku_id` (*string*) - The ID of the associated variant (sku) object for this line item.

                  - `quantity` (*integer*) - A positive integer representing the number of instances of the item that are included in this order line.

                  - `price` (*integer*) - A positive integer representing the cost of an item.

                  - `amount` (*integer*) - `quantity` * `price` (you should provide it to retrieve `discount_amount` for a particular order item if the discount is applied only to this item learn more |\n\n\n\n\n> 🚧 Order ID\n>\n> If you use the same order id in more than one redemption request, all valid discounts provided in the redemption payload will be applied to the given order. [Read more in this guide] (https://docs.voucherify.io/docs/manage-stackable-discounts).\n\n\n```json title=Example Order\n\"order\": {\n \"amount\": 10000,\n \"items\": [\n {\n \"product_id\": \"prod_Bi7sRr3kwvxH2I\",\n \"quantity\": 1\n }\n ]\n}\n```\n## Gift Vouchers - redeem Gift Card and control redeemed amount\n\nIn Voucherify,you can also create a gift card for customers. Customers then can use gift card credits to fulfill the order. A user can specify how many credits he wants to use from the gift card. The available balance of credits is counted based on policy rules attached to the Gift Voucher definition.\n\nWhen the user wants to define how many gift credits are to be used from the gift card to complete the order, the `credits` property can be assigned the equivalent value in the lowest currency in the request body. The value of credits being applied to the order cannot be higher than the current balance on the gift card.\n\n\n```cURL title=Example Request - control redeemed amount\ncurl -i -X POST \\\n -H \"Content-Type:application/json\" \\\n -H \"X-App-Id:c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token:3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -d '{\n \"order\": {\n \"amount\": 2500\n },\n \"gift\": {\n \"credits\": 1500\n }\n }' \\ \n 'https://api.voucherify.io/v1/vouchers/aDm4CRR3/redemption'\n```\n## Loyalty Coins - redeem loyalty card and pay with points\n\nVoucherify offers the possibility to set up a reward type in the Loyalty Program, which allows using loyalty points as gift credits. The available balance of credits is counted based on policy rules attached to the reward definition.\n\nIf a user configures just one reward type of paying in points, in the redemption request, there is no additional information required. Voucherify will automatically select as a proper reward definition and will calculate the discount based on the attached policy. \n\n\n```json title=Example Request\n{\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_zv5Qn7cF68RbVX4foKxgwUi1\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:44:20Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 250,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_Tgi2ApelDyl86sm5AYDKCBMZ\",\n \"created_at\": \"2020-05-24T13:44:20Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": \"ltr_3q5dW6GaRC4QkA1oYmfGy1k1\",\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-23T08:18:55Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 489,\n \"balance\": 23\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 8,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 466\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:44:20Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nIn case the user wants to define how much he spends in points, it is configurable by property `points` in a request body.\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 10\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_NJIfNYD8uc2lNm3YBAqXr3FF\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T16:28:29Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_70kKdXIKCSx5cfglKSpz9aHy\",\n \"created_at\": \"2020-05-24T16:28:29Z\",\n \"discount_amount\": 250\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_pHilLjHWOD7oNjJZnog3VoEi\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_3qmzGPWJ7LfLXnPAjmbPacIl\",\n \"name\": \"1 point - 25 cents\",\n \"created_at\": \"2020-05-22T18:39:52Z\",\n \"updated_at\": \"2020-05-24T13:44:26Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 0.25\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 539,\n \"balance\": 63\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 9,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 476\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T16:28:29Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```\n\nMoreover, it is possible to define many levels of reward in which collected points can be used as gift credits. Per each tier, we can implement different conversion factors. Having many options in the rewards catalog, we will need to select a coins calculation policy (reward ID) that we want to use for calculating a final discount in the redemption request.\n\n\n\n```json title=Example Request\n{\n \"reward\": {\n \"points\": 30,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\"\n },\n \"order\": {\n \"amount\": 25000,\n \"items\": [\n {\n \"product_id\": \"test_source_1\",\n \"quantity\": \"1\",\n \"price\": 15000\n },\n {\n \"product_id\": \"test_source_2\",\n \"quantity\": \"1\",\n \"price\": 10000\n }\n ]\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n }\n}\n```\n\n```json title=Example Response\n{\n \"id\": \"r_se17sLon6YX5wMhYVzfQa2dc\",\n \"object\": \"redemption\",\n \"date\": \"2020-05-24T13:41:16Z\",\n \"customer_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"amount\": 10,\n \"order\": {\n \"status\": \"PROCESSING\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_1\",\n \"quantity\": 1,\n \"amount\": 15000,\n \"price\": 15000\n },\n {\n \"object\": \"order_item\",\n \"product_id\": \"test_source_2\",\n \"quantity\": 1,\n \"amount\": 10000,\n \"price\": 10000\n }\n ],\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"object\": \"customer\",\n \"referrals\": {\n \"campaigns\": [],\n \"total\": 0\n }\n },\n \"amount\": 25000,\n \"object\": \"order\",\n \"id\": \"ord_EfMmve84JzQIg2MCM3cAvLgF\",\n \"created_at\": \"2020-05-24T13:41:16Z\",\n \"discount_amount\": 25000\n },\n \"customer\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_g3QQwQfhJrjBYzEa1NJkub7N\",\n \"loyalty_tier_id\": null,\n \"id\": \"rew_noP2S5H8PEBFT97mennSA531\",\n \"name\": \"1 point 25$\",\n \"created_at\": \"2020-05-24T12:57:19Z\",\n \"parameters\": {\n \"automation_id\": null,\n \"coin\": {\n \"exchange_ratio\": 25.0\n }\n },\n \"type\": \"COIN\",\n \"object\": \"reward\"\n },\n \"metadata\": {\n \"category\": \"vip\",\n \"shop\": \"s1\",\n \"location\": \"l1\"\n },\n \"result\": \"SUCCESS\",\n \"tracking_id\": \"track_IWQYtuUE7phYpPzTHD5uwbyvlrO4nqyzipbQQtsHrRw=\",\n \"voucher\": {\n \"id\": \"v_wjgLC2lrQy1urPOdd35JX0RtkcOcQOmb\",\n \"code\": \"Dm1x8MuX\",\n \"campaign\": \"TestLoyalty-GivePoints\",\n \"campaign_id\": \"camp_qVVaC4vpVlof03eBi8qb5gE7\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 439,\n \"balance\": 223\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/Dm1x8MuX/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 7,\n \"url\": \"/v1/vouchers/Dm1x8MuX/redemptions?page=1&limit=10\",\n \"redeemed_points\": 216\n },\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B9Eo0bLWMZmYK6nQxl3AyR3nqkloGURcpRJcxL3hl5xXSGRYjYdySc9twLaKnYGVXbLtjCGW8FBotl1rTAxLJQm4okoJ385Gd6pc1ty6AnhaHHJjCeLoYYSQCG1EyP9PRxnTihjmsE9g%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19NfR0ANlhLM7Df9Ec+xqTh6aTbHakk/Gzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF/BSQTyJx0YSK+HIUG9RGD+9rVhiC7+4WkSKrgAZ+NeqQBIqcespt8WWygXjfkvbyXBSF7Lg==\",\n \"url\": \"https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19NfR0ANlhLM7Df9Ec%2BxqTh6aTbHakk%2FGzeh9zTiuj8KUBLswVXkz0gdLVnn1ZtzjCv7oF%2FBSQTyJx0YSK%2BHIUG9RGD%2B9rVhiC7%2B4WkSKrgAZ%2BNeqQBIqcespt8WWygXjfkvbyXBSF7Lg%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"holder_id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"updated_at\": \"2020-05-24T13:41:16Z\",\n \"holder\": {\n \"id\": \"cust_lXisxEaEHYKTEVf1YnNS8AUh\",\n \"source_id\": \"tom+Loyalty@email.com\",\n \"name\": \"Tom Loyalty\",\n \"email\": \"tom+Loyalty@email.com\",\n \"metadata\": {},\n \"object\": \"customer\"\n },\n \"object\": \"voucher\",\n \"validation_rules_assignments\": {\n \"data\": [],\n \"object\": \"list\",\n \"total\": 0,\n \"data_ref\": \"data\"\n }\n }\n}\n```", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returnee by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. **Although not all information is required, the extra info helps prevent fraud.**" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_voucher" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_redeem_voucher" + }, + "examples": { + "Gift Voucher": { + "value": { + "id": "r_0c5e8a38730ccec0d5", + "object": "redemption", + "date": "2023-01-27T12:34:57.100Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2000, + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 4000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 0, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" }, - "Invalid Redemption Parent": { - "value": { - "code": 400, - "key": "invalid_redemption_parent", - "message": "Invalid redemption parent", - "details": "You can rollback only a redemption that does not have parent redemption.", - "request_id": "v-0c6382005e03b3bd2f" + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" } }, - "Invalid Redemption": { - "value": { - "code": 400, - "key": "invalid_redemption", - "message": "Invalid redemption", - "details": "You can rollback only a single redemption. Use different endpoint for stacked redemption.", - "request_id": "v-0c675e5e2e04e31bb3" + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T12:34:57.102Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 18, + "redeemed_quantity": 1, + "redeemed_amount": 2000, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "gift": { + "amount": 2000 + } + } + }, + "Discount Coupon": { + "value": { + "id": "r_0c5e8ef10842da0aad", + "object": "redemption", + "date": "2023-01-27T12:55:34.689Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 5700, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "discount_amount": 148, + "applied_discount_amount": 148, + "price": 3000, + "subtotal_amount": 3152 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "discount_amount": 152, + "applied_discount_amount": 152, + "price": 3000, + "subtotal_amount": 3248 } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Invalid Order": { - "value": { - "code": 400, - "key": "invalid_order", - "message": "Invalid order", - "details": "Order is not related with redemption.", - "request_id": "v-0ca2770e3fc4047e25" + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" }, - "Invalidate Customer": { - "value": { - "code": 400, - "key": "invalid_customer", - "message": "Invalid customer", - "details": "Customer is not related with redemption.", - "request_id": "v-0ca284851b0404513f" + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T12:55:34.690Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } } } - } - }, - "404": { - "description": "Returns an error if the rollback redemption process failed.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Cannot find customer": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_eWgXlBBiY6THFRJwX45Iakv4s", - "request_id": "v-0c5ebc5de80a2cf1a5", - "resource_id": "cust_eWgXlBBiY6THFRJwX45Iakv4s", - "resource_type": "customer" + }, + "Loyalty Card": { + "value": { + "id": "r_0c5e8f2cd78497a372", + "object": "redemption", + "date": "2023-01-27T12:56:35.934Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_MGTimoN4VtSj7iT75bP01FsH", + "source_id": null, + "created_at": "2023-01-27T12:56:35.923Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 0, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8f2cd78497a372": { + "date": "2023-01-27T12:56:35.934Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 6500, + "balance": 5086 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-01-27T12:56:35.935Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1414, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 300 } } } @@ -64521,1284 +63141,1367 @@ } } }, - "/v1/promotions/tiers/{promotionTierId}/redemption": { - "parameters": [ - { + "400": { + "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "promotionTierId", - "in": "path", - "required": true, - "description": "ID of the promotion tier to be redeemed." - } - ], - "post": { - "operationId": "redeem-promotion", - "deprecated": true, - "tags": [ - "REDEMPTIONS API" - ], - "summary": "Redeem Promotion [Deprecated]", - "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a promotion, you create a redemption object passing a context.\n\nYou can retrieve a list of active promotions through the [Validate Promotions](ref:validate-promotions) endpoint. That validation method will return a list of active​ promotion tiers identified by thier IDs. \n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the redemption context in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_req_redeem_promotion_tier" - }, - "examples": { - "One product one sku": { - "value": { - "customer": { - "source_id": "annie@lemon.com", - "name": "Annie Lemon", - "email": "annie@lemon.com" - }, - "order": { - "amount": 200000, - "items": [ - { - "source_id": "apple534", - "product_id": "prod_anJ03RZZq74z4v", - "related_object": "product", - "quantity": 2, - "price": 50000, - "product": { - "override": true, - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } - }, - "metadata": { - "series": "2022-783CV" - } - }, - { - "sku_id": "sku_0KtP4rvwEECQ2U", - "source_id": "apple534-ihd5", - "related_object": "sku", - "quantity": 1, - "price": 100000, - "sku": { - "override": true, - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ] - } - } + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Voucher disabled": { + "value": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "AnsvocvP", + "request_id": "v-0c5d710a63c4110ae9", + "resource_id": "rf_0c5d710a87c8a31f86", + "resource_type": "redemption", + "error": { + "message": "The voucher has been disabled and cannot be used." + } + } + }, + "Invalid Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Customer must be a holder of a loyalty card.", + "details": "AnsvocvP", + "request_id": "v-0c5e628bd14411244b", + "resource_id": "rf_0c5e628bf841c7f248", + "resource_type": "redemption", + "error": { + "message": "The customer is invalid." + } + } + }, + "Voucher Inactive": { + "value": { + "code": 400, + "key": "voucher_not_active_now", + "message": "voucher not active now", + "details": "CODE14", + "request_id": "v-0c5e89b9300d820994", + "resource_id": "rf_0c5e89b945d33b9c02", + "resource_type": "redemption", + "error": { + "message": "The voucher is not active in the given timeframe." } } } } - }, - "responses": { - "200": { - "description": "Returns a redemption object if the redeem operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended" - }, - "examples": { - "One product one sku": { - "value": { - "id": "r_0ca2699201c03f121b", - "object": "redemption", - "date": "2023-03-21T05:49:00.807Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_IVEF85NZCXmP4S1fGmImSTwH", - "source_id": null, - "created_at": "2023-03-21T05:49:00.772Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ - { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } - }, - "metadata": { - "series": "2022-783CV" - } - }, - { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ca2699201c03f121b": { - "date": "2023-03-21T05:49:00.807Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" - } - } - }, - "channel": { - "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", - "channel_type": "API" - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 5 - }, - "orders": { - "total_amount": 616000, - "total_discount_amount": 246400 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_z6MvMg2Zf2UABNWN", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_type": "promotion_tier", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, - "category_id": null, - "categories": [] - } + } + } + } + } + } + }, + "/client/v1/redeem": { + "post": { + "operationId": "redeem-voucher-client-side", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Voucher (client-side) [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for voucher redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts-client-side) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a voucher, you need to create a redemption object. It increments the redemption counter and updates the history of the voucher. This method is accessible through public keys, which you can use in client-side apps (mobile and web browser apps). \n\nThe client-side redemption works similar to the server-side [voucher redemption](ref:redeem-voucher) endpoint. The difference lies in the authorization. For the client-side, you can use client-side keys.\n\n\n> 📘 Opt-in \n>\n> By default this feature is disabled. If you want to use it, you will need to enable the function explicitly in **Project Settings**.\n\n\n> ❗️ Security Threat \n>\n> Be careful if you want to include the voucher redemption functionality directly on your client side (website or mobile app). In this configuration, there is a chance that discounts can be modified before being sent to the server.\n\n### Expand Response\nYou may expand the response by adding the following object to your request body. The expanded response will include the category details of the voucher.\n\n```json\n{\n \"options\": {\n \"expand\": [\n \"category\"\n ]\n }\n}\n```", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "code", + "description": "Voucher code being redeemed.", + "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "tracking_id", + "description": "A tracking identifier of a user that redeemed a voucher. Identifier generated during voucher validation based on your internal id (e.g., email, database ID). This is a hashed customer source ID. If you also pass a customer ID, the tracking ID must be the ID of a source of the customer object. Otherwise, if you do not pass a customer ID, the tracking you provide must either be a token, like the ones returned by [voucher validation](ref:validate-voucher), or a string identifying customer, with the options described below. Although not all information is required, the extra info helps prevent fraud." + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_voucher" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_redeem_voucher" + }, + "examples": { + "Gift Voucher": { + "value": { + "id": "r_0c5e8a38730ccec0d5", + "object": "redemption", + "date": "2023-01-27T12:34:57.100Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2000, + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 4000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" }, - "Example": { - "value": { - "id": "r_0c64c10b8ece60bd91", - "object": "redemption", - "date": "2023-02-01T08:25:22.235Z", - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", - "metadata": null, - "result": "SUCCESS", - "order": { - "id": "ord_7n58dbLV2jMG4C14XjEYEbjh", - "source_id": null, - "created_at": "2023-02-01T08:25:22.192Z", - "updated_at": null, - "status": "PAID", - "amount": 200000, - "discount_amount": 80000, - "total_discount_amount": 80000, - "total_amount": 120000, - "applied_discount_amount": 80000, - "total_applied_discount_amount": 80000, - "items": [ - { - "object": "order_item", - "source_id": "apple534", - "related_object": "product", - "product_id": "prod_anJ03RZZq74z4v", - "quantity": 2, - "amount": 100000, - "price": 50000, - "subtotal_amount": 100000, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8", - "metadata": { - "shop": "citycenter", - "category": "electronics" - } - }, - "metadata": { - "series": "2022-783CV" - } - }, - { - "object": "order_item", - "source_id": "apple534-ihd5", - "related_object": "sku", - "sku_id": "sku_0KtP4rvwEECQ2U", - "quantity": 1, - "amount": 100000, - "price": 100000, - "subtotal_amount": 100000, - "sku": { - "sku": "Apple iPad 10 Silver 64GB", - "metadata": { - "category": "electronics" - } - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "object": "customer" - }, - "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c64c10b8ece60bd91": { - "date": "2023-02-01T08:25:22.235Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" - } - } - }, - "customer": { - "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", - "name": "Annie Lemon", - "email": "annie@lemon.com", - "source_id": "annie@lemon.com", - "metadata": { - "age": 2 - }, - "object": "customer" - }, - "related_object_type": "promotion_tier", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "voucher": null, - "promotion_tier": { - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "created_at": "2022-09-23T08:31:23.022Z", - "updated_at": "2023-02-01T07:47:57.324Z", - "name": "Percent Discount", - "banner": "Get 40% off", - "action": { - "discount": { - "type": "PERCENT", - "percent_off": 40, - "effect": "APPLY_TO_ORDER" - } - }, - "metadata": {}, - "hierarchy": 2, - "campaign": { - "id": "camp_w7BUstntAm8jbIDjfM49volj", - "start_date": "2019-08-16T00:00:00.000Z", - "expiration_date": null, - "active": true, - "object": "campaign" - }, - "campaign_id": null, - "active": true, - "start_date": "2022-09-21T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "summary": { - "redemptions": { - "total_redeemed": 3 - }, - "orders": { - "total_amount": 408000, - "total_discount_amount": 163200 - } - }, - "object": "promotion_tier", - "validation_rule_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_z6MvMg2Zf2UABNWN", - "rule_id": "val_q8qUBMOh5qIQ", - "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "related_object_type": "promotion_tier", - "object": "validation_rules_assignment" - } - ], - "total": 1 - } - } + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" } } - } - } - } - }, - "400": { - "description": "Returns an error if the promotion tier is inactive.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_expanded" - }, - "examples": { - "Inactive Promotion": { - "value": { - "code": 400, - "key": "promotion_inactive", - "message": "Inactive Promotion", - "details": "Promotion Tier with id: promo_DE1N30D731Tg2F6NoMwNas2W is disabled.", - "request_id": "v-0c64b722160294496b", - "resource_id": "rf_0c64b7223cce60eec6", - "resource_type": "redemption", - "error": { - "message": "The promotion is inactive." - } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 0, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T12:34:57.102Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": 18, + "redeemed_quantity": 1, + "redeemed_amount": 2000, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "gift": { + "amount": 2000 } } - } - } - } - } - }, - "/client/v1/redemptions": { - "post": { - "operationId": "redeem-stacked-discounts-client-side", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Redeem Stackable Discounts (client-side)", - "description": "Use this method to redeem up to 5 redeemables in a single API request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions).", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_redemptions" - }, - "examples": { - "Example": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" - } + }, + "Discount Coupon": { + "value": { + "id": "r_0c5e8ef10842da0aad", + "object": "redemption", + "date": "2023-01-27T12:55:34.689Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 5700, + "items_applied_discount_amount": 300, + "total_applied_discount_amount": 300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "discount_amount": 148, + "applied_discount_amount": 148, + "price": 3000, + "subtotal_amount": 3152 }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "discount_amount": 152, + "applied_discount_amount": 152, + "price": 3000, + "subtotal_amount": 3248 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" }, - "redeemables": [ + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T12:55:34.690Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_HesdqEzt5e9c0T56", + "rule_id": "val_gZft0NKZSUWK", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "related_object_type": "voucher", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 2, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0a9f9ab4ab019a42d5", + "source_id": "prod_0a9f9ab4ab019a42d5", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, { - "object": "voucher", - "id": "voucher-code" + "object": "product", + "id": "prod_0a9f9aeddb019a42db", + "source_id": "prod_0a9f9aeddb019a42db", + "strict": true, + "effect": "APPLY_TO_EVERY" } ], - "session": { - "type": "LOCK", - "key": "session_key" + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + } + } + }, + "Loyalty Card": { + "value": { + "id": "r_0c5e8f2cd78497a372", + "object": "redemption", + "date": "2023-01-27T12:56:35.934Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 300, + "result": "SUCCESS", + "order": { + "id": "ord_MGTimoN4VtSj7iT75bP01FsH", + "source_id": null, + "created_at": "2023-01-27T12:56:35.923Z", + "updated_at": null, + "status": "PAID", + "amount": 6000, + "discount_amount": 6000, + "total_discount_amount": 6000, + "total_amount": 0, + "applied_discount_amount": 6000, + "total_applied_discount_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8f2cd78497a372": { + "date": "2023-01-27T12:56:35.934Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 6500, + "balance": 5086 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-01-27T12:56:35.935Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1414, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" ], - "metadata": { - "key": "value" - } + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 } - } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 300 } } } } - }, - "responses": { - "200": { - "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
                  `array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
                  `object` | Represents the final effect of all child redemptions executed during the request. |\n| order
                  `object` | Represents order details after all discounts are applied. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_POST" + } + } + }, + "400": { + "description": "Returns an error if something goes wrong. A common source of error is an invalid or expired voucher, or a valid gift voucher with insufficient available balance.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Voucher disabled": { + "value": { + "code": 400, + "key": "voucher_disabled", + "message": "voucher is disabled", + "details": "AnsvocvP", + "request_id": "v-0c5d710a63c4110ae9", + "resource_id": "rf_0c5d710a87c8a31f86", + "resource_type": "redemption", + "error": { + "message": "The voucher has been disabled and cannot be used." + } + } + }, + "Invalid Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Customer must be a holder of a loyalty card.", + "details": "AnsvocvP", + "request_id": "v-0c5e628bd14411244b", + "resource_id": "rf_0c5e628bf841c7f248", + "resource_type": "redemption", + "error": { + "message": "The customer is invalid." + } + } + }, + "Voucher Inactive": { + "value": { + "code": 400, + "key": "voucher_not_active_now", + "message": "voucher not active now", + "details": "CODE14", + "request_id": "v-0c5e89b9300d820994", + "resource_id": "rf_0c5e89b945d33b9c02", + "resource_type": "redemption", + "error": { + "message": "The voucher is not active in the given timeframe." } } } } } } + } + } + } + }, + "/v1/redemptions/{redemptionId}/rollback": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/validations": { - "post": { - "operationId": "validate-stacked-discounts", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Validate Stackable Discounts", - "description": "Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings.\n \n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_validations" + "name": "redemptionId", + "in": "path", + "required": true, + "description": "The original redemption ID to be rolled back (undone)." + } + ], + "post": { + "operationId": "rollback-redemption", + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Rollback Redemption", + "description": "Your business logic may include a case when you need to undo a redemption. You can revert a redemption by calling this API endpoint. \n\n ## Effect \nThe operation \n- creates a rollback entry in voucher's redemption history (`redemption.redemption_entries`) and \n- gives 1 redemption back to the pool (decreases `redeemed_quantity` by 1). \n## Returned funds \nIn case of *gift card vouchers*, this method returns funds back according to the source redemption. In case of *loyalty card vouchers*, this method returns points back according to the source redemption.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "reason", + "description": "Reason for the rollback." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Add information about the original customer and order. Customer data and Redemption metadata can be updated in Voucherify when passing the customer data in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_rollback_redemption" + }, + "examples": { + "Promotion": { + "value": { + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemons", + "email": "annie@lemon.com", + "phone": "+1 933 222 3334", + "birthday": "1900-12-02", + "birthdate": "1900-12-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 5", + "country": "United States", + "postal_code": "100012" + }, + "metadata": { + "age": 23 + } }, - "examples": { - "1 Redeemable": { - "value": { - "customer": { - "source_id": "sample_customer", - "metadata": { - "key": "value" + "order": { + "source_id": "test_rollback_8" + }, + "metadata": { + "location_id": [ + "L2" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption rollback object indicating the result of the rollback.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_res_rollback_redemption" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "rr_0c5eba630bc4979e70", + "object": "redemption_rollback", + "date": "2023-01-27T16:05:23.631Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": -2, + "redemption": "r_0c5bf3323008a35032", + "reason": "A UI rollback to check for result in API response to listing.", + "result": "SUCCESS", + "order": { + "id": "ord_dqxr4uzaYWkTZnrSEMoQtCF8", + "source_id": null, + "created_at": "2023-01-25T12:18:09.203Z", + "updated_at": "2023-01-27T16:05:23.687Z", + "status": "CANCELED", + "amount": 2100, + "total_amount": 2100, + "items": [ + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 3, + "amount": 2100, + "price": 700, + "subtotal_amount": 2100, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 700 } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5bf3323008a35032": { + "date": "2023-01-25T12:18:09.216Z", + "rollback_id": "rr_0c5eba630bc4979e70", + "rollback_date": "2023-01-27T16:05:23.631Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "channel": { + "channel_id": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH", + "channel_type": "USER" + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "categories": [], + "discount": null, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "additional_info": null, + "assets": { + "qr": {}, + "barcode": {} + }, + "updated_at": null, + "object": "voucher" + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_4GaEX7clyqMaveT7vHhoyRpsIgxv95Q6", + "code": "HAPPY-ORDER5My", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "21ceb848-4869-4dac-ba41-f854bda3a101", + "url": "https://dl.voucherify.io/api/v1/assets/qr/21ceb848-4869-4dac-ba41-f854bda3a101" + }, + "barcode": { + "id": "1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/1dba9cb2-fb28-4c8d-8548-5edb2eb01f5a" } - ], - "session": { - "type": "LOCK" }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - } - ], - "metadata": { - "key": "value" - } + "is_referral_code": false, + "created_at": "2023-01-25T12:18:09.256Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDER5My/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDER5My/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" } - } + }, + "type": "CAMPAIGN" }, - "5 Redeemables": { - "value": { - "customer": { - "source_id": "36_bob" - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] + "loyalty_card": { + "points": -2 + } + } + }, + "Discount Coupon": { + "value": { + "id": "rr_0c5eb002b40cce9d62", + "object": "redemption_rollback", + "date": "2023-01-27T15:20:03.536Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "redemption": "r_0c5e8ef10842da0aad", + "result": "SUCCESS", + "order": { + "id": "ord_J5ogV1Gkk2yfxmBEhYIg4O65", + "source_id": null, + "created_at": "2023-01-27T12:55:34.673Z", + "updated_at": "2023-01-27T15:20:03.743Z", + "status": "CANCELED", + "amount": 6000, + "total_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 }, - "redeemables": [ - { - "object": "voucher", - "id": "GNcuPKGe" - }, - { - "object": "voucher", - "id": "AnsvocvP", - "reward": { - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - } - }, - { - "object": "voucher", - "id": "M3X8IwW8", - "gift": { - "credits": 100 - } - }, - { - "object": "promotion_tier", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W" - }, - { - "object": "promotion_tier", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" - } + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8ef10842da0aad": { + "date": "2023-01-27T12:55:34.689Z", + "rollback_id": "rr_0c5eb002b40cce9d62", + "rollback_date": "2023-01-27T15:20:03.536Z", + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" ], - "session": { - "type": "LOCK" + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "voucher": { + "id": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "code": "2CpRCE2c", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 300, + "effect": "APPLY_TO_ITEMS_PROPORTIONALLY" + }, + "gift": null, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1+ro/6HLsfI9E/rz0QEoYv+rcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz+WQtg4nKpjUS0wcA7AuIbz2zb870YfJO/r5UBS5gCqQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bro%2F6HLsfI9E%2Frz0QEoYv%2BrcVIEERdbV3gB4104zYyGfpydtSxS1WfpbuiDUfMizQAl1EMzoYsud5XTKBBwUkGkI5IPl84lPz%2BWQtg4nKpjUS0wcA7AuIbz2zb870YfJO%2Fr5UBS5gCqQ%3D%3D" }, - "order": { - "items": [ - { - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1 - }, - { - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1 - } - ] + "barcode": { + "id": "U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3/4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ+aTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19SWjP3ZUbFh26gCGb4xm3K95jhzfk1XXlKcYlHPtDTYR3%2F4dYbig4xxRmkgpQLa93Woz9Hq3h4JBQ%2BaTlftkEzL4D4OSAWi1aWlfxVikrJd6TMFLh9mmbmskodjs4MIdOFlluDWyarlw%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-09-19T10:06:07.932Z", + "updated_at": "2023-01-27T15:20:03.707Z", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "object": "list", + "url": "/v1/vouchers/2CpRCE2c/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/2CpRCE2c/publications?page=1&limit=10" + }, + "object": "voucher" } } - } - } - }, - "responses": { - "200": { - "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
                  `boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
                  `array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
                  `object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_validations" + }, + "Gift Card": { + "value": { + "id": "rr_0c5eb099214ccea115", + "object": "redemption_rollback", + "date": "2023-01-27T15:22:37.573Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": -2000, + "redemption": "r_0c5e8a38730ccec0d5", + "result": "SUCCESS", + "order": { + "id": "ord_S4BvUj64TlGqVZDOeud7z3rU", + "source_id": null, + "created_at": "2023-01-27T12:34:57.086Z", + "updated_at": "2023-01-27T15:22:37.628Z", + "status": "CANCELED", + "amount": 6000, + "total_amount": 6000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0a9f9ab4ab019a42d5", + "quantity": 1, + "amount": 3300, + "price": 3000, + "subtotal_amount": 3300 + }, + { + "object": "order_item", + "product_id": "prod_0a9f9aeddb019a42db", + "quantity": 2, + "amount": 3400, + "price": 3000, + "subtotal_amount": 3400 + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c5e8a38730ccec0d5": { + "date": "2023-01-27T12:34:57.100Z", + "rollback_id": "rr_0c5eb099214ccea115", + "rollback_date": "2023-01-27T15:22:37.573Z", + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "related_object_parent_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6" + } + } }, - "examples": { - "False": { - "value": { - "valid": false, - "redeemables": [ - { - "status": "INAPPLICABLE", - "id": "eee33463", - "object": "voucher", - "result": { - "error": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id eee33463", - "request_id": "v-0c6c6e20dc42940f0b", - "resource_id": "eee33463", - "resource_type": "voucher" - } - } - }, - { - "status": "SKIPPED", - "id": "promo_Mwy9XpA0TLctSGriM5kum0qp", - "object": "promotion_tier", - "result": {} - } - ], - "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==" + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "voucher": { + "id": "v_UFAc7FTVO0HtJV2hWZls4O7eqHMyn62g", + "code": "CODE14", + "campaign": "Gift Card Campaign", + "campaign_id": "camp_B2Gx83JsSbmvj05MOwxYbNm6", + "category": "Second", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 2000, + "balance": 2000, + "effect": null + }, + "loyalty_card": null, + "start_date": "2020-08-16T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": "secret-code1", + "metadata": { + "region": "APAC", + "season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+VibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BVibJ6VGxrSVw5qmdbPMP3aP8HfcngMxtQc9Bm649CK1dK36e8YR820Ct26IkvDemEDzV8ozhB3F2BpazbgvCmhAo2Gvmo2WtwBwPh2ISAPJiXQCHRjwmKiqogjqQaNKWLxwDIBUc2jQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/GVIi0p5fL5hxAY/ZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd//S4R9AB+60T/x4kSKu3lgfa9KgJmbyrzXm7Ggly06/qph4/asJaZVZIXEba4WJCeHqXCEgg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FGVIi0p5fL5hxAY%2FZBmuAU7nYYS03umjd30dwI5v5ZbpNc3Q5MiYbMuIOIT0H2fUTTwd%2F%2FS4R9AB%2B60T%2Fx4kSKu3lgfa9KgJmbyrzXm7Ggly06%2Fqph4%2FasJaZVZIXEba4WJCeHqXCEgg%3D%3D" } }, - "True - 5 Redeemables": { - "value": { - "valid": true, - "redeemables": [ - { - "status": "APPLICABLE", - "id": "GNcuPKGe", - "object": "voucher", - "order": { - "amount": 2700, - "items_discount_amount": 1700, - "total_discount_amount": 1700, - "total_amount": 1000, - "items_applied_discount_amount": 1700, - "total_applied_discount_amount": 1700, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "strict": false, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 3, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS", - "amount_off": 1000, - "is_dynamic": false - } - }, - "metadata": {}, - "categories": [] - }, - { - "status": "APPLICABLE", - "id": "AnsvocvP", - "object": "voucher", - "order": { - "amount": 2700, - "items_discount_amount": 1700, - "total_discount_amount": 1700, - "total_amount": 1000, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "loyalty_card": { - "points": 4 - } - }, - "metadata": {}, - "categories": [ - { - "id": "cat_0bb81a481615a37b5e", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-09-20T05:58:01.561Z", - "object": "category" - } - ] - }, - { - "status": "APPLICABLE", - "id": "M3X8IwW8", - "object": "voucher", - "order": { - "amount": 2700, - "discount_amount": 100, - "items_discount_amount": 1700, - "total_discount_amount": 1800, - "total_amount": 900, - "applied_discount_amount": 100, - "total_applied_discount_amount": 100, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "result": { - "gift": { - "credits": 100 - } - }, - "metadata": {}, - "categories": [] - }, - { - "status": "APPLICABLE", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W", - "object": "promotion_tier", - "order": { - "amount": 2700, - "discount_amount": 460, - "items_discount_amount": 1700, - "total_discount_amount": 2160, - "total_amount": 540, - "applied_discount_amount": 360, - "total_applied_discount_amount": 360, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ - { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 1, - "data_ref": "data", - "object": "list" - }, - "result": { - "discount": { - "type": "PERCENT", - "effect": "APPLY_TO_ORDER", - "percent_off": 40, - "is_dynamic": false - } - }, - "metadata": {} - }, - { - "status": "APPLICABLE", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf", - "object": "promotion_tier", - "order": { - "amount": 2700, - "discount_amount": 490, - "items_discount_amount": 1700, - "total_discount_amount": 2190, - "total_amount": 510, - "applied_discount_amount": 30, - "total_applied_discount_amount": 30, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" - }, - "applicable_to": { - "data": [ - { - "object": "sku", - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "product_id": "prod_s3C0nDpr0DuC7", - "product_source_id": "test_prod_id_2", - "strict": true, - "effect": "APPLY_TO_EVERY" - }, - { - "object": "product", - "id": "prod_0bc3bd8a4e072c5275", - "source_id": "prod_0bc3bd8a4e072c5275", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 2, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [ - { - "object": "product", - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "total": 1, - "data_ref": "data", - "object": "list" - }, - "result": { - "discount": { - "type": "AMOUNT", - "effect": "APPLY_TO_ORDER", - "amount_off": 30, - "is_dynamic": false - } - }, - "metadata": {} + "is_referral_code": false, + "created_at": "2022-09-23T11:05:42.164Z", + "updated_at": "2023-01-27T15:22:37.595Z", + "redemption": { + "quantity": 18, + "redeemed_quantity": 0, + "redeemed_amount": 0, + "object": "list", + "url": "/v1/vouchers/CODE14/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/CODE14/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "gift": { + "amount": -2000 + } + } + }, + "Promotion Tier": { + "value": { + "id": "rr_0ca286e96cc03f3e76", + "object": "redemption_rollback", + "date": "2023-03-21T07:57:12.526Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": { + "location_id": [ + "L2" + ] + }, + "redemption": "r_0ca286d222d2f7dc1f", + "reason": "To undo a redemption.", + "result": "SUCCESS", + "order": { + "id": "ord_0FR01SqYIxV4ITzgs1yZjkK6", + "source_id": "test_rollback_8", + "created_at": "2023-03-21T07:56:48.634Z", + "updated_at": "2023-03-21T07:57:12.546Z", + "status": "CANCELED", + "amount": 200000, + "total_amount": 200000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" } - ], - "order": { - "amount": 2700, - "discount_amount": 490, - "items_discount_amount": 1700, - "total_discount_amount": 2190, - "total_amount": 510, - "applied_discount_amount": 490, - "items_applied_discount_amount": 1700, - "total_applied_discount_amount": 2190, - "items": [ - { - "object": "order_item", - "product_id": "prod_s3C0nDpr0DuC7", - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1, - "amount": 2000, - "discount_amount": 1000, - "applied_discount_amount": 1000, - "price": 2000, - "subtotal_amount": 1000, - "product": { - "id": "prod_s3C0nDpr0DuC7", - "source_id": "test_prod_id_2", - "name": "Watchflix" - }, - "sku": { - "id": "sku_0a3efc90375d1217e2", - "source_id": "test_standard_ultra_hd", - "sku": "Premium", - "price": 2000 - } - }, - { - "object": "order_item", - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1, - "amount": 700, - "discount_amount": 700, - "applied_discount_amount": 700, - "price": 700, - "subtotal_amount": 0, - "product": { - "id": "prod_0bc3bd8a4e072c5275", - "name": "Bouquet - Romantic Roses", - "price": 700 - } - } - ], - "metadata": {}, - "customer_id": null, - "referrer_id": null, - "object": "order" }, - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "session": { - "key": "ssn_pkJfPcWAgp9WyHpA62Eky8X8SzxpKub2", - "type": "LOCK", - "ttl": 7, - "ttl_unit": "DAYS" + "metadata": { + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } } } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ca286d222d2f7dc1f": { + "date": "2023-03-21T07:56:48.651Z", + "rollback_id": "rr_0ca286e96cc03f3e76", + "rollback_date": "2023-03-21T07:57:12.526Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } } - } - } - } - }, - "400": { - "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redeemables[1] should have required property 'id'", - "request_id": "v-0b4ff38ab8c8164573" - } + "channel": { + "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemons", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 23 }, - "Duplicated Redeemables": { - "value": { - "code": 400, - "key": "duplicated_redeemables", - "message": "Duplicated redeemables detected", - "details": "Duplicated redeemables detected in one redemption", - "request_id": "v-0b4ffecfb408165300" + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" } }, - "Invalid Redeemables": { - "value": { - "code": 400, - "key": "invalid_redeemables", - "message": "Invalid redeemables", - "details": "Promotion Stack cannot be use with other redeemables", - "request_id": "v-0b5007812f48165d6b" + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 5 + }, + "orders": { + "total_amount": 616000, + "total_discount_amount": 246400 } - } + }, + "object": "promotion_tier", + "validation_rule_assignments": null, + "category_id": null, + "categories": [] } } } @@ -65806,196 +64509,487 @@ } } }, - "/client/v1/validations": { - "post": { - "operationId": "validate-stacked-discounts-client-side", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Validate Stackable Discounts (client-side)", - "description": "Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" + "400": { + "description": "Returns an error if the rollback redemption process failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Already rolledback": { + "value": { + "code": 400, + "key": "already_rolled_back", + "message": "Already rolled back", + "details": "Redemption has been already rolled back.", + "request_id": "v-0c5eb3bd81cd7e3a39", + "resource_id": "rrf_0c5eb3bd884497ed05", + "resource_type": "redemption_rollback" + } + }, + "Invalid Redemption Parent": { + "value": { + "code": 400, + "key": "invalid_redemption_parent", + "message": "Invalid redemption parent", + "details": "You can rollback only a redemption that does not have parent redemption.", + "request_id": "v-0c6382005e03b3bd2f" + } + }, + "Invalid Redemption": { + "value": { + "code": 400, + "key": "invalid_redemption", + "message": "Invalid redemption", + "details": "You can rollback only a single redemption. Use different endpoint for stacked redemption.", + "request_id": "v-0c675e5e2e04e31bb3" + } + }, + "Invalid Order": { + "value": { + "code": 400, + "key": "invalid_order", + "message": "Invalid order", + "details": "Order is not related with redemption.", + "request_id": "v-0ca2770e3fc4047e25" + } + }, + "Invalidate Customer": { + "value": { + "code": 400, + "key": "invalid_customer", + "message": "Invalid customer", + "details": "Customer is not related with redemption.", + "request_id": "v-0ca284851b0404513f" + } + } } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] + } + } + }, + "404": { + "description": "Returns an error if the rollback redemption process failed.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Cannot find customer": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_eWgXlBBiY6THFRJwX45Iakv4s", + "request_id": "v-0c5ebc5de80a2cf1a5", + "resource_id": "cust_eWgXlBBiY6THFRJwX45Iakv4s", + "resource_type": "customer" + } + } } - ], - "requestBody": { - "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_req_validations" + } + } + } + } + } + }, + "/v1/promotions/tiers/{promotionTierId}/redemption": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "promotionTierId", + "in": "path", + "required": true, + "description": "ID of the promotion tier to be redeemed." + } + ], + "post": { + "operationId": "redeem-promotion", + "deprecated": true, + "tags": [ + "REDEMPTIONS API" + ], + "summary": "Redeem Promotion [Deprecated]", + "description": "\n> ❗️ Deprecated \n>\n> This endpoint represents the deprecated version of the API responsible for promotion tier redemption, and we do not recommend using it. The new [Stackable Discounts API](ref:redeem-stacked-discounts) introduces additional features and improvements while maintaining backward compatibility, including applying a combination of coupon codes and promotion tiers. Developers are encouraged to migrate to the latest version to take advantage of the latest enhancements and bug fixes. No updates will be provided to the deprecated endpoint. \n\nTo redeem a promotion, you create a redemption object passing a context.\n\nYou can retrieve a list of active promotions through the [Validate Promotions](ref:validate-promotions) endpoint. That validation method will return a list of active​ promotion tiers identified by thier IDs. \n\n> 📘 Redemption rollback\n>\n> Do you need to undo a redemption? You can do it with [redemption rollback](ref:rollback-redemption).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the redemption context in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_req_redeem_promotion_tier" + }, + "examples": { + "One product one sku": { + "value": { + "customer": { + "source_id": "annie@lemon.com", + "name": "Annie Lemon", + "email": "annie@lemon.com" }, - "examples": { - "1 Redeemable": { - "value": { - "customer": { - "source_id": "sample_customer", + "order": { + "amount": 200000, + "items": [ + { + "source_id": "apple534", + "product_id": "prod_anJ03RZZq74z4v", + "related_object": "product", + "quantity": 2, + "price": 50000, + "product": { + "override": true, + "name": "Apple iPhone 8", "metadata": { - "key": "value" + "shop": "citycenter", + "category": "electronics" } }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] - }, - "redeemables": [ - { - "object": "voucher", - "id": "voucher-code" + "metadata": { + "series": "2022-783CV" + } + }, + { + "sku_id": "sku_0KtP4rvwEECQ2U", + "source_id": "apple534-ihd5", + "related_object": "sku", + "quantity": 1, + "price": 100000, + "sku": { + "override": true, + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" } - ], - "session": { - "type": "LOCK" - }, - "order": { - "amount": 55000, - "status": "PAID", - "items": [ - { - "quantity": 2, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } - }, - { - "quantity": 1, - "price": 15000, - "source_id": "sample product2", - "related_object": "product", - "product": { - "metadata": { - "key": "value" - } - } + } + } + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a redemption object if the redeem operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/7_obj_redemption_object_promotion_tier_extended" + }, + "examples": { + "One product one sku": { + "value": { + "id": "r_0ca2699201c03f121b", + "object": "redemption", + "date": "2023-03-21T05:49:00.807Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_IVEF85NZCXmP4S1fGmImSTwH", + "source_id": null, + "created_at": "2023-03-21T05:49:00.772Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" } - ], + }, "metadata": { - "key": "value" + "series": "2022-783CV" + } + }, + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" + } } } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ca2699201c03f121b": { + "date": "2023-03-21T05:49:00.807Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" + } } }, - "5 Redeemables": { - "value": { - "customer": { - "source_id": "36_bob" - }, - "options": { - "expand": [ - "order", - "redeemable", - "category" - ] + "channel": { + "channel_id": "e55f3aaa-b303-421a-b562-ca8529ed341d", + "channel_type": "API" + }, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 + }, + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" + } + }, + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": "camp_w7BUstntAm8jbIDjfM49volj", + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 5 }, - "redeemables": [ - { - "object": "voucher", - "id": "GNcuPKGe" - }, - { - "object": "voucher", - "id": "AnsvocvP", - "reward": { - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" - } - }, + "orders": { + "total_amount": 616000, + "total_discount_amount": 246400 + } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ { - "object": "voucher", - "id": "M3X8IwW8", - "gift": { - "credits": 100 + "id": "asgm_z6MvMg2Zf2UABNWN", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_type": "promotion_tier", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "category_id": null, + "categories": [] + } + } + }, + "Example": { + "value": { + "id": "r_0c64c10b8ece60bd91", + "object": "redemption", + "date": "2023-02-01T08:25:22.235Z", + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==", + "metadata": null, + "result": "SUCCESS", + "order": { + "id": "ord_7n58dbLV2jMG4C14XjEYEbjh", + "source_id": null, + "created_at": "2023-02-01T08:25:22.192Z", + "updated_at": null, + "status": "PAID", + "amount": 200000, + "discount_amount": 80000, + "total_discount_amount": 80000, + "total_amount": 120000, + "applied_discount_amount": 80000, + "total_applied_discount_amount": 80000, + "items": [ + { + "object": "order_item", + "source_id": "apple534", + "related_object": "product", + "product_id": "prod_anJ03RZZq74z4v", + "quantity": 2, + "amount": 100000, + "price": 50000, + "subtotal_amount": 100000, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8", + "metadata": { + "shop": "citycenter", + "category": "electronics" } }, - { - "object": "promotion_tier", - "id": "promo_DE1N30D731Tg2F6NoMwNas2W" - }, - { - "object": "promotion_tier", - "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" + "metadata": { + "series": "2022-783CV" } - ], - "session": { - "type": "LOCK" }, - "order": { - "items": [ - { - "sku_id": "sku_0a3efc90375d1217e2", - "quantity": 1 - }, - { - "product_id": "prod_0bc3bd8a4e072c5275", - "quantity": 1 + { + "object": "order_item", + "source_id": "apple534-ihd5", + "related_object": "sku", + "sku_id": "sku_0KtP4rvwEECQ2U", + "quantity": 1, + "amount": 100000, + "price": 100000, + "subtotal_amount": 100000, + "sku": { + "sku": "Apple iPad 10 Silver 64GB", + "metadata": { + "category": "electronics" } - ] + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "object": "customer" + }, + "customer_id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c64c10b8ece60bd91": { + "date": "2023-02-01T08:25:22.235Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_parent_id": "camp_w7BUstntAm8jbIDjfM49volj" } } - } - } - } - } - }, - "responses": { - "200": { - "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
                  `boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
                  `array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
                  `object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_validations" - } - } - } - }, - "400": { - "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .redeemables[1] should have required property 'id'", - "request_id": "v-0b4ff38ab8c8164573" - } + "customer": { + "id": "cust_SolpIN5N4oZbCnrxZ5NHrbVB", + "name": "Annie Lemon", + "email": "annie@lemon.com", + "source_id": "annie@lemon.com", + "metadata": { + "age": 2 }, - "Duplicated Redeemables": { - "value": { - "code": 400, - "key": "duplicated_redeemables", - "message": "Duplicated redeemables detected", - "details": "Duplicated redeemables detected in one redemption", - "request_id": "v-0b4ffecfb408165300" + "object": "customer" + }, + "related_object_type": "promotion_tier", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "voucher": null, + "promotion_tier": { + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "created_at": "2022-09-23T08:31:23.022Z", + "updated_at": "2023-02-01T07:47:57.324Z", + "name": "Percent Discount", + "banner": "Get 40% off", + "action": { + "discount": { + "type": "PERCENT", + "percent_off": 40, + "effect": "APPLY_TO_ORDER" } }, - "Invalid Redeemables": { - "value": { - "code": 400, - "key": "invalid_redeemables", - "message": "Invalid redeemables", - "details": "Promotion Stack cannot be use with other redeemables", - "request_id": "v-0b5007812f48165d6b" + "metadata": {}, + "hierarchy": 2, + "campaign": { + "id": "camp_w7BUstntAm8jbIDjfM49volj", + "start_date": "2019-08-16T00:00:00.000Z", + "expiration_date": null, + "active": true, + "object": "campaign" + }, + "campaign_id": null, + "active": true, + "start_date": "2022-09-21T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "summary": { + "redemptions": { + "total_redeemed": 3 + }, + "orders": { + "total_amount": 408000, + "total_discount_amount": 163200 } + }, + "object": "promotion_tier", + "validation_rule_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_z6MvMg2Zf2UABNWN", + "rule_id": "val_q8qUBMOh5qIQ", + "related_object_id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "related_object_type": "promotion_tier", + "object": "validation_rules_assignment" + } + ], + "total": 1 } } } @@ -66004,1465 +64998,1537 @@ } } }, - "/v1/redemptions/{parentRedemptionId}/rollbacks": { - "parameters": [ - { + "400": { + "description": "Returns an error if the promotion tier is inactive.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "parentRedemptionId", - "in": "path", - "required": true, - "description": "Unique identifier of a parent redemption, e.g. `r_JQfm73zWSJFQxs3bGxweYjgm`." - } - ], - "post": { - "operationId": "rollback-stacked-redemptions", - "tags": [ - "STACKABLE DISCOUNTS API" - ], - "summary": "Rollback Stackable Redemptions", - "description": "Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an array with the individual redemption rollback results along with the parent rollback result and related order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/19_res_redemptions_parentRedemptionId_rollbacks" + "$ref": "#/components/schemas/e_error_expanded" + }, + "examples": { + "Inactive Promotion": { + "value": { + "code": 400, + "key": "promotion_inactive", + "message": "Inactive Promotion", + "details": "Promotion Tier with id: promo_DE1N30D731Tg2F6NoMwNas2W is disabled.", + "request_id": "v-0c64b722160294496b", + "resource_id": "rf_0c64b7223cce60eec6", + "resource_type": "redemption", + "error": { + "message": "The promotion is inactive." } } } - }, - "400": { - "description": "Returns an error indicating that the parent redemption ID is invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid Redemption Parent": { - "value": { - "code": 400, - "key": "invalid_redemption_parent", - "message": "Invalid redemption parent", - "details": "You can rollback only a redemption that does not have parent redemption.", - "request_id": "v-0b56a1cf1e4d69b375" + } + } + } + } + } + } + }, + "/client/v1/redemptions": { + "post": { + "operationId": "redeem-stacked-discounts-client-side", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Redeem Stackable Discounts (client-side)", + "description": "Use this method to redeem up to 5 redeemables in a single API request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.\n\n## How API returns calculated discounts and order amounts in the response\n\nIn the table below, you can see the logic the API follows to calculate discounts and amounts:\n\n| **Field** | **Calculation** | **Description** |\n|:---|:---|:---|\n| amount | N/A | This field shows the order amount before applying any discount |\n| total_amount | `total_amount` = `amount` - `total_discount_amount` | This field shows the order amount after applying all the discounts |\n| discount_amount | `discount_amount` = `previous_discount_amount` + `applied_discount_amount` | This field sums up all order-level discounts up to and including the specific discount being calculated for the stacked redemption. |\n| items_discount_amount | sum(items, i => i.discount_amount) | This field sums up all product-specific discounts |\n| total_discount_amount | `total_discount_amount` = `discount_amount` + `items_discount_amount` | This field sums up all order-level and all product-specific discounts |\n| applied_discount_amount | N/A | This field shows the order-level discount applied in a particular request |\n| items_applied_discount_amount | sum(items, i => i.applied_discount_amount) | This field sums up all product-specific discounts applied in a particular request |\n| total_applied_discount_amount | `total_applied_discount_amount` = `applied_discount_amount` + `items_applied_discount_amount` | This field sums up all order-level and all product-specific discounts applied in a particular request |\n\n\n> 📘 Rollbacks\n>\n> You can't roll back a child redemption. When you call rollback on a stacked redemption, all child redemptions will be rolled back. You need to refer to a parent redemption ID in your [rollback request](ref:rollback-stacked-redemptions).", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response\n\nResponses will vary depending on the strings passed in the `options.expand` string array.\n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redemption object.
                  - Metadata not included for each discount type. |\n| [\"order\", \"redemption\"] | - Returns redemption object `metadata`.
                  - Order data with calculated discounts are listed in each child redemption object. |\n| [\"redeemable\", \"redemption\"] | - Returns each discount type's `metadata` in each child redemption object.
                  - Returns redemption object `metadata`. |\n| [\"redemption\"] | - Returns redemption object `metadata`. |\n| [\"redeemable\", \"redemption\", \"category\"] | - Returns each discount type's `metadata` in each child redemption object
                  - Returns redemption object `metadata`.
                  - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_redemptions" + }, + "examples": { + "Example": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK", + "key": "session_key" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } }, - "Already rolled back": { - "value": { - "code": 400, - "key": "already_rolled_back", - "message": "Already rolled back", - "details": "Redemption has been already rolled back.", - "request_id": "v-0c67af9544c4e3388f", - "resource_id": "rrf_0c67af954e039be56b", - "resource_type": "redemption_rollback" + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } } + ], + "metadata": { + "key": "value" } } } } } } - }, - "/v1/loyalty-campaign-object": { - "get": { - "operationId": "loyalty-campaign-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Campaign Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Campaign Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - } - } - } + } + }, + "responses": { + "200": { + "description": "All promo codes and tiers provided in redeemables are redeemed during the request and returned in the API response. As a result, there are child `redemptions` related to redemptions of each redeemable and a `parent_redemption` that presents the final effect of redeeming all redeemables and stores the list of child redemptions. \n\n| Response Parameter | Description |\n|:---|:---|\n| redemptions
                  `array of objects` | This array lists all child redemptions that were executed during the request. Each child redemption returns a redemption object with detailed information on how each discount/code was applied to the order. You can see the effect of each consecutive redemption within the order object of each redemption, specifically the `total_discount_amount` parameter. This is why the sequence in which the discounts were provided in the request body matters. Each subsequent redemption object contains the order object which combines the effect of the previously applied discounts. |\n| parent_redemption
                  `object` | Represents the final effect of all child redemptions executed during the request. |\n| order
                  `object` | Represents order details after all discounts are applied. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_POST" } } } - }, - "/v1/loyalty-card-object": { - "get": { - "operationId": "loyalty-card-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Card Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Card Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } + } + } + }, + "/v1/validations": { + "post": { + "operationId": "validate-stacked-discounts", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Validate Stackable Discounts", + "description": "Verify redeemables provided in the request. This method is designed for server side integration which means that it is accessible only through private keys.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings.\n \n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_validations" + }, + "examples": { + "1 Redeemable": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" } - } - } - } - } - } - }, - "/v1/loyalty-tier-object": { - "get": { - "operationId": "loyalty-tier-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Loyalty Tier Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Loyalty Tier Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ], + "metadata": { + "key": "value" } } } - } - } - } - }, - "/v1/earning-object": { - "get": { - "operationId": "earning-rule-object", - "tags": [ - "LOYALTIES API" - ], - "summary": "Earning Rule Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Earning Rule Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" + }, + "5 Redeemables": { + "value": { + "customer": { + "source_id": "36_bob" + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "GNcuPKGe" + }, + { + "object": "voucher", + "id": "AnsvocvP", + "reward": { + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" + } + }, + { + "object": "voucher", + "id": "M3X8IwW8", + "gift": { + "credits": 100 + } + }, + { + "object": "promotion_tier", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W" + }, + { + "object": "promotion_tier", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" } + ], + "session": { + "type": "LOCK" + }, + "order": { + "items": [ + { + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1 + }, + { + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1 + } + ] } } } } } - }, - "/v1/loyalties": { - "get": { - "operationId": "list-loyalty-programs", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Campaigns", - "description": "Returns a list of your loyalty campaigns.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + } + }, + "responses": { + "200": { + "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
                  `boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
                  `array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
                  `object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_validations" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] + "examples": { + "False": { + "value": { + "valid": false, + "redeemables": [ + { + "status": "INAPPLICABLE", + "id": "eee33463", + "object": "voucher", + "result": { + "error": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id eee33463", + "request_id": "v-0c6c6e20dc42940f0b", + "resource_id": "eee33463", + "resource_type": "voucher" + } + } + }, + { + "status": "SKIPPED", + "id": "promo_Mwy9XpA0TLctSGriM5kum0qp", + "object": "promotion_tier", + "result": {} + } + ], + "tracking_id": "track_VAVW6qltuo1/z+G2GI2LPw==" + } }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with loyalty program objects. The loyalty campaigns are returned sorted by creation date, with the most recent campaigns appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_campaigns" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "campaigns", - "campaigns": [ + "True - 5 Redeemables": { + "value": { + "valid": true, + "redeemables": [ + { + "status": "APPLICABLE", + "id": "GNcuPKGe", + "object": "voucher", + "order": { + "amount": 2700, + "items_discount_amount": 1700, + "total_discount_amount": 1700, + "total_amount": 1000, + "items_applied_discount_amount": 1700, + "total_applied_discount_amount": 1700, + "items": [ { - "id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", - "name": "Loyalty Campaign 1", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########" - }, - "is_referral_code": false - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description.", - "vouchers_count": 6, - "active": true, - "metadata": { - "Season": "Fall" + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" }, - "created_at": "2022-11-21T13:57:03.712Z", - "updated_at": "2022-11-23T09:59:49.581Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b6152ce12414820dc", - "categories": [], - "object": "campaign" + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } }, { - "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "name": "Loyalty Campaign - Tiers", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LT1-", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2022-11-01T00:00:00.000Z" - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "start_date": "2022-11-01T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5, - 6 - ], - "vouchers_count": 3, - "active": true, - "metadata": {}, - "created_at": "2022-11-09T06:26:52.985Z", - "updated_at": "2022-11-10T08:54:46.136Z", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "category_id": "cat_0b8b5a427a0283c854", - "categories": [], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" - } - } - }, - "object": "campaign" + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ + { + "object": "products_collection", + "id": "pc_a11pr0dUc75", + "strict": false, + "effect": "APPLY_TO_EVERY" }, { - "id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW", - "name": "Loyalty Campaign Example", - "campaign_type": "LOYALTY_PROGRAM", - "type": "STATIC", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2021-12-15T00:00:00.000Z", - "expiration_date": "2021-12-31T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "start_date": "2021-12-15T00:00:00.000Z", - "expiration_date": "2021-12-31T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" + } + ], + "total": 3, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ITEMS", + "amount_off": 1000, + "is_dynamic": false + } + }, + "metadata": {}, + "categories": [] + }, + { + "status": "APPLICABLE", + "id": "AnsvocvP", + "object": "voucher", + "order": { + "amount": 2700, + "items_discount_amount": 1700, + "total_discount_amount": 1700, + "total_amount": 1000, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" }, - "validity_day_of_week": [ - 3, - 4, - 5, - 6 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": false, - "metadata": {}, - "created_at": "2021-12-15T08:02:52.298Z", - "updated_at": "2021-12-15T08:11:43.808Z", - "creation_status": "DRAFT", - "vouchers_generation_status": "DRAFT", - "protected": false, - "category_id": null, - "categories": [], - "object": "campaign" + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } } ], - "total": 3 - } - } - } - } - } - } - } - }, - "post": { - "operationId": "create-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Loyalty Campaign", - "description": "Creates a batch of [loyalty cards](ref:get-member) aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern. \n\n\n> 📘 Global uniqueness\n> All codes are unique across the whole project. Voucherify won't allow to generate the same codes in any of your campaigns.\n\n\n> 🚧 Asyncronous action!\n>\n> This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See `creation_status` field in the [loyalty campaign object](ref:get-loyalty-program) description.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the loyalty campaign details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_cards" - }, - "examples": { - "Example": { - "value": { - "name": "Loyalty Program 4", - "description": "This is a campaign description.", - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "start_date": "2016-10-26T00:00:00Z", - "expiration_date": "2024-10-26T00:00:00Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "activity_duration_after_publishing": "P24D", - "category_id": "cat_0b6152ce12414820dc", - "vouchers_count": 2, - "voucher": { - "type": "LOYALTY_CARD", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_QUARTER" - } - }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "pattern": "L-CARD-#######" + "points": 4 } }, - "metadata": { - "test": true - }, - "type": "STATIC", - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" - } + "metadata": {}, + "categories": [ + { + "id": "cat_0bb81a481615a37b5e", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-09-20T05:58:01.561Z", + "object": "category" } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a campaign object with its settings but without the loyalty card codes.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", - "name": "Loyalty Program 4", - "campaign_type": "LOYALTY_PROGRAM", - "type": "STATIC", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 3, - "rounding_type": "END_OF_QUARTER" + ] + }, + { + "status": "APPLICABLE", + "id": "M3X8IwW8", + "object": "voucher", + "order": { + "amount": 2700, + "discount_amount": 100, + "items_discount_amount": 1700, + "total_discount_amount": 1800, + "total_amount": 900, + "applied_discount_amount": 100, + "total_applied_discount_amount": 100, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 } }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "L-CARD-#######" - }, - "is_referral_code": false, - "start_date": "2016-10-26T00:00:00.000Z", - "expiration_date": "2024-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - } - }, - "auto_join": true, - "join_once": true, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description.", - "start_date": "2016-10-26T00:00:00.000Z", - "expiration_date": "2024-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P1D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "activity_duration_after_publishing": "P24D", - "vouchers_count": 0, - "active": true, - "metadata": { - "test": true - }, - "created_at": "2022-11-29T13:10:30.848Z", - "category": "New Customers", - "creation_status": "IN_PROGRESS", - "vouchers_generation_status": "IN_PROGRESS", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b6152ce12414820dc", - "categories": [ { - "id": "cat_0b6152ce12414820dc", - "name": "New Customers", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } } ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "result": { + "gift": { + "credits": 100 + } + }, + "metadata": {}, + "categories": [] + }, + { + "status": "APPLICABLE", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W", + "object": "promotion_tier", + "order": { + "amount": 2700, + "discount_amount": 460, + "items_discount_amount": 1700, + "total_discount_amount": 2160, + "total_amount": 540, + "applied_discount_amount": 360, + "total_applied_discount_amount": 360, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 } } - }, - "object": "campaign" - } - } - } - } - } - }, - "409": { - "description": "Returns an error if a loyalty campaign with the same name already exists.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": {} - }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated campaign exists with name Loyalty Program 2", - "request_id": "v-0c12951ec58e67577e", - "resource_id": "Loyalty Program 2", - "resource_type": "campaign" - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "get-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Loyalty Campaign", - "description": "Retrieve a specific loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a loyalty campaign object for a given loyalty campaign ID. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "name": "Loyalty Campaign - Tiers - 1", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 0 - }, - "redemption": { - "quantity": null - }, - "code_config": { - "length": 8, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "########", - "prefix": "LT1-", - "initial_count": 1 - }, - "is_referral_code": false, - "start_date": "2022-11-01T00:00:00.000Z" - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "start_date": "2022-11-01T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5, - 6 ], - "vouchers_count": 3, - "active": true, "metadata": {}, - "created_at": "2022-11-09T06:26:52.985Z", - "updated_at": "2022-11-10T08:54:46.136Z", - "category": "Eighth", - "creation_status": "DONE", - "vouchers_generation_status": "DONE", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b8b5a427a0283c854", - "categories": [ + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ { - "id": "cat_0b8b5a427a0283c854", - "name": "Eighth", - "hierarchy": 8, - "created_at": "2022-08-16T11:45:54.171Z", - "object": "category" + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" + }, + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" } ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P3M", - "rounding": { - "type": "MONTH", - "strategy": "END" - } + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [ + { + "object": "product", + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "strict": false, + "effect": "APPLY_TO_EVERY" } - }, - "object": "campaign" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the campaign does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - } - } - } - } - } - }, - "put": { - "operationId": "update-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Loyalty Campaign", - "description": "Updates a loyalty program. \n\nFields other than those specified in the allowed request body payload won't be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged. \n\nThis method will update the [loyalty cards](ref:get-member) which have not been published or redeemed yet.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the new values for the parameters that you would like to update for the given loyalty campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_loyalty_campaign" - }, - "examples": { - "Example": { - "value": { - "description": "This is a campaign description. Updated", - "auto_join": false, - "join_once": false, - "start_date": "2013-10-26T00:00:00Z", - "expiration_date": "2025-10-26T00:00:00Z", - "validity_timeframe": { - "duration": "PT2H", - "interval": "P2D" + ], + "total": 1, + "data_ref": "data", + "object": "list" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 - ], - "activity_duration_after_publishing": "P25D", - "category_id": "cat_0b6152ce12414820dd", - "loyalty_card": { - "points": 1, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 4, - "rounding_type": "END_OF_YEAR" + "result": { + "discount": { + "type": "PERCENT", + "effect": "APPLY_TO_ORDER", + "percent_off": 40, + "is_dynamic": false } }, - "metadata": { - "test": false - }, - "type": "AUTO_UPDATE", - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P4M", - "rounding": { - "type": "CUSTOM", - "unit": "MONTH", - "value": 1 - } - } - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the loyalty campaign object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" - }, - "examples": { - "Example": { - "value": { - "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", - "name": "Loyalty Program 4", - "campaign_type": "LOYALTY_PROGRAM", - "type": "AUTO_UPDATE", - "voucher": { - "type": "LOYALTY_CARD", - "loyalty_card": { - "points": 1, - "expiration_rules": { - "period_type": "MONTH", - "period_value": 4, - "rounding_type": "END_OF_YEAR" + "metadata": {} + }, + { + "status": "APPLICABLE", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf", + "object": "promotion_tier", + "order": { + "amount": 2700, + "discount_amount": 490, + "items_discount_amount": 1700, + "total_discount_amount": 2190, + "total_amount": 510, + "applied_discount_amount": 30, + "total_applied_discount_amount": 30, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 } }, - "redemption": { - "quantity": 2 - }, - "code_config": { - "length": 7, - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", - "pattern": "L-CARD-#######" + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "applicable_to": { + "data": [ + { + "object": "sku", + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "product_id": "prod_s3C0nDpr0DuC7", + "product_source_id": "test_prod_id_2", + "strict": true, + "effect": "APPLY_TO_EVERY" }, - "is_referral_code": false, - "start_date": "2013-10-26T00:00:00.000Z", - "expiration_date": "2025-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT2H" + { + "object": "product", + "id": "prod_0bc3bd8a4e072c5275", + "source_id": "prod_0bc3bd8a4e072c5275", + "strict": true, + "effect": "APPLY_TO_EVERY" } - }, - "auto_join": false, - "join_once": false, - "use_voucher_metadata_schema": true, - "description": "This is a campaign description. Updated", - "start_date": "2013-10-26T00:00:00.000Z", - "expiration_date": "2025-10-26T00:00:00.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT2H" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6 ], - "activity_duration_after_publishing": "P25D", - "vouchers_count": 2, - "active": true, - "metadata": { - "test": false - }, - "created_at": "2022-11-29T13:10:30.848Z", - "updated_at": "2022-11-29T14:08:30.655Z", - "category": "Lorem_Ipsum", - "creation_status": "MODIFYING", - "vouchers_generation_status": "MODIFYING", - "protected": false, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "category_id": "cat_0b6152ce12414820dd", - "categories": [ + "total": 2, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [ { - "id": "cat_0b6152ce12414820dd", - "name": "Lorem_Ipsum", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" + "object": "product", + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "strict": false, + "effect": "APPLY_TO_EVERY" } ], - "loyalty_tiers_expiration": { - "qualification_type": "BALANCE", - "start_date": { - "type": "IMMEDIATE" - }, - "expiration_date": { - "type": "CUSTOM", - "extend": "P4M", - "rounding": { - "type": "CUSTOM", - "strategy": "END", - "unit": "MONTH", - "value": 1 - } - } - }, - "object": "campaign" - } + "total": 1, + "data_ref": "data", + "object": "list" + }, + "result": { + "discount": { + "type": "AMOUNT", + "effect": "APPLY_TO_ORDER", + "amount_off": 30, + "is_dynamic": false + } + }, + "metadata": {} } + ], + "order": { + "amount": 2700, + "discount_amount": 490, + "items_discount_amount": 1700, + "total_discount_amount": 2190, + "total_amount": 510, + "applied_discount_amount": 490, + "items_applied_discount_amount": 1700, + "total_applied_discount_amount": 2190, + "items": [ + { + "object": "order_item", + "product_id": "prod_s3C0nDpr0DuC7", + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1, + "amount": 2000, + "discount_amount": 1000, + "applied_discount_amount": 1000, + "price": 2000, + "subtotal_amount": 1000, + "product": { + "id": "prod_s3C0nDpr0DuC7", + "source_id": "test_prod_id_2", + "name": "Watchflix" + }, + "sku": { + "id": "sku_0a3efc90375d1217e2", + "source_id": "test_standard_ultra_hd", + "sku": "Premium", + "price": 2000 + } + }, + { + "object": "order_item", + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1, + "amount": 700, + "discount_amount": 700, + "applied_discount_amount": 700, + "price": 700, + "subtotal_amount": 0, + "product": { + "id": "prod_0bc3bd8a4e072c5275", + "name": "Bouquet - Romantic Roses", + "price": 700 + } + } + ], + "metadata": {}, + "customer_id": null, + "referrer_id": null, + "object": "order" + }, + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "session": { + "key": "ssn_pkJfPcWAgp9WyHpA62Eky8X8SzxpKub2", + "type": "LOCK", + "ttl": 7, + "ttl_unit": "DAYS" } } } } } - }, - "delete": { - "operationId": "delete-loyalty-program", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Loyalty Campaign", - "description": "This method permanently deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards.", - "parameters": [ - { - "schema": { - "type": "boolean" + } + }, + "400": { + "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redeemables[1] should have required property 'id'", + "request_id": "v-0b4ff38ab8c8164573" + } }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with the same name." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "Duplicated Redeemables": { + "value": { + "code": 400, + "key": "duplicated_redeemables", + "message": "Duplicated redeemables detected", + "details": "Duplicated redeemables detected in one redemption", + "request_id": "v-0b4ffecfb408165300" + } + }, + "Invalid Redeemables": { + "value": { + "code": 400, + "key": "invalid_redeemables", + "message": "Invalid redeemables", + "details": "Promotion Stack cannot be use with other redeemables", + "request_id": "v-0b5007812f48165d6b" + } + } } - ], - "responses": { - "200": { - "description": "Returns the id of the scheduled asynchronous action, informing you that your request has been accepted and the loyalty campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + } + } + } + } + } + }, + "/client/v1/validations": { + "post": { + "operationId": "validate-stacked-discounts-client-side", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Validate Stackable Discounts (client-side)", + "description": "Verify redeemables provided in the request. This method is accessible through public keys which you can use in client side requests coming from mobile and web browser applications.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "## Expanded Response \n\nResponses will vary depending on the strings passed in the `options.expand` string array. You can customize the response by using one of the following combinations of strings. \n\n| **Expand Option** | **Response Body** |\n|:---|:---|\n| [\"order\"] | - Same response as fallback response (without an options object).
                  - Order data with calculated discounts are listed in each child redeemable object.
                  - Metadata _not_ included for each discount type. |\n| [\"redeemable\"] | Expands redeemable objects by including `metadata` for each discount type. |\n| [\"order\", \"redeemable\"] | - Order data with calculated discounts are listed in each child redeemable object.
                  - Includes `metadata` for each discount type. |\n| [\"category\"] | - Returns an expanded `categories` object, showing details about the category. |", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_req_validations" + }, + "examples": { + "1 Redeemable": { + "value": { + "customer": { + "source_id": "sample_customer", + "metadata": { + "key": "value" + } + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "voucher-code" + } + ], + "session": { + "type": "LOCK" + }, + "order": { + "amount": 55000, + "status": "PAID", + "items": [ + { + "quantity": 2, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + }, + { + "quantity": 1, + "price": 15000, + "source_id": "sample product2", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } } } + ], + "metadata": { + "key": "value" } } } }, - "404": { - "description": "Returns an error indicating that the loyalty campaign with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer Loyalty Perks", - "request_id": "v-0ae2b0092f50c130c7", - "resource_id": "Summer Loyalty Perks", - "resource_type": "campaign" - } + "5 Redeemables": { + "value": { + "customer": { + "source_id": "36_bob" + }, + "options": { + "expand": [ + "order", + "redeemable", + "category" + ] + }, + "redeemables": [ + { + "object": "voucher", + "id": "GNcuPKGe" + }, + { + "object": "voucher", + "id": "AnsvocvP", + "reward": { + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4" + } + }, + { + "object": "voucher", + "id": "M3X8IwW8", + "gift": { + "credits": 100 } + }, + { + "object": "promotion_tier", + "id": "promo_DE1N30D731Tg2F6NoMwNas2W" + }, + { + "object": "promotion_tier", + "id": "promo_NDHgTg4VnOLYNjk9r7WOmQxf" } + ], + "session": { + "type": "LOCK" + }, + "order": { + "items": [ + { + "sku_id": "sku_0a3efc90375d1217e2", + "quantity": 1 + }, + { + "product_id": "prod_0bc3bd8a4e072c5275", + "quantity": 1 + } + ] } } } } } - }, - "/v1/loyalties/{campaignId}/members": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "All codes and tiers provided in redeemables are validated during the request and the result of their validation is returned in the API response. \n\n| **Response** | **Description** |\n|:---|:---|\n| valid
                  `boolean` | If **all** redeemables can be applied in the given context, the API returns `true`. Otherwise, if at least one redeemable can't be applied, the API returns `false`. |\n| redeemables
                  `array of objects` | The `redeemables` array lists the validation results of each redeemable. If a redeemable can be applied, the API returns `\"status\": \"APPLICABLE\"` |\n| order
                  `object` | The `order` object presents details of the order provided in the request after all discounts are applied. |\n", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID of the loyalty program." + "$ref": "#/components/schemas/19_res_validations" + } } - ], - "get": { - "operationId": "list-members", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Members", - "description": "Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/created_at" - }, - { - "$ref": "#/components/parameters/updated_at" + } + }, + "400": { + "description": "Returns an error if the payload is missing an `\"object\"` or `\"id\"` property in the redeemables array, if you add more than one promotion stack or attempt to join stacks with vouchers/promotion tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .redeemables[1] should have required property 'id'", + "request_id": "v-0b4ff38ab8c8164573" + } + }, + "Duplicated Redeemables": { + "value": { + "code": 400, + "key": "duplicated_redeemables", + "message": "Duplicated redeemables detected", + "details": "Duplicated redeemables detected in one redemption", + "request_id": "v-0b4ffecfb408165300" + } }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + "Invalid Redeemables": { + "value": { + "code": 400, + "key": "invalid_redeemables", + "message": "Invalid redeemables", + "details": "Promotion Stack cannot be use with other redeemables", + "request_id": "v-0b5007812f48165d6b" + } + } } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/redemptions/{parentRedemptionId}/rollbacks": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "parentRedemptionId", + "in": "path", + "required": true, + "description": "Unique identifier of a parent redemption, e.g. `r_JQfm73zWSJFQxs3bGxweYjgm`." + } + ], + "post": { + "operationId": "rollback-stacked-redemptions", + "tags": [ + "STACKABLE DISCOUNTS API" + ], + "summary": "Rollback Stackable Redemptions", + "description": "Rollback a stackable redemption. When you rollback a stacked redemption, all child redemptions will be rolled back. Provide the parent redemption ID as the path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an array with the individual redemption rollback results along with the parent rollback result and related order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/19_res_redemptions_parentRedemptionId_rollbacks" } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty cards within a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_members" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "vouchers", - "vouchers": [ - { - "id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655", - "code": "0PmQ7JQI", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 0, - "balance": 0 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA%2Fs6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa%2FYCnKkm63TRuX6OgGJoEggbKMg%2BwLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z%2Bz3B1jkALIbjtw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BhrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP%2BBfBtF%2BpyyQpxCeqbQuB%2FOuSnP%2Fnzec6n0n%2FgTb9%2BXcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-04-15T05:48:45.509Z", - "updated_at": "2022-07-01T00:01:57.860Z", - "holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10" - }, - "object": "voucher" - }, - { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" - } - ], - "total": 2 - } - } - } + } + } + }, + "400": { + "description": "Returns an error indicating that the parent redemption ID is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Redemption Parent": { + "value": { + "code": 400, + "key": "invalid_redemption_parent", + "message": "Invalid redemption parent", + "details": "You can rollback only a redemption that does not have parent redemption.", + "request_id": "v-0b56a1cf1e4d69b375" + } + }, + "Already rolled back": { + "value": { + "code": 400, + "key": "already_rolled_back", + "message": "Already rolled back", + "details": "Redemption has been already rolled back.", + "request_id": "v-0c67af9544c4e3388f", + "resource_id": "rrf_0c67af954e039be56b", + "resource_type": "redemption_rollback" } } } } - }, - "post": { - "operationId": "add-member", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add Member", - "description": "This method assigns a loyalty card to a customer. It selects a [loyalty card](ref:get-voucher) suitable for publication, adds a publish entry, and returns the published voucher. \n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/loyalty-campaign-object": { + "get": { + "operationId": "loyalty-campaign-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Campaign Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Campaign Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" } - ], - "requestBody": { - "description": "Provide details to whom the loyalty card should be assigned. \n\nYou can choose to either specify the exact loyalty card code that you want to publish from existin (non-assigned) codes, or choose not to specify a voucher code. If you choose not to specify a code in the request paylaod, then the system will choose the next available voucher code available to be assigned to a customer. \n\nYou can also include metadata in the request payload. This metadata will be assigned to the publication object, but will not be returned in the response to this endpoint. To see of publications (assignments of particular codes to customers) and publication metadata, use the [List Publications](ref:list-publications) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_member" - }, - "examples": { - "Using source ID": { - "value": { - "customer": "source_customer_1", - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" - } - }, - "Using unique Voucherify assigned ID": { - "value": { - "customer": "cust_8KQmHxAERpgebYcFhSpZRr37", - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" - } - }, - "Using source ID in object": { - "value": { - "customer": { - "source_id": "source_customer_1" - }, - "metadata": { - "year": 2022 - }, - "channel": "postman", - "voucher": "KpzbHUY5" - } - }, - "Using unique Voucherify assigned ID in object": { - "value": { - "customer": { - "id": "cust_8KQmHxAERpgebYcFhSpZRr37" + } + } + } + } + } + }, + "/v1/loyalty-card-object": { + "get": { + "operationId": "loyalty-card-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Card Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Card Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + } + } + } + } + } + } + }, + "/v1/loyalty-tier-object": { + "get": { + "operationId": "loyalty-tier-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Loyalty Tier Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Loyalty Tier Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_tier_object" + } + } + } + } + } + } + }, + "/v1/earning-object": { + "get": { + "operationId": "earning-rule-object", + "tags": [ + "LOYALTIES API" + ], + "summary": "Earning Rule Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Earning Rule Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } + } + } + } + } + } + }, + "/v1/loyalties": { + "get": { + "operationId": "list-loyalty-programs", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Campaigns", + "description": "Returns a list of your loyalty campaigns.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with loyalty program objects. The loyalty campaigns are returned sorted by creation date, with the most recent campaigns appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_loyalty_campaigns" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "campaigns", + "campaigns": [ + { + "id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", + "name": "Loyalty Campaign 1", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########" + }, + "is_referral_code": false }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description.", + "vouchers_count": 6, + "active": true, "metadata": { - "year": 2022 + "Season": "Fall" }, - "channel": "postman", - "voucher": "KpzbHUY5" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the voucher object that was published to the customer provided in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0TxKw1bm0oZuS5lwA8526vze1OBMV1OH", - "code": "KpzbHUY5", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", - "category": "New Customers", - "category_id": "cat_0b6152ce12414820dc", - "categories": [ - { - "id": "cat_0b6152ce12414820dc", - "name": "New Customers", - "hierarchy": 0, - "created_at": "2022-07-14T20:17:07.657Z", - "object": "category" - } - ], + "created_at": "2022-11-21T13:57:03.712Z", + "updated_at": "2022-11-23T09:59:49.581Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b6152ce12414820dc", + "categories": [], + "object": "campaign" + }, + { + "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "name": "Loyalty Campaign - Tiers", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { "type": "LOYALTY_CARD", - "discount": null, - "gift": null, "loyalty_card": { - "points": 0, - "balance": 0 + "points": 0 }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": { - "Season": "Fall" + "redemption": { + "quantity": null }, - "assets": { - "qr": { - "id": "U2FsdGVkX1+hdZfzUaz448vIsyf7WpvXiDyqFbyw0+P5wMu12w3B5DyYwA7LCSK+Nr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk+ecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BhdZfzUaz448vIsyf7WpvXiDyqFbyw0%2BP5wMu12w3B5DyYwA7LCSK%2BNr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk%2BecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX19VRXApVvZ9/ArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw+YeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19VRXApVvZ9%2FArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw%2BYeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg%3D%3D" - } + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LT1-", + "initial_count": 1 }, "is_referral_code": false, - "created_at": "2022-11-21T15:48:57.860Z", - "updated_at": "2022-11-21T15:49:36.671Z", - "holder_id": "cust_8KQmHxAERpgebYcFhSpZRr37", + "start_date": "2022-11-01T00:00:00.000Z" + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "start_date": "2022-11-01T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "vouchers_count": 3, + "active": true, + "metadata": {}, + "created_at": "2022-11-09T06:26:52.985Z", + "updated_at": "2022-11-10T08:54:46.136Z", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "category_id": "cat_0b8b5a427a0283c854", + "categories": [], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + }, + "object": "campaign" + }, + { + "id": "camp_NwO6D0Z0mpZ1CDc380DnPgrW", + "name": "Loyalty Campaign Example", + "campaign_type": "LOYALTY_PROGRAM", + "type": "STATIC", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, - "object": "list", - "url": "/v1/vouchers/KpzbHUY5/redemptions?page=1&limit=10" + "quantity": null }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/KpzbHUY5/publications?page=1&limit=10" + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "initial_count": 1 }, - "object": "voucher" - } - } - } - } - } - }, - "400": { - "description": "Returns an error.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "No Voucher Suitable for Publication": { - "value": { - "code": 400, - "key": "no_voucher_suitable_for_publication", - "message": "Couldn't find any voucher suitable for publication", - "details": "Couldn't create new vouchers for publication", - "request_id": "v-0c086598620e6704dd" - } - }, - "Voucher already published": { - "value": { - "code": 400, - "key": "voucher_already_published", - "message": "Voucher already published", - "details": "Voucher 'v_ZFjKHQD0d56eMkWkrotJaVbiMuXClRuM' has already been published", - "request_id": "v-0c086aaa7dc24ccfe0" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the voucher code that was specified in the request payload is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id Loyalty_Card", - "request_id": "v-0c086a26de424ccf2f", - "resource_id": "Loyalty_Card", - "resource_type": "voucher" - } + "is_referral_code": false, + "start_date": "2021-12-15T00:00:00.000Z", + "expiration_date": "2021-12-31T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "start_date": "2021-12-15T00:00:00.000Z", + "expiration_date": "2021-12-31T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": false, + "metadata": {}, + "created_at": "2021-12-15T08:02:52.298Z", + "updated_at": "2021-12-15T08:11:43.808Z", + "creation_status": "DRAFT", + "vouchers_generation_status": "DRAFT", + "protected": false, + "category_id": null, + "categories": [], + "object": "campaign" } - } + ], + "total": 3 } } } } } - }, - "/v1/loyalties/{campaignId}/members/{memberId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." + } + } + }, + "post": { + "operationId": "create-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Loyalty Campaign", + "description": "Creates a batch of [loyalty cards](ref:get-member) aggregated in a single loyalty campaign. It also allows you to define a custom codes pattern. \n\n\n> 📘 Global uniqueness\n> All codes are unique across the whole project. Voucherify won't allow to generate the same codes in any of your campaigns.\n\n\n> 🚧 Asyncronous action!\n>\n> This is an asynchronous action, you can't read or modify a newly created campaign until the code generation is completed. See `creation_status` field in the [loyalty campaign object](ref:get-loyalty-program) description.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the loyalty campaign details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_cards" }, - { - "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique code that identifies the loyalty card." - } - ], - "get": { - "operationId": "get-member-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member", - "description": "Retrieves the loyalty card with the given member ID (i.e. voucher code).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns loyalty card details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Program", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" - } + "examples": { + "Example": { + "value": { + "name": "Loyalty Program 4", + "description": "This is a campaign description.", + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "start_date": "2016-10-26T00:00:00Z", + "expiration_date": "2024-10-26T00:00:00Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "activity_duration_after_publishing": "P24D", + "category_id": "cat_0b6152ce12414820dc", + "vouchers_count": 2, + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_QUARTER" + } + }, + "redemption": { + "quantity": 2 + }, + "code_config": { + "pattern": "L-CARD-#######" + } + }, + "metadata": { + "test": true + }, + "type": "STATIC", + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" } } } @@ -67470,1389 +66536,1294 @@ } } } - }, - "/v1/loyalties/members/{memberId}": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns a campaign object with its settings but without the loyalty card codes.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card code assigned to a particular customer." - } - ], - "get": { - "operationId": "get-member", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member", - "description": "Retrieve loyalty card with the given member ID (i.e. voucher code). \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-1). The URL was re-designed to allow you to retrieve loyalty card details without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns loyalty card details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Loyalty Card": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Loyalty Program", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13435, - "balance": 13135, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 12 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-21T13:49:54.949Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", + "name": "Loyalty Program 4", + "campaign_type": "LOYALTY_PROGRAM", + "type": "STATIC", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 3, + "rounding_type": "END_OF_QUARTER" + } + }, + "redemption": { + "quantity": 2 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "L-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2016-10-26T00:00:00.000Z", + "expiration_date": "2024-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + } + }, + "auto_join": true, + "join_once": true, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description.", + "start_date": "2016-10-26T00:00:00.000Z", + "expiration_date": "2024-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P1D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "activity_duration_after_publishing": "P24D", + "vouchers_count": 0, + "active": true, + "metadata": { + "test": true + }, + "created_at": "2022-11-29T13:10:30.848Z", + "category": "New Customers", + "creation_status": "IN_PROGRESS", + "vouchers_generation_status": "IN_PROGRESS", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b6152ce12414820dc", + "categories": [ + { + "id": "cat_0b6152ce12414820dc", + "name": "New Customers", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" } } - } + }, + "object": "campaign" } } } } } }, - "/v1/loyalties/{campaignId}/members/{memberId}/activities": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { + "409": { + "description": "Returns an error if a loyalty campaign with the same name already exists.", + "content": { + "application/json": { "schema": { - "type": "string" + "type": "object", + "properties": {} }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "get": { - "operationId": "get-member-activities-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member Activities", - "description": "Retrieves the list of activities for the given member ID related to voucher and customer who is a holder of the voucher.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of event objects related to the loyalty card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_member_activities" - } + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated campaign exists with name Loyalty Program 2", + "request_id": "v-0c12951ec58e67577e", + "resource_id": "Loyalty Program 2", + "resource_type": "campaign" } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" }, - "/v1/loyalties/members/{memberId}/activities": { - "parameters": [ - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "get-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Loyalty Campaign", + "description": "Retrieve a specific loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a loyalty campaign object for a given loyalty campaign ID. ", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "get": { - "operationId": "get-member-activities", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Member Activities", - "description": "Retrieves a list of activities for the given loyalty card related to the loyalty and customer who is the holder of the loyalty card.\n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-activities-1). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of event objects related to the loyalty card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_member_activities" - } + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "name": "Loyalty Campaign - Tiers - 1", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 0 + }, + "redemption": { + "quantity": null + }, + "code_config": { + "length": 8, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "########", + "prefix": "LT1-", + "initial_count": 1 + }, + "is_referral_code": false, + "start_date": "2022-11-01T00:00:00.000Z" + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "start_date": "2022-11-01T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5, + 6 + ], + "vouchers_count": 3, + "active": true, + "metadata": {}, + "created_at": "2022-11-09T06:26:52.985Z", + "updated_at": "2022-11-10T08:54:46.136Z", + "category": "Eighth", + "creation_status": "DONE", + "vouchers_generation_status": "DONE", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b8b5a427a0283c854", + "categories": [ + { + "id": "cat_0b8b5a427a0283c854", + "name": "Eighth", + "hierarchy": 8, + "created_at": "2022-08-16T11:45:54.171Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P3M", + "rounding": { + "type": "MONTH", + "strategy": "END" + } + } + }, + "object": "campaign" } } } } } }, - "/v1/loyalties/{campaignId}/members/{memberId}/balance": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { + "404": { + "description": "Returns an error if the campaign does not exist or has been deleted.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "post": { - "operationId": "add-remove-loyalty-card-balance-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add or Remove Loyalty Card Balance", - "description": "This method adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "$ref": "#/components/schemas/e_404_not_found" } - ], - "requestBody": { - "description": "Specify the point adjustment along with the expiration mechanism.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + } + } + } + } + }, + "put": { + "operationId": "update-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Update Loyalty Campaign", + "description": "Updates a loyalty program. \n\nFields other than those specified in the allowed request body payload won't be modified (even if provided they are silently skipped). Any parameters not provided will be left unchanged. \n\nThis method will update the [loyalty cards](ref:get-member) which have not been published or redeemed yet.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the new values for the parameters that you would like to update for the given loyalty campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_loyalty_campaign" + }, + "examples": { + "Example": { + "value": { + "description": "This is a campaign description. Updated", + "auto_join": false, + "join_once": false, + "start_date": "2013-10-26T00:00:00Z", + "expiration_date": "2025-10-26T00:00:00Z", + "validity_timeframe": { + "duration": "PT2H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P25D", + "category_id": "cat_0b6152ce12414820dd", + "loyalty_card": { + "points": 1, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 4, + "rounding_type": "END_OF_YEAR" + } }, - "examples": { - "Add points": { - "value": { - "points": 100, - "expiration_type": "CUSTOM_DATE", - "expiration_date": "2023-05-30" - } + "metadata": { + "test": false + }, + "type": "AUTO_UPDATE", + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" }, - "Deduct points": { - "value": { - "points": -100 + "expiration_date": { + "type": "CUSTOM", + "extend": "P4M", + "rounding": { + "type": "CUSTOM", + "unit": "MONTH", + "value": 1 } } } } } - }, - "responses": { - "200": { - "description": "Returns a balance object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "examples": { - "Add balance": { - "value": { - "points": -100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the loyalty campaign object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_campaign_object" + }, + "examples": { + "Example": { + "value": { + "id": "camp_wGlqXtnHddb39DvHuuhvvbxi", + "name": "Loyalty Program 4", + "campaign_type": "LOYALTY_PROGRAM", + "type": "AUTO_UPDATE", + "voucher": { + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 1, + "expiration_rules": { + "period_type": "MONTH", + "period_value": 4, + "rounding_type": "END_OF_YEAR" } }, - "Deduct balance": { - "value": { - "points": -100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" - } + "redemption": { + "quantity": 2 + }, + "code_config": { + "length": 7, + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", + "pattern": "L-CARD-#######" + }, + "is_referral_code": false, + "start_date": "2013-10-26T00:00:00.000Z", + "expiration_date": "2025-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT2H" + } + }, + "auto_join": false, + "join_once": false, + "use_voucher_metadata_schema": true, + "description": "This is a campaign description. Updated", + "start_date": "2013-10-26T00:00:00.000Z", + "expiration_date": "2025-10-26T00:00:00.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT2H" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6 + ], + "activity_duration_after_publishing": "P25D", + "vouchers_count": 2, + "active": true, + "metadata": { + "test": false + }, + "created_at": "2022-11-29T13:10:30.848Z", + "updated_at": "2022-11-29T14:08:30.655Z", + "category": "Lorem_Ipsum", + "creation_status": "MODIFYING", + "vouchers_generation_status": "MODIFYING", + "protected": false, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "category_id": "cat_0b6152ce12414820dd", + "categories": [ + { + "id": "cat_0b6152ce12414820dd", + "name": "Lorem_Ipsum", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" + } + ], + "loyalty_tiers_expiration": { + "qualification_type": "BALANCE", + "start_date": { + "type": "IMMEDIATE" + }, + "expiration_date": { + "type": "CUSTOM", + "extend": "P4M", + "rounding": { + "type": "CUSTOM", + "strategy": "END", + "unit": "MONTH", + "value": 1 } } - } + }, + "object": "campaign" } } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-loyalty-program", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Loyalty Campaign", + "description": "This method permanently deletes a loyalty campaign and all related loyalty cards. This action cannot be undone. Also, it immediately removes any redemptions on loyalty cards.", + "parameters": [ + { + "schema": { + "type": "boolean" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the campaign and related vouchers will be removed permanently. Going forward, the user will be able to create the next campaign with the same name." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the id of the scheduled asynchronous action, informing you that your request has been accepted and the loyalty campaign will be deleted from the repository asynchronously. To check the deletion status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "400": { - "description": "Returns an error if the expiration date was defined incorrectly in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid expiration date": { - "value": { - "code": 400, - "key": "invalid_expiration_date", - "message": "Invalid Expiration Date", - "details": "Expiration date cannot be set in the past", - "request_id": "v-0c118b1611424ca899" - } - } - } + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/loyalties/members/{memberId}/balance": { - "parameters": [ - { + "404": { + "description": "Returns an error indicating that the loyalty campaign with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "post": { - "operationId": "add-remove-loyalty-card-balance", - "tags": [ - "LOYALTIES API" - ], - "summary": "Add or Remove Loyalty Card Balance", - "description": "This method gives adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:add-remove-loyalty-card-balance-1). The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the point adjustment along with the expiration mechanism.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" - }, - "examples": { - "Subtract points": { - "value": { - "points": -100 - } - }, - "Add Points": { - "value": { - "points": 100, - "expiration_type": "CUSTOM_DATE", - "expiration_date": "2023-05-30" - } - } + "examples": { + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer Loyalty Perks", + "request_id": "v-0ae2b0092f50c130c7", + "resource_id": "Summer Loyalty Perks", + "resource_type": "campaign" } } } - }, - "responses": { - "200": { - "description": "Returns a balance object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "examples": { - "Subtract Points": { - "value": { - "points": 100, - "total": 13436, - "balance": 13136, - "type": "loyalty_card", - "object": "balance", - "related_object": { - "type": "voucher", - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID of the loyalty program." + } + ], + "get": { + "operationId": "list-members", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Members", + "description": "Returns a list of your loyalty cards. The loyalty cards are sorted by creation date, with the most recent loyalty cards appearing first.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/created_at" + }, + { + "$ref": "#/components/parameters/updated_at" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty cards within a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_members" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "vouchers", + "vouchers": [ + { + "id": "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655", + "code": "0PmQ7JQI", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA/s6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa/YCnKkm63TRuX6OgGJoEggbKMg+wLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z+z3B1jkALIbjtw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19RtPewWeUYb2hiCR6xEhVE3SLdMfCXj3BA%2Fs6uqSwFl2oAKAt9K5dolsdcZcj5Jgaa%2FYCnKkm63TRuX6OgGJoEggbKMg%2BwLfCMwBSi4J2v8KXuyqM25wP4r9WAL58Z%2Bz3B1jkALIbjtw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+hrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP+BfBtF+pyyQpxCeqbQuB/OuSnP/nzec6n0n/gTb9+XcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BhrRfaPMHRRX5aGVz2RpurRBjC2brcHcptPs4Od93qZM51vUXZe4DDzfRbnVrP%2BBfBtF%2BpyyQpxCeqbQuB%2FOuSnP%2Fnzec6n0n%2FgTb9%2BXcIYLvvxcbnDbYoVdRFQEbcCxKKo4QzDlqIjQ%3D%3D" } - } - } - } - } - } - }, - "400": { - "description": "Returns an error if the expiration date was specified incorrectly in the request payload.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .expiration_date cannot be recognized as a ISO-8601 compliant date", - "request_id": "v-0c118c6f7c0e6751ab" - } + }, + "is_referral_code": false, + "created_at": "2022-04-15T05:48:45.509Z", + "updated_at": "2022-07-01T00:01:57.860Z", + "holder_id": "cust_nk0N1uNQ1YnupAoJGOgvsODC", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/0PmQ7JQI/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/0PmQ7JQI/publications?page=1&limit=10" + }, + "object": "voucher" + }, + { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } - } + ], + "total": 2 } } } } } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/transfers": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination)." + } + } + }, + "post": { + "operationId": "add-member", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add Member", + "description": "This method assigns a loyalty card to a customer. It selects a [loyalty card](ref:get-voucher) suitable for publication, adds a publish entry, and returns the published voucher. \n\nA voucher is suitable for publication when it's active and hasn't been published yet. \n\n\n> 📘 Auto-update campaign\n>\n> In case you want to ensure the number of publishable codes increases automatically with the number of customers, you should use **auto-update** campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide details to whom the loyalty card should be assigned. \n\nYou can choose to either specify the exact loyalty card code that you want to publish from existin (non-assigned) codes, or choose not to specify a voucher code. If you choose not to specify a code in the request paylaod, then the system will choose the next available voucher code available to be assigned to a customer. \n\nYou can also include metadata in the request payload. This metadata will be assigned to the publication object, but will not be returned in the response to this endpoint. To see of publications (assignments of particular codes to customers) and publication metadata, use the [List Publications](ref:list-publications) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_member" }, - { - "schema": { - "type": "string" + "examples": { + "Using source ID": { + "value": { + "customer": "source_customer_1", + "metadata": { + "year": 2022 + }, + "channel": "postman", + "voucher": "KpzbHUY5" + } }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination)." - } - ], - "post": { - "operationId": "transfer-points", - "tags": [ - "LOYALTIES API" - ], - "summary": "Transfer Loyalty Points", - "description": "Transfer points between different loyalty cards. You need to provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters in the URL. In the request body, you provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_transfer_loyalty_points" + "Using unique Voucherify assigned ID": { + "value": { + "customer": "cust_8KQmHxAERpgebYcFhSpZRr37", + "metadata": { + "year": 2022 }, - "examples": { - "Example": { - "value": [ - { - "code": "0PmQ7JQI", - "points": 1 - }, - { - "code": "kCeufB8i", - "points": 1 - } - ] - } - } + "channel": "postman", + "voucher": "KpzbHUY5" + } + }, + "Using source ID in object": { + "value": { + "customer": { + "source_id": "source_customer_1" + }, + "metadata": { + "year": 2022 + }, + "channel": "postman", + "voucher": "KpzbHUY5" + } + }, + "Using unique Voucherify assigned ID in object": { + "value": { + "customer": { + "id": "cust_8KQmHxAERpgebYcFhSpZRr37" + }, + "metadata": { + "year": 2022 + }, + "channel": "postman", + "voucher": "KpzbHUY5" } } - }, - "responses": { - "200": { - "description": "Returns a loyalty card object for the loaded loyalty card, ie. the one that that points were transferred to from the other cards(s).", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" - }, - "examples": { - "Example": { - "value": { - "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "code": "MmFAzfDe", - "campaign": "Proportional Earning Rules", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "category": null, - "category_id": "cat_0b6152ce12414820de", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 13441, - "balance": 13141, - "next_expiration_date": "2022-11-30", - "next_expiration_points": 0 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-02-18T14:03:59.954Z", - "updated_at": "2022-11-28T17:58:25.607Z", - "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 300, - "object": "list", - "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" - }, - "object": "voucher" - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the voucher object that was published to the customer provided in the request payload.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0TxKw1bm0oZuS5lwA8526vze1OBMV1OH", + "code": "KpzbHUY5", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_eTIsUtuzkRXQT6rsUQqrS5Gw", + "category": "New Customers", + "category_id": "cat_0b6152ce12414820dc", + "categories": [ + { + "id": "cat_0b6152ce12414820dc", + "name": "New Customers", + "hierarchy": 0, + "created_at": "2022-07-14T20:17:07.657Z", + "object": "category" } - } + ], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 0, + "balance": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": { + "Season": "Fall" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+hdZfzUaz448vIsyf7WpvXiDyqFbyw0+P5wMu12w3B5DyYwA7LCSK+Nr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk+ecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BhdZfzUaz448vIsyf7WpvXiDyqFbyw0%2BP5wMu12w3B5DyYwA7LCSK%2BNr7TA7PKGuHOTGxfBieqrhvJo81HiaIJimDOhk%2BecEOisMRmHf6XsNckVlyBHmkpBiXWNm8UDwZnXOAG75Usdw%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX19VRXApVvZ9/ArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw+YeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19VRXApVvZ9%2FArwBd0wNg7s2KZBXrFvPXZdDQyzGj0HbbEIx5TAoXNR9zaE5kzIj9BElzgK82aOMMVnc1sqvr93xw%2BYeYMnqGqHRZfM78pYC8560Zc3U6IELtxzaJJ0x2uDUe6Dc9XYeg%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-21T15:48:57.860Z", + "updated_at": "2022-11-21T15:49:36.671Z", + "holder_id": "cust_8KQmHxAERpgebYcFhSpZRr37", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "redeemed_points": 0, + "object": "list", + "url": "/v1/vouchers/KpzbHUY5/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/KpzbHUY5/publications?page=1&limit=10" + }, + "object": "voucher" } } } } } }, - "/v1/loyalties/{campaignId}/members/{memberId}/transactions": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return." - }, - { + "400": { + "description": "Returns an error.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." + "examples": { + "No Voucher Suitable for Publication": { + "value": { + "code": 400, + "key": "no_voucher_suitable_for_publication", + "message": "Couldn't find any voucher suitable for publication", + "details": "Couldn't create new vouchers for publication", + "request_id": "v-0c086598620e6704dd" + } + }, + "Voucher already published": { + "value": { + "code": 400, + "key": "voucher_already_published", + "message": "Voucher already published", + "details": "Voucher 'v_ZFjKHQD0d56eMkWkrotJaVbiMuXClRuM' has already been published", + "request_id": "v-0c086aaa7dc24ccfe0" + } + } + } } - ], - "get": { - "operationId": "list-loyalty-card-transactions-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Card Transactions", - "description": "Retrieve transaction data related to point movements for a specific loyalty card.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" + } + }, + "404": { + "description": "Returns an error if the voucher code that was specified in the request payload is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id Loyalty_Card", + "request_id": "v-0c086a26de424ccf2f", + "resource_id": "Loyalty_Card", + "resource_type": "voucher" + } + } } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty card transaction objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dd3c2e392f78613", - "source_id": "20230317_transfer_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": "Transferring points to card", - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1396, - "object": "balance", - "points": -1, - "balance": 1396, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1102, - "balance": 1102, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 102 - }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9dd3c2e392f78614", - "created_at": "2023-03-17T16:20:33.807Z" - }, - { - "id": "vtx_0c9dd2527696ba081b", - "source_id": "20230317_add_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Adding points to card", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1397, - "object": "balance", - "points": 100, - "balance": 1397, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:14:16.524Z" - }, - { - "id": "vtx_0c9dd1ce1d403f4204", - "source_id": "20230317_subtract_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Subtracting points from card", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1297, - "object": "balance", - "points": -1, - "balance": 1297, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:12:00.981Z" - }, - { - "id": "vtx_0c9c21df658d03ce3f", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "Automation", - "reason": null, - "type": "POINTS_ACCRUAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1298, - "object": "balance", - "points": 200, - "balance": 1298, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_QZEKPzYATFjGoos4DonMg0fd", - "source_id": "s" - }, - "event": { - "id": "evcus_0c9c21def34e3c05bf", - "type": "customer.order.paid" - }, - "earning_rule": { - "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", - "source": { - "banner": "Order paid" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-16T08:44:52.333Z" - }, - { - "id": "vtx_0c9b09673f8a862a51", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REFUND", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 1000, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null - }, - "redemption": { - "id": "r_0c9b08fe4b80897849" - }, - "rollback": { - "id": "rr_0c9b0967244a862a33" - }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:19:29.149Z" - }, - { - "id": "vtx_0c9b08fe530089785c", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REDEMPTION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": -1000, - "balance": 98, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null - }, - "redemption": { - "id": "r_0c9b08fe4b80897849" - }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:17:41.708Z" - }, - { - "id": "vtx_0c9b074afed3b30e4b", - "source_id": "20230309_add_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer purchased points at kiosk.", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 100, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:10:15.917Z" - }, - { - "id": "vtx_0c9b073072408969d1", - "source_id": "20230309_subtract_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer used points to obtain tickets.", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 998, - "object": "balance", - "points": -1, - "balance": 998, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:09:48.735Z" - }, - { - "id": "vtx_0c9afe802593b34b80", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": null, - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 999, - "object": "balance", - "points": -1, - "balance": 999, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1001, - "balance": 1001, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 1 - }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9afe802593b34b81", - "created_at": "2023-03-15T11:31:51.062Z" - } - ], - "has_more": false - } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique code that identifies the loyalty card." + } + ], + "get": { + "operationId": "get-member-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member", + "description": "Retrieves the loyalty card with the given member ID (i.e. voucher code).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns loyalty card details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Program", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } } } } } + } + } + } + }, + "/v1/loyalties/members/{memberId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" }, - "/v1/loyalties/members/{memberId}/transactions": { - "parameters": [ - { + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card code assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member", + "description": "Retrieve loyalty card with the given member ID (i.e. voucher code). \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-1). The URL was re-designed to allow you to retrieve loyalty card details without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns loyalty card details.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." - } - ], - "get": { - "operationId": "list-loyalty-card-transactions", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Card Transactions", - "description": "Retrieve transaction data related to point movements for a specific loyalty card.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty card transaction objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "vtx_0c9dd3c2e392f78613", - "source_id": "20230317_transfer_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": "Transferring points to card", - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1396, - "object": "balance", - "points": -1, - "balance": 1396, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1102, - "balance": 1102, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 102 - }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9dd3c2e392f78614", - "created_at": "2023-03-17T16:20:33.807Z" - }, - { - "id": "vtx_0c9dd2527696ba081b", - "source_id": "20230317_add_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Adding points to card", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1397, - "object": "balance", - "points": 100, - "balance": 1397, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:14:16.524Z" - }, - { - "id": "vtx_0c9dd1ce1d403f4204", - "source_id": "20230317_subtract_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": "Subtracting points from card", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1297, - "object": "balance", - "points": -1, - "balance": 1297, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-17T16:12:00.981Z" - }, - { - "id": "vtx_0c9c21df658d03ce3f", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "Automation", - "reason": null, - "type": "POINTS_ACCRUAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1298, - "object": "balance", - "points": 200, - "balance": 1298, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_QZEKPzYATFjGoos4DonMg0fd", - "source_id": "s" - }, - "event": { - "id": "evcus_0c9c21def34e3c05bf", - "type": "customer.order.paid" - }, - "earning_rule": { - "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", - "source": { - "banner": "Order paid" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-16T08:44:52.333Z" - }, - { - "id": "vtx_0c9b09673f8a862a51", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REFUND", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 1000, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null - }, - "redemption": { - "id": "r_0c9b08fe4b80897849" - }, - "rollback": { - "id": "rr_0c9b0967244a862a33" - }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:19:29.149Z" - }, - { - "id": "vtx_0c9b08fe530089785c", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": null, - "reason": null, - "type": "POINTS_REDEMPTION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": -1000, - "balance": 98, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "order": { - "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", - "source_id": null - }, - "redemption": { - "id": "r_0c9b08fe4b80897849" - }, - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "name": "100 = $20" - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:17:41.708Z" - }, - { - "id": "vtx_0c9b074afed3b30e4b", - "source_id": "20230309_add_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer purchased points at kiosk.", - "type": "POINTS_ADDITION", - "details": { - "balance": { - "type": "loyalty_card", - "total": 1098, - "object": "balance", - "points": 100, - "balance": 1098, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:10:15.917Z" - }, - { - "id": "vtx_0c9b073072408969d1", - "source_id": "20230309_subtract_points_1", - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "voucherify-web-ui", - "reason": "Customer used points to obtain tickets.", - "type": "POINTS_REMOVAL", - "details": { - "balance": { - "type": "loyalty_card", - "total": 998, - "object": "balance", - "points": -1, - "balance": 998, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - } - }, - "related_transaction_id": null, - "created_at": "2023-03-15T12:09:48.735Z" - }, - { - "id": "vtx_0c9afe802593b34b80", - "source_id": null, - "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "source": "API", - "reason": null, - "type": "POINTS_TRANSFER_OUT", - "details": { - "balance": { - "type": "loyalty_card", - "total": 999, - "object": "balance", - "points": -1, - "balance": 999, - "related_object": { - "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", - "type": "voucher" - } - }, - "destination_voucher": { - "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", - "code": "LOYALTY-CARD-A8XVurg", - "type": "LOYALTY_CARD", - "campaign": "Loyalty Campaign - Test Initial Points", - "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", - "loyalty_card": { - "points": 1001, - "balance": 1001, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 1 - }, - "is_referral_code": false - } - }, - "related_transaction_id": "vtx_0c9afe802593b34b81", - "created_at": "2023-03-15T11:31:51.062Z" - } - ], - "has_more": false - } + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + }, + "examples": { + "Loyalty Card": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Loyalty Program", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13435, + "balance": 13135, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 12 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-21T13:49:54.949Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/activities": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/loyalties/members/{memberId}/transactions/export": { - "parameters": [ - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "get": { + "operationId": "get-member-activities-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member Activities", + "description": "Retrieves the list of activities for the given member ID related to voucher and customer who is a holder of the voucher.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of event objects related to the loyalty card.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." + "$ref": "#/components/schemas/8_res_get_member_activities" + } } - ], - "post": { - "operationId": "export-loyalty-card-transactions", - "tags": [ - "LOYALTIES API" - ], - "summary": "Export Loyalty Card Transactions", - "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/activities": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member-activities", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Member Activities", + "description": "Retrieves a list of activities for the given loyalty card related to the loyalty and customer who is the holder of the loyalty card.\n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:get-member-activities-1). The URL was re-designed to allow you to get member activities without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of event objects related to the loyalty card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_member_activities" } - ], - "requestBody": { - "description": "Specify the parameters and filters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] - } - } - } - } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/balance": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "post": { + "operationId": "add-remove-loyalty-card-balance-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add or Remove Loyalty Card Balance", + "description": "This method adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the point adjustment along with the expiration mechanism.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_remove_points_balance" + }, + "examples": { + "Add points": { + "value": { + "points": 100, + "expiration_type": "CUSTOM_DATE", + "expiration_date": "2023-05-30" + } + }, + "Deduct points": { + "value": { + "points": -100 } } - }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", - "object": "export", - "created_at": "2023-03-21T13:50:43.286Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "LOYALTY-CARD-2IAoDNF" - ] - } - } - } - }, - "result": null, - "user_id": null - } - }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null - } - } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a balance object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_add_remove_points_balance" + }, + "examples": { + "Add balance": { + "value": { + "points": -100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" } } - } - }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } + }, + "Deduct balance": { + "value": { + "points": -100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" } } } @@ -68860,282 +67831,100 @@ } } }, - "/v1/loyalties/{campaignId}/members/{memberId}/transactions/export": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export." - }, - { + "400": { + "description": "Returns an error if the expiration date was defined incorrectly in the request payload.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." - } - ], - "post": { - "operationId": "export-loyalty-card-transactions-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Export Loyalty Card Transactions", - "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters and filters for the transaction export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ] - } - } - } + "examples": { + "Invalid expiration date": { + "value": { + "code": 400, + "key": "invalid_expiration_date", + "message": "Invalid Expiration Date", + "details": "Expiration date cannot be set in the past", + "request_id": "v-0c118b1611424ca899" } } } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/balance": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "post": { + "operationId": "add-remove-loyalty-card-balance", + "tags": [ + "LOYALTIES API" + ], + "summary": "Add or Remove Loyalty Card Balance", + "description": "This method gives adds or removes balance to an existing loyalty card. The removal of points will consume the points that expire the soonest. \n\n\n> 📘 Alternative endpoint\n> This endpoint is an alternative to this [endpoint](ref:add-remove-loyalty-card-balance-1). The URL was re-designed to allow you to add or remove loyalty card balance without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the point adjustment along with the expiration mechanism.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_add_remove_points_balance" }, - "responses": { - "200": { - "description": "Returns an export object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", - "object": "export", - "created_at": "2023-03-21T13:50:43.286Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "details", - "related_transaction_id" - ], - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "LOYALTY-CARD-2IAoDNF" - ] - } - } - } - }, - "result": null, - "user_id": null - } - }, - "No request body": { - "value": { - "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", - "object": "export", - "created_at": "2023-03-21T13:34:57.034Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "voucher_transactions", - "parameters": { - "filters": { - "voucher_id": { - "conditions": { - "$in": [ - "HRwc0oHz" - ] - } - } - } - }, - "result": null, - "user_id": null - } - } - } - } + "examples": { + "Subtract points": { + "value": { + "points": -100 } }, - "404": { - "description": "Returns an error if the voucher code does not exist or has been deleted.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id IrKORhS", - "request_id": "v-0a96cd820301c0483a", - "resource_id": "IrKORhS", - "resource_type": "voucher" - } - } - } - } + "Add Points": { + "value": { + "points": 100, + "expiration_type": "CUSTOM_DATE", + "expiration_date": "2023-05-30" } } } } - }, - "/v1/loyalties/{campaignId}/members/{memberId}/points-expiration": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { + } + }, + "responses": { + "200": { + "description": "Returns a balance object.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Loyalty card code." - } - ], - "get": { - "operationId": "get-points-expiration", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Points Expiration", - "description": "Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the [Exports API](ref:create-export) to retrieve a list of both `ACTIVE` and `EXPIRED` point buckets.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" + "$ref": "#/components/schemas/8_res_add_remove_points_balance" }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty points expiration buckets along with an expiration date if the points are due to expire. No expiration date parameter is returned if the loyalty points bucket does not expire.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "lopb_ERSwDxeWTlvWwFrn3AtJxt3s", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 2 - }, - "status": "ACTIVE", - "expires_at": "2022-11-25", - "created_at": "2022-11-25T09:10:20.994Z", - "object": "loyalty_points_bucket" - }, - { - "id": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 12 - }, - "status": "ACTIVE", - "expires_at": "2022-11-30", - "created_at": "2022-11-21T13:49:54.949Z", - "object": "loyalty_points_bucket" - }, - { - "id": "lopb_Mg80vhZtqHFItWlJFYZ2rJAS", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 0 - }, - "status": "ACTIVE", - "expires_at": "2023-05-30", - "created_at": "2022-06-09T11:07:07.344Z", - "updated_at": "2022-08-30T08:34:45.989Z", - "object": "loyalty_points_bucket" - }, - { - "id": "lopb_dQE1TwyTkHAJDlVCPlqSC0nu", - "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "bucket": { - "total_points": 13124 - }, - "status": "ACTIVE", - "created_at": "2022-02-28T12:13:57.749Z", - "updated_at": "2022-11-25T09:09:51.136Z", - "object": "loyalty_points_bucket" - } - ], - "total": 4 - } - } + "examples": { + "Subtract Points": { + "value": { + "points": 100, + "total": 13436, + "balance": 13136, + "type": "loyalty_card", + "object": "balance", + "related_object": { + "type": "voucher", + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF" } } } @@ -69143,2621 +67932,3777 @@ } } }, - "/v1/loyalties/{campaignId}/points-expiration/export": { - "parameters": [ - { + "400": { + "description": "Returns an error if the expiration date was specified incorrectly in the request payload.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - } - ], - "post": { - "operationId": "create-points-expiration-export", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Points Expiration Export", - "description": "Schedule the generation of a points expiration CSV file for a particular campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the data filters, types of data to return and order in which the results should be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_export_points_expirations" - }, - "examples": { - "Specific Vouchers": { - "value": { - "parameters": { - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "order": "-expires_at", - "filters": { - "junction": "and", - "voucher_id": { - "conditions": { - "$in": [ - "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" - ] - } - } - } - } - } - }, - "Specific campaign": { - "value": { - "parameters": { - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "order": "-expires_at", - "filters": { - "junction": "and", - "campaign_id": { - "conditions": { - "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - } - } - } - } - } - } + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .expiration_date cannot be recognized as a ISO-8601 compliant date", + "request_id": "v-0c118c6f7c0e6751ab" } } } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/transfers": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher to which the loyalty points will be sent (destination)." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card to which the user wants to transfer loyalty points (destination)." + } + ], + "post": { + "operationId": "transfer-points", + "tags": [ + "LOYALTIES API" + ], + "summary": "Transfer Loyalty Points", + "description": "Transfer points between different loyalty cards. You need to provide the campaign ID and the loyalty card ID you want the points to be transferred to as path parameters in the URL. In the request body, you provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Provide the loyalty cards you want the points to be transferred from and the number of points to transfer from each card.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_transfer_loyalty_points" }, - "responses": { - "200": { - "description": "Returns an object with the export ID of the scheduled generation of CSV file with exported points expirations. You can use either the [Get Export](ref:get-export) endpoint to view the status and obtain the URL of the CSV file or [Download Export](ref:download-export) endpoint to download the CSV file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_export_object_points_expiration" - }, - "examples": { - "Specific Vouchers": { - "value": { - "id": "exp_zC3eXAFss17XTMzMkkov4KGq", - "object": "export", - "created_at": "2022-11-28T13:00:23.621Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "points_expiration", - "parameters": { - "order": "-expires_at", - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "filters": { - "junction": "and", - "voucher_id": { - "conditions": { - "$in": [ - "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" - ] - } - } - } - }, - "result": null, - "user_id": null - } - }, - "Specific Campaign": { - "value": { - "id": "exp_kfwVDMsavDHl2vOY6vH9q7P7", - "object": "export", - "created_at": "2022-11-28T16:46:34.148Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "points_expiration", - "parameters": { - "order": "-expires_at", - "fields": [ - "id", - "campaign_id", - "voucher_id", - "status", - "expires_at", - "points" - ], - "filters": { - "junction": "and", - "campaign_id": { - "conditions": { - "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" - } - } - } - }, - "result": null, - "user_id": null - } - } - } + "examples": { + "Example": { + "value": [ + { + "code": "0PmQ7JQI", + "points": 1 + }, + { + "code": "kCeufB8i", + "points": 1 } - } + ] } } } - }, - "/v1/loyalties/{campaignId}/earning-rules": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns a loyalty card object for the loaded loyalty card, ie. the one that that points were transferred to from the other cards(s).", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-earning-rules", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Earning Rules", - "description": "Returns a list of all earning rules within a given campaign.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of earning rules.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_earning_rules" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", - "created_at": "2022-11-10T12:25:12.927Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 100, - "type": "FIXED" - }, - "segment": { - "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" - }, - "event": "customer.segment.entered", - "source": { - "banner": "New Customers", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", - "metadata": {} - }, - { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T07:31:42.778Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 20, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" - } - }, - { - "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", - "created_at": "2022-11-24T14:48:36.567Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1000, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", - "metadata": { - "Type": "Order has been paid - Proportional - 1" - } - }, - { - "id": "ern_jwtacKdEEHoc85QbouRw3CR8", - "created_at": "2022-11-24T15:17:11.539Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1100, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", - "metadata": { - "Type": "Order has been paid - Proportional - 2" - } - }, - { - "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", - "created_at": "2022-11-24T15:20:04.392Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 10, - "points": 2, - "property": "number_of_store_visits" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", - "metadata": { - "Type": "Order has been paid - Proportional - 3 - Metadata" - } - }, - { - "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", - "created_at": "2022-11-24T15:23:44.514Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 1000, - "points": 3, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", - "metadata": { - "Type": "Order has been paid - Proportional - 4" - } - }, - { - "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", - "created_at": "2022-11-24T15:44:45.301Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 1000, - "points": 4, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", - "metadata": { - "Type": "Order has been paid - Proportional - 5 - Items" - } - }, - { - "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", - "created_at": "2022-11-24T15:56:58.710Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 10000, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", - "metadata": {} - }, - { - "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", - "created_at": "2022-11-24T16:19:20.571Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 5, - "property": "customer_life_time_value" - } - } - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered Segment", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", - "metadata": {} - }, - { - "id": "ern_L8dFanPxJzhw0f5voTwPurGP", - "created_at": "2022-11-24T16:27:13.917Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", - "metadata": { - "Type": "Fixed" - } - }, - { - "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", - "created_at": "2022-11-24T16:41:48.830Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 2, - "points": 2, - "property": "volume_number" - } - } - }, - "custom_event": { - "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "event": "user_subscribed", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", - "metadata": { - "Type": "Event" - } - }, - { - "id": "ern_afo3Ea760hAKv07JYpycnhiE", - "created_at": "2022-11-24T16:50:12.945Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 3, - "property": "customer_life_time_value" - } - } - }, - "custom_event": { - "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" - }, - "event": "cart_abandoned", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", - "metadata": {} - }, - { - "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", - "created_at": "2022-11-24T16:51:31.595Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier joined - Any", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", - "metadata": { - "Type": "Tier joined - any - fixed" - } - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "total": 18 - } + "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + }, + "examples": { + "Example": { + "value": { + "id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "code": "MmFAzfDe", + "campaign": "Proportional Earning Rules", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "category": null, + "category_id": "cat_0b6152ce12414820de", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 13441, + "balance": 13141, + "next_expiration_date": "2022-11-30", + "next_expiration_points": 0 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX184kVdWUO/msrLg1G0MRf/Cs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk/dXm/QEJ/sulXKDlUMWf+MN7TRG5LB+wuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX184kVdWUO%2FmsrLg1G0MRf%2FCs6QwSN3f6kyWCOTGdijyq8OfUbUpcGx6fjdeIpTf2UilFGNG8aCWVk%2FdXm%2FQEJ%2FsulXKDlUMWf%2BMN7TRG5LB%2BwuzqTy7csDBfRoJn0fURpwU4A6VZZSwBQ%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/RGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW/cXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FRGZN9VwvkdI6B26PPZQZWjh33USr5NPMXbHuJVkxsH6TUyW%2FcXen1Lc7gaqik09BGiry0R4QIAP52jnxQuABOsW0HdYfglsLPY7IajGX5rJzZKDKuzioq2vRIPyuE6z03frAod7ptvQ%3D%3D" } - } + }, + "is_referral_code": false, + "created_at": "2022-02-18T14:03:59.954Z", + "updated_at": "2022-11-28T17:58:25.607Z", + "holder_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "redemption": { + "quantity": null, + "redeemed_quantity": 1, + "redeemed_points": 300, + "object": "list", + "url": "/v1/vouchers/MmFAzfDe/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/MmFAzfDe/publications?page=1&limit=10" + }, + "object": "voucher" } } } } - }, - "post": { - "operationId": "create-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Earning Rule", - "description": "Create earning rules for a loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Customize the request body based on the type of earning rules you would like to create. The request body is an array of objects. The required minimum properties to include in the payload for each object are `event` and `loyalty`. Additionally, if you choose to add a `validity_timeframe`, you must include a `start_date`. Furthermore, an earning rule `event` type: \n\n- `customer.segment.entered` requires a `segment` object\n- a custom event requires a `custom_event` object\n- a `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged` requires a `loyalty_tier` object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_earning_rules" - }, - "examples": { - "Example": { - "value": [ - { - "event": "order.paid", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" - }, - "source": { - "banner": "Order paid 5 points." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - fixed amount of points" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1, - "points": 1 - } - } - }, - "source": { - "banner": "Order paid - 1 point for 1 dollar spent excluding discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1, - "points": 1 - } - } - }, - "source": { - "banner": "Order paid - 1 point for 1 dollar spent including discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order total amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 2, - "points": 1, - "property": "number_of_store_visits" - } - } - }, - "source": { - "banner": "Order paid - 2 points for each store visit." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to numerical order metadata property " - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 2, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" - } - } - }, - "source": { - "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order items amount" - } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 2, - "points": 1, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" - } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/transactions": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." + } + ], + "get": { + "operationId": "list-loyalty-card-transactions-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Card Transactions", + "description": "Retrieve transaction data related to point movements for a specific loyalty card.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty card transaction objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dd3c2e392f78613", + "source_id": "20230317_transfer_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": "Transferring points to card", + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1396, + "object": "balance", + "points": -1, + "balance": 1396, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } }, - "source": { - "banner": "Order paid - 2 points for every dollar spent on the product collection." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid- points proportional to order items subtotal amount" + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1102, + "balance": 1102, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 102 + }, + "is_referral_code": false } - }, - { - "event": "order.paid", - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_QUANTITY", - "order_items": { - "quantity": { - "every": 1, - "points": 1, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } - } - }, - "source": { - "banner": "Order paid - 1 point for every brand phone in your cart." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." + }, + "related_transaction_id": "vtx_0c9dd3c2e392f78614", + "created_at": "2023-03-17T16:20:33.807Z" + }, + { + "id": "vtx_0c9dd2527696ba081b", + "source_id": "20230317_add_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Adding points to card", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1397, + "object": "balance", + "points": 100, + "balance": 1397, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } } }, - { - "event": "order.paid", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" - } + "related_transaction_id": null, + "created_at": "2023-03-17T16:14:16.524Z" + }, + { + "id": "vtx_0c9dd1ce1d403f4204", + "source_id": "20230317_subtract_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Subtracting points from card", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1297, + "object": "balance", + "points": -1, + "balance": 1297, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } - }, - "source": { - "banner": "Order paid 1 point for 1 month of being a customer with us." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Order paid - points proportional to customer metadata property" } }, - { - "event": "customer.segment.entered", - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" - } + "related_transaction_id": null, + "created_at": "2023-03-17T16:12:00.981Z" + }, + { + "id": "vtx_0c9c21df658d03ce3f", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "Automation", + "reason": null, + "type": "POINTS_ACCRUAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1298, + "object": "balance", + "points": 200, + "balance": 1298, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } }, - "source": { - "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us." + "order": { + "id": "ord_QZEKPzYATFjGoos4DonMg0fd", + "source_id": "s" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "event": { + "id": "evcus_0c9c21def34e3c05bf", + "type": "customer.order.paid" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Entered segment - points proportional to customer metadata property" + "earning_rule": { + "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", + "source": { + "banner": "Order paid" + } } }, - { - "event": "customer.segment.entered", - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + "related_transaction_id": null, + "created_at": "2023-03-16T08:44:52.333Z" + }, + { + "id": "vtx_0c9b09673f8a862a51", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REFUND", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 1000, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } }, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null }, - "source": { - "banner": "Customer entered birthday segment - 5 points" + "redemption": { + "id": "r_0c9b08fe4b80897849" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "rollback": { + "id": "rr_0c9b0967244a862a33" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Entered segment - fixed points" + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" } }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 3, - "type": "FIXED" + "related_transaction_id": null, + "created_at": "2023-03-15T12:19:29.149Z" + }, + { + "id": "vtx_0c9b08fe530089785c", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REDEMPTION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": -1000, + "balance": 98, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null }, - "source": { - "banner": "See page - 3 points" + "redemption": { + "id": "r_0c9b08fe4b80897849" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:17:41.708Z" + }, + { + "id": "vtx_0c9b074afed3b30e4b", + "source_id": "20230309_add_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer purchased points at kiosk.", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 100, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:10:15.917Z" + }, + { + "id": "vtx_0c9b073072408969d1", + "source_id": "20230309_subtract_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer used points to obtain tickets.", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 998, + "object": "balance", + "points": -1, + "balance": 998, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:09:48.735Z" + }, + { + "id": "vtx_0c9afe802593b34b80", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": null, + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 999, + "object": "balance", + "points": -1, + "balance": 999, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - fixed points for viewing a page" + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1001, + "balance": 1001, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 1 + }, + "is_referral_code": false } }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 1, - "points": 2, - "property": "volume_number" - } + "related_transaction_id": "vtx_0c9afe802593b34b81", + "created_at": "2023-03-15T11:31:51.062Z" + } + ], + "has_more": false + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/transactions": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to retrieve transaction data for." + } + ], + "get": { + "operationId": "list-loyalty-card-transactions", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Card Transactions", + "description": "Retrieve transaction data related to point movements for a specific loyalty card.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty card transaction objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "vtx_0c9dd3c2e392f78613", + "source_id": "20230317_transfer_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": "Transferring points to card", + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1396, + "object": "balance", + "points": -1, + "balance": 1396, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1102, + "balance": 1102, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 102 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9dd3c2e392f78614", + "created_at": "2023-03-17T16:20:33.807Z" + }, + { + "id": "vtx_0c9dd2527696ba081b", + "source_id": "20230317_add_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Adding points to card", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1397, + "object": "balance", + "points": 100, + "balance": 1397, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:14:16.524Z" + }, + { + "id": "vtx_0c9dd1ce1d403f4204", + "source_id": "20230317_subtract_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": "Subtracting points from card", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1297, + "object": "balance", + "points": -1, + "balance": 1297, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-17T16:12:00.981Z" + }, + { + "id": "vtx_0c9c21df658d03ce3f", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "Automation", + "reason": null, + "type": "POINTS_ACCRUAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1298, + "object": "balance", + "points": 200, + "balance": 1298, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } }, - "source": { - "banner": "See page X - get 2 points multiplied by the page number" + "order": { + "id": "ord_QZEKPzYATFjGoos4DonMg0fd", + "source_id": "s" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "event": { + "id": "evcus_0c9c21def34e3c05bf", + "type": "customer.order.paid" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + "earning_rule": { + "id": "ern_2WsCIBEx6Lzf5IAV5IOR7a23", + "source": { + "banner": "Order paid" + } } }, - { - "event": "page_view", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" - } + "related_transaction_id": null, + "created_at": "2023-03-16T08:44:52.333Z" + }, + { + "id": "vtx_0c9b09673f8a862a51", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REFUND", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 1000, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null }, - "source": { - "banner": "Get 2 points for every month you're a customer for viewing a page" + "redemption": { + "id": "r_0c9b08fe4b80897849" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "rollback": { + "id": "rr_0c9b0967244a862a33" }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on customer metadata" + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" } }, - { - "event": "customer.loyalty.tier.prolonged", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" - } + "related_transaction_id": null, + "created_at": "2023-03-15T12:19:29.149Z" + }, + { + "id": "vtx_0c9b08fe530089785c", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": null, + "reason": null, + "type": "POINTS_REDEMPTION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": -1000, + "balance": 98, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" } }, - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + "order": { + "id": "ord_DH2gGDlDWB1hRImf1VVB4EIH", + "source_id": null }, - "source": { - "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged." + "redemption": { + "id": "r_0c9b08fe4b80897849" }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "name": "100 = $20" + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:17:41.708Z" + }, + { + "id": "vtx_0c9b074afed3b30e4b", + "source_id": "20230309_add_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer purchased points at kiosk.", + "type": "POINTS_ADDITION", + "details": { + "balance": { + "type": "loyalty_card", + "total": 1098, + "object": "balance", + "points": 100, + "balance": 1098, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:10:15.917Z" + }, + { + "id": "vtx_0c9b073072408969d1", + "source_id": "20230309_subtract_points_1", + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "voucherify-web-ui", + "reason": "Customer used points to obtain tickets.", + "type": "POINTS_REMOVAL", + "details": { + "balance": { + "type": "loyalty_card", + "total": 998, + "object": "balance", + "points": -1, + "balance": 998, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } + } + }, + "related_transaction_id": null, + "created_at": "2023-03-15T12:09:48.735Z" + }, + { + "id": "vtx_0c9afe802593b34b80", + "source_id": null, + "voucher_id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "source": "API", + "reason": null, + "type": "POINTS_TRANSFER_OUT", + "details": { + "balance": { + "type": "loyalty_card", + "total": 999, + "object": "balance", + "points": -1, + "balance": 999, + "related_object": { + "id": "v_lWRrcwNm0vqxBaU5nsSMzRRHusCsS4Vl", + "type": "voucher" + } }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "metadata": { - "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." + "destination_voucher": { + "id": "v_Wak6xlf5WdR4rIcvJxC2olOopk0boK6t", + "code": "LOYALTY-CARD-A8XVurg", + "type": "LOYALTY_CARD", + "campaign": "Loyalty Campaign - Test Initial Points", + "campaign_id": "camp_LyAZf94hbZaUbSdKIeAJpjRp", + "loyalty_card": { + "points": 1001, + "balance": 1001, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 1 + }, + "is_referral_code": false + } + }, + "related_transaction_id": "vtx_0c9afe802593b34b81", + "created_at": "2023-03-15T11:31:51.062Z" + } + ], + "has_more": false + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/transactions/export": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." + } + ], + "post": { + "operationId": "export-loyalty-card-transactions", + "tags": [ + "LOYALTIES API" + ], + "summary": "Export Loyalty Card Transactions", + "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters and filters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_transactions_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", + "object": "export", + "created_at": "2023-03-21T13:50:43.286Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "LOYALTY-CARD-2IAoDNF" + ] + } + } + } + }, + "result": null, + "user_id": null + } + }, + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/transactions/export": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to export." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A unique code identifying the loyalty card that you are looking to export transaction data for." + } + ], + "post": { + "operationId": "export-loyalty-card-transactions-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Export Loyalty Card Transactions", + "description": "Export transactions that are associated with point movements on a loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                  - `POINTS_ADDITION`
                  - `POINTS_REMOVAL`
                  - `POINTS_TRANSFER_OUT`
                  - `POINTS_ACCRUAL`
                  - `POINTS_REFUND`
                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                  - `voucherify-web-ui`
                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters and filters for the transaction export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ] + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an export object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_transactions_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_8Fwd6Z8NS67ZH314KRtm5xXE", + "object": "export", + "created_at": "2023-03-21T13:50:43.286Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "type", + "source_id", + "reason", + "balance", + "amount", + "created_at", + "voucher_id", + "campaign_id", + "details", + "related_transaction_id" + ], + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "LOYALTY-CARD-2IAoDNF" + ] + } + } + } + }, + "result": null, + "user_id": null + } + }, + "No request body": { + "value": { + "id": "exp_ExEE5A6OIK4tssuNswr5O6SU", + "object": "export", + "created_at": "2023-03-21T13:34:57.034Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "voucher_transactions", + "parameters": { + "filters": { + "voucher_id": { + "conditions": { + "$in": [ + "HRwc0oHz" + ] + } + } + } + }, + "result": null, + "user_id": null + } + } + } + } + } + }, + "404": { + "description": "Returns an error if the voucher code does not exist or has been deleted.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id IrKORhS", + "request_id": "v-0a96cd820301c0483a", + "resource_id": "IrKORhS", + "resource_type": "voucher" + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/points-expiration": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Loyalty card code." + } + ], + "get": { + "operationId": "get-points-expiration", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Points Expiration", + "description": "Retrieve loyalty point expiration buckets for a given loyalty card. Expired point buckets are not returned in this endpoint. You can use the [Exports API](ref:create-export) to retrieve a list of both `ACTIVE` and `EXPIRED` point buckets.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty points expiration buckets along with an expiration date if the points are due to expire. No expiration date parameter is returned if the loyalty points bucket does not expire.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetPointsExpirationResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "lopb_ERSwDxeWTlvWwFrn3AtJxt3s", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 2 + }, + "status": "ACTIVE", + "expires_at": "2022-11-25", + "created_at": "2022-11-25T09:10:20.994Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 12 + }, + "status": "ACTIVE", + "expires_at": "2022-11-30", + "created_at": "2022-11-21T13:49:54.949Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_Mg80vhZtqHFItWlJFYZ2rJAS", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 0 + }, + "status": "ACTIVE", + "expires_at": "2023-05-30", + "created_at": "2022-06-09T11:07:07.344Z", + "updated_at": "2022-08-30T08:34:45.989Z", + "object": "loyalty_points_bucket" + }, + { + "id": "lopb_dQE1TwyTkHAJDlVCPlqSC0nu", + "voucher_id": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "campaign_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "bucket": { + "total_points": 13124 + }, + "status": "ACTIVE", + "created_at": "2022-02-28T12:13:57.749Z", + "updated_at": "2022-11-25T09:09:51.136Z", + "object": "loyalty_points_bucket" + } + ], + "total": 4 + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/points-expiration/export": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + } + ], + "post": { + "operationId": "create-points-expiration-export", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Points Expiration Export", + "description": "Schedule the generation of a points expiration CSV file for a particular campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the data filters, types of data to return and order in which the results should be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_export_points_expirations" + }, + "examples": { + "Specific Vouchers": { + "value": { + "parameters": { + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "order": "-expires_at", + "filters": { + "junction": "and", + "voucher_id": { + "conditions": { + "$in": [ + "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" + ] + } + } + } + } + } + }, + "Specific campaign": { + "value": { + "parameters": { + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "order": "-expires_at", + "filters": { + "junction": "and", + "campaign_id": { + "conditions": { + "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + } + } + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an object with the export ID of the scheduled generation of CSV file with exported points expirations. You can use either the [Get Export](ref:get-export) endpoint to view the status and obtain the URL of the CSV file or [Download Export](ref:download-export) endpoint to download the CSV file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_export_object_points_expiration" + }, + "examples": { + "Specific Vouchers": { + "value": { + "id": "exp_zC3eXAFss17XTMzMkkov4KGq", + "object": "export", + "created_at": "2022-11-28T13:00:23.621Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "points_expiration", + "parameters": { + "order": "-expires_at", + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "filters": { + "junction": "and", + "voucher_id": { + "conditions": { + "$in": [ + "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", + "v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655" + ] } } - ] - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns an array of earning rule objects.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } - }, - "examples": { - "Example": { - "value": [ - { - "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 5 points.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", - "metadata": { - "Type": "Order paid - fixed amount of points" - } - }, - { - "id": "ern_Ov5RWerVFubVSjIHOMco34dv", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for 1 dollar spent excluding discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_2R4x6pMFVEIPz1Lhz5ZVo33Y", - "metadata": { - "Type": "Order paid- points proportional to order amount" + } + }, + "result": null, + "user_id": null + } + }, + "Specific Campaign": { + "value": { + "id": "exp_kfwVDMsavDHl2vOY6vH9q7P7", + "object": "export", + "created_at": "2022-11-28T16:46:34.148Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "points_expiration", + "parameters": { + "order": "-expires_at", + "fields": [ + "id", + "campaign_id", + "voucher_id", + "status", + "expires_at", + "points" + ], + "filters": { + "junction": "and", + "campaign_id": { + "conditions": { + "$is": "camp_7s3uXI44aKfIk5IhmeOPr6ic" + } + } + } + }, + "result": null, + "user_id": null + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/earning-rules": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "list-earning-rules", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Earning Rules", + "description": "Returns a list of all earning rules within a given campaign.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of earning rules.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_earning_rules" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", + "created_at": "2022-11-10T12:25:12.927Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 100, + "type": "FIXED" + }, + "segment": { + "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" + }, + "event": "customer.segment.entered", + "source": { + "banner": "New Customers", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", + "metadata": {} + }, + { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T07:31:42.778Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" + } + }, + { + "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", + "created_at": "2022-11-24T14:48:36.567Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1000, + "points": 1 } - }, - { - "id": "ern_5rWPz4arGlTv4FVc1vETeFfe", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for 1 dollar spent including discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_fXasfs6Eh7P2haZkI33PEumI", - "metadata": { - "Type": "Order paid- points proportional to order total amount" + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", + "metadata": { + "Type": "Order has been paid - Proportional - 1" + } + }, + { + "id": "ern_jwtacKdEEHoc85QbouRw3CR8", + "created_at": "2022-11-24T15:17:11.539Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1100, + "points": 1 } - }, - { - "id": "ern_Xs3o43dHr1O3RM5ojoeu1l6b", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 2, - "points": 1, - "property": "number_of_store_visits" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for each store visit.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_jucMzF25jisrqiG3k6JyyviT", + } + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", + "metadata": { + "Type": "Order has been paid - Proportional - 2" + } + }, + { + "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", + "created_at": "2022-11-24T15:20:04.392Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { "metadata": { - "Type": "Order paid- points proportional to numerical order metadata property " + "every": 10, + "points": 2, + "property": "number_of_store_visits" } - }, - { - "id": "ern_9CjMBP2V8zgpsHLga4YOQo0A", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 2, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_y60lx7XsW1YdOOOFuDaYjvG4", - "metadata": { - "Type": "Order paid- points proportional to order items amount" + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", + "metadata": { + "Type": "Order has been paid - Proportional - 3 - Metadata" + } + }, + { + "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", + "created_at": "2022-11-24T15:23:44.514Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 1000, + "points": 3, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" } - }, - { - "id": "ern_uI7hRj8PNodK8xWRsn3gpDdG", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 2, - "points": 1, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 2 points for every dollar spent on the product collection.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_Lk1WROGexXA72FabUWhR1p7X", - "metadata": { - "Type": "Order paid- points proportional to order items subtotal amount" + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", + "metadata": { + "Type": "Order has been paid - Proportional - 4" + } + }, + { + "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", + "created_at": "2022-11-24T15:44:45.301Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 1000, + "points": 4, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" } - }, - { - "id": "ern_dL13AmZEO0ToImOY44YUP1ru", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_QUANTITY", - "order_items": { - "quantity": { - "every": 1, - "points": 1, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid - 1 point for every brand phone in your cart.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_4F9iJG0hmKTiqSsmkfbB8vUF", - "metadata": { - "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", + "metadata": { + "Type": "Order has been paid - Proportional - 5 - Items" + } + }, + { + "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", + "created_at": "2022-11-24T15:56:58.710Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 10000, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" } - }, - { - "id": "ern_ublD9yGhxPrd9ayPAMTc4aOZ", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1 point for 1 month of being a customer with us.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_raft7C1hVw427OnEobmzhXjD", + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", + "metadata": {} + }, + { + "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", + "created_at": "2022-11-24T16:19:20.571Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Order paid - points proportional to customer metadata property" + "every": 1, + "points": 5, + "property": "customer_life_time_value" } - }, - { - "id": "ern_6tBwufmR7UNJInhZq8zNRrj5", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 1, - "property": "customer_life_time_value" - } - } - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_mQ8SCABGLnrGMBbh8QS6DUpX", + } + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered Segment", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", + "metadata": {} + }, + { + "id": "ern_L8dFanPxJzhw0f5voTwPurGP", + "created_at": "2022-11-24T16:27:13.917Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", + "metadata": { + "Type": "Fixed" + } + }, + { + "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", + "created_at": "2022-11-24T16:41:48.830Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { "metadata": { - "Type": "Entered segment - points proportional to customer metadata property" + "every": 2, + "points": 2, + "property": "volume_number" } - }, - { - "id": "ern_yBR0JtdcDyJXgZf30C8KQLPw", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Customer entered birthday segment - 5 points", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_Co7zjgYPIKZ45vcK0jn7qrY8", + } + }, + "custom_event": { + "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "event": "user_subscribed", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", + "metadata": { + "Type": "Event" + } + }, + { + "id": "ern_afo3Ea760hAKv07JYpycnhiE", + "created_at": "2022-11-24T16:50:12.945Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Entered segment - fixed points" - } - }, - { - "id": "ern_Ic2AUznt4cJInIl1wt6n0Fbv", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { + "every": 3, "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "See page - 3 points", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_KWvcBS3bdmJnWD4BTw29eRNT", - "metadata": { - "Type": "Custom Event - fixed points for viewing a page" + "property": "customer_life_time_value" } - }, - { - "id": "ern_4SRj1TY1j8Q617R2Y4qiN1sy", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 1, - "points": 2, - "property": "volume_number" - } - } - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "See page X - get 2 points multiplied by the page number", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_WWESERcKoTRSbCDal7Hr7H0A", + } + }, + "custom_event": { + "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" + }, + "event": "cart_abandoned", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", + "metadata": {} + }, + { + "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", + "created_at": "2022-11-24T16:51:31.595Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier joined - Any", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", + "metadata": { + "Type": "Tier joined - any - fixed" + } + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + "every": 4, + "points": 4, + "property": "customer_life_time_value" } - }, - { - "id": "ern_WXBa4b5a6N5XZt9A9Nf9dagA", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Get 2 points for every month you're a customer for viewing a page", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_zv3mCOeZOaHCsFMG0yIKu0ax", + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Custom Event - proportional points for viewing a page based on customer metadata" + "every": 2, + "points": 2, + "property": "customer_life_time_value" } - }, - { - "id": "ern_DvdegDzcaMUXzf2fayzCqMEV", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": null, - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_fpfYyNcpVskgwcrs21kQ91Wx", + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." + "every": 3, + "points": 4, + "property": "customer_life_time_value" } } - ] + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "total": 18 + } + } + } + } + } + } + } + }, + "post": { + "operationId": "create-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Earning Rule", + "description": "Create earning rules for a loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Customize the request body based on the type of earning rules you would like to create. The request body is an array of objects. The required minimum properties to include in the payload for each object are `event` and `loyalty`. Additionally, if you choose to add a `validity_timeframe`, you must include a `start_date`. Furthermore, an earning rule `event` type: \n\n- `customer.segment.entered` requires a `segment` object\n- a custom event requires a `custom_event` object\n- a `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged` requires a `loyalty_tier` object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_earning_rules" + }, + "examples": { + "Example": { + "value": [ + { + "event": "order.paid", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "FIXED", + "points": "5" + }, + "source": { + "banner": "Order paid 5 points." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - fixed amount of points" + } + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1, + "points": 1 + } + } + }, + "source": { + "banner": "Order paid - 1 point for 1 dollar spent excluding discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order amount" + } + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1, + "points": 1 + } + } + }, + "source": { + "banner": "Order paid - 1 point for 1 dollar spent including discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order total amount" + } + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 2, + "points": 1, + "property": "number_of_store_visits" + } + } + }, + "source": { + "banner": "Order paid - 2 points for each store visit." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to numerical order metadata property " + } + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 2, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } } + }, + "source": { + "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order items amount" } - } - } - }, - "400": { - "description": "Returns an error if a parameters is defined incorrectly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_missing_param" + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 2, + "points": 1, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "source": { + "banner": "Order paid - 2 points for every dollar spent on the product collection." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Loyalty order rules must contain one of the following properties - 'total_amount'", - "request_id": "v-0c127fa5d4424c8411" + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid- points proportional to order items subtotal amount" + } + }, + { + "event": "order.paid", + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_QUANTITY", + "order_items": { + "quantity": { + "every": 1, + "points": 1, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" } } + }, + "source": { + "banner": "Order paid - 1 point for every brand phone in your cart." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." } - } - } - }, - "404": { - "description": "Returns an error if a parameter's value is not found in the respository.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find loyalty_tier with id ltr_pudTGWasuIqxdiDM0go31OV1", - "request_id": "v-0c12808f33ce673c42", - "resource_id": "ltr_pudTGWasuIqxdiDM0go31OV1", - "resource_type": "loyalty_tier" + }, + { + "event": "order.paid", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } + } + }, + "source": { + "banner": "Order paid 1 point for 1 month of being a customer with us." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - points proportional to customer metadata property" + } + }, + { + "event": "customer.segment.entered", + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 1, + "property": "customer_life_time_value" + } + } + }, + "source": { + "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Entered segment - points proportional to customer metadata property" + } + }, + { + "event": "customer.segment.entered", + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "FIXED", + "points": "5" + }, + "source": { + "banner": "Customer entered birthday segment - 5 points" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Entered segment - fixed points" + } + }, + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "See page - 3 points" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - fixed points for viewing a page" + } + }, + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 1, + "points": 2, + "property": "volume_number" + } + } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "See page X - get 2 points multiplied by the page number" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + } + }, + { + "event": "page_view", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "source": { + "banner": "Get 2 points for every month you're a customer for viewing a page" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on customer metadata" + } + }, + { + "event": "customer.loyalty.tier.prolonged", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" } } + }, + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." } } - } + ] } } } - }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { + } + }, + "responses": { + "200": { + "description": "Returns an array of earning rule objects.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "ern_CFuv1O0IDl8Jgph0ojhMu8bH" + "type": "array", + "items": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" + } }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "A unique earning rule ID." - } - ], - "get": { - "operationId": "get-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Earning Rule", - "description": "Retrieves an earning rule assigned to a campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the earning rule details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetEarningRuleResponseBody" - }, - "examples": { - "Custom Event": { - "value": { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + "examples": { + "Example": { + "value": [ + { + "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 5 points.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", + "metadata": { + "Type": "Order paid - fixed amount of points" + } + }, + { + "id": "ern_Ov5RWerVFubVSjIHOMco34dv", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1, + "points": 1 + } } }, - "Order Paid": { - "value": { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for 1 dollar spent excluding discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_2R4x6pMFVEIPz1Lhz5ZVo33Y", + "metadata": { + "Type": "Order paid- points proportional to order amount" + } + }, + { + "id": "ern_5rWPz4arGlTv4FVc1vETeFfe", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1, + "points": 1 + } } }, - "Segment Entered": { - "value": { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for 1 dollar spent including discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_fXasfs6Eh7P2haZkI33PEumI", + "metadata": { + "Type": "Order paid- points proportional to order total amount" + } + }, + { + "id": "ern_Xs3o43dHr1O3RM5ojoeu1l6b", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 2, + "points": 1, + "property": "number_of_store_visits" + } } }, - "Loyalty Tier Joined": { - "value": { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for each store visit.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_jucMzF25jisrqiG3k6JyyviT", + "metadata": { + "Type": "Order paid- points proportional to numerical order metadata property " + } + }, + { + "id": "ern_9CjMBP2V8zgpsHLga4YOQo0A", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 2, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for 1 dollar spent on items excluding discounts.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_y60lx7XsW1YdOOOFuDaYjvG4", + "metadata": { + "Type": "Order paid- points proportional to order items amount" + } + }, + { + "id": "ern_uI7hRj8PNodK8xWRsn3gpDdG", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 2, + "points": 1, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 2 points for every dollar spent on the product collection.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_Lk1WROGexXA72FabUWhR1p7X", + "metadata": { + "Type": "Order paid- points proportional to order items subtotal amount" + } + }, + { + "id": "ern_dL13AmZEO0ToImOY44YUP1ru", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_QUANTITY", + "order_items": { + "quantity": { + "every": 1, + "points": 1, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid - 1 point for every brand phone in your cart.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_4F9iJG0hmKTiqSsmkfbB8vUF", + "metadata": { + "Type": "Order paid - points proportional to quantity of items in a cart of a product varient." + } + }, + { + "id": "ern_ublD9yGhxPrd9ayPAMTc4aOZ", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Tier joined - customer metadata - proportional" + "every": 1, + "points": 1, + "property": "customer_life_time_value" } } }, - "Loyalty Tier Left": { - "value": { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "event": "order.paid", + "source": { + "banner": "Order paid 1 point for 1 month of being a customer with us.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_raft7C1hVw427OnEobmzhXjD", + "metadata": { + "Type": "Order paid - points proportional to customer metadata property" + } + }, + { + "id": "ern_6tBwufmR7UNJInhZq8zNRrj5", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Tier left" + "every": 1, + "points": 1, + "property": "customer_life_time_value" } } }, - "Loyalty Tier Upgraded": { - "value": { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Customer entered birthday segment - 1 point for each month of being a customer with us.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_mQ8SCABGLnrGMBbh8QS6DUpX", + "metadata": { + "Type": "Entered segment - points proportional to customer metadata property" + } + }, + { + "id": "ern_yBR0JtdcDyJXgZf30C8KQLPw", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Customer entered birthday segment - 5 points", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_Co7zjgYPIKZ45vcK0jn7qrY8", + "metadata": { + "Type": "Entered segment - fixed points" + } + }, + { + "id": "ern_Ic2AUznt4cJInIl1wt6n0Fbv", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "See page - 3 points", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_KWvcBS3bdmJnWD4BTw29eRNT", + "metadata": { + "Type": "Custom Event - fixed points for viewing a page" + } + }, + { + "id": "ern_4SRj1TY1j8Q617R2Y4qiN1sy", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { "metadata": { - "Type": "Upgraded" + "every": 1, + "points": 2, + "property": "volume_number" } } }, - "Loyalty Tier Downgraded": { - "value": { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "See page X - get 2 points multiplied by the page number", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_WWESERcKoTRSbCDal7Hr7H0A", + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on custom event metadata" + } + }, + { + "id": "ern_WXBa4b5a6N5XZt9A9Nf9dagA", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Tier" + "every": 1, + "points": 2, + "property": "customer_life_time_value" } } }, - "Loyalty Tier Prolonged": { - "value": { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Get 2 points for every month you're a customer for viewing a page", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_zv3mCOeZOaHCsFMG0yIKu0ax", + "metadata": { + "Type": "Custom Event - proportional points for viewing a page based on customer metadata" + } + }, + { + "id": "ern_DvdegDzcaMUXzf2fayzCqMEV", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": null, + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 2, + "property": "customer_life_time_value" + } } + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Get 2 points for every month you're a customer when your loyalty tier is prolonged.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_fpfYyNcpVskgwcrs21kQ91Wx", + "metadata": { + "Type": "Custom Event - proportional points for extending a loyalty tier based on customer metadata." } } + ] + } + } + } + } + }, + "400": { + "description": "Returns an error if a parameters is defined incorrectly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_missing_param" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Loyalty order rules must contain one of the following properties - 'total_amount'", + "request_id": "v-0c127fa5d4424c8411" } } } } - }, - "put": { - "operationId": "update-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Earning Rule", - "description": "Update an earning rule definition.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + }, + "404": { + "description": "Returns an error if a parameter's value is not found in the respository.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find loyalty_tier with id ltr_pudTGWasuIqxdiDM0go31OV1", + "request_id": "v-0c12808f33ce673c42", + "resource_id": "ltr_pudTGWasuIqxdiDM0go31OV1", + "resource_type": "loyalty_tier" + } + } } - ], - "requestBody": { - "description": "Specify the parameters that you would like to update for the given earning rule.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_earning_rule" - }, - "examples": { - "Example": { - "value": { - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "type": "FIXED", - "points": "5" - }, - "source": { - "banner": "Order paid 5 points." - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "ern_CFuv1O0IDl8Jgph0ojhMu8bH" + }, + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "A unique earning rule ID." + } + ], + "get": { + "operationId": "get-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Earning Rule", + "description": "Retrieves an earning rule assigned to a campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the earning rule details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetEarningRuleResponseBody" + }, + "examples": { + "Custom Event": { + "value": { + "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", + "created_at": "2022-02-07T08:19:41.810Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 2, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" + }, + "event": "saw_on_facebook", + "source": { + "banner": "Saw on Facebook Timeframe", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-07T08:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "object": "earning_rule", + "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" + } + }, + "Order Paid": { + "value": { + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 1000 points", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 4 + ], + "object": "earning_rule", + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + } + }, + "Segment Entered": { + "value": { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + }, + "Loyalty Tier Joined": { + "value": { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { "metadata": { - "Type": "Order paid - fixed amount of points" + "every": 4, + "points": 4, + "property": "customer_life_time_value" } } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" } } - } - } - }, - "responses": { - "200": { - "description": "Returns the updated earning rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - }, - "examples": { - "Example": { - "value": { - "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", - "created_at": "2022-11-29T11:10:46.523Z", - "updated_at": "2022-11-29T11:30:57.652Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 5 points.", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-02T13:00:00.000Z", - "expiration_date": "2023-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 0, - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", - "metadata": { - "Type": "Order paid - fixed amount of points" - } + }, + "Loyalty Tier Left": { + "value": { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" } } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" } } - } - } - } - }, - "delete": { - "operationId": "delete-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Earning Rule", - "description": "This method deletes an earning rule for a specific loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the loyalty campaign or earning rule with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Earning Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_10S9ijStRZsf65xd12aydn4f", - "request_id": "v-0ae2bdc5f11027e81a", - "resource_id": "ern_10S9ijStRZsf65xd12aydn4f", - "resource_type": "earning_rule" - } - }, - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Summer Loyalty Campaign", - "request_id": "v-0ae2be04d146b71e50", - "resource_id": "Summer Loyalty Campaign", - "resource_type": "campaign" + }, + "Loyalty Tier Upgraded": { + "value": { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" } } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + } + }, + "Loyalty Tier Downgraded": { + "value": { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" } } + }, + "Loyalty Tier Prolonged": { + "value": { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } } } } } - }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." + } + } + }, + "put": { + "operationId": "update-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Update Earning Rule", + "description": "Update an earning rule definition.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters that you would like to update for the given earning rule.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_earning_rule" }, - { - "schema": { - "type": "string", - "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" - }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "Unique earning rule ID." - } - ], - "post": { - "operationId": "enable-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Enable Earning Rule", - "description": "Enable an earning rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the `active` parameter set to `true`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesEnableEarningRulesResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T14:07:39.460Z", - "loyalty": { - "points": 20, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" - } - } - } - } + "examples": { + "Example": { + "value": { + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "type": "FIXED", + "points": "5" + }, + "source": { + "banner": "Order paid 5 points." + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "metadata": { + "Type": "Order paid - fixed amount of points" } } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the updated earning rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_obj_earning_rule_object" }, - "404": { - "description": "Returns an error if the resource cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_raVUcdXruvXGuzm682ESrAz", - "request_id": "v-0c0d849dde0e6737d9", - "resource_id": "ern_raVUcdXruvXGuzm682ESrAz", - "resource_type": "earning_rule" - } - } + "examples": { + "Example": { + "value": { + "id": "ern_63g6NQgtepfXn2z0QbT2ksLf", + "created_at": "2022-11-29T11:10:46.523Z", + "updated_at": "2022-11-29T11:30:57.652Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 5, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order paid 5 points.", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-02T13:00:00.000Z", + "expiration_date": "2023-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 0, + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_knM56LS3oygL0Ue0oeSNt4WA", + "metadata": { + "Type": "Order paid - fixed amount of points" } } } } } } + } + } + }, + "delete": { + "operationId": "delete-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Earning Rule", + "description": "This method deletes an earning rule for a specific loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { + "404": { + "description": "Returns an error indicating that the loyalty campaign or earning rule with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" - }, - "name": "earningRuleId", - "in": "path", - "required": true, - "description": "Unique earning rule ID." - } - ], - "post": { - "operationId": "disable-earning-rule", - "tags": [ - "LOYALTIES API" - ], - "summary": "Disable Earning Rule", - "description": "Disable an earning rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns an earning rule object with the `active` parameter set to `false`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesDisableEarningRulesResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T14:12:57.167Z", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": false, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - } - } - } + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Earning Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_10S9ijStRZsf65xd12aydn4f", + "request_id": "v-0ae2bdc5f11027e81a", + "resource_id": "ern_10S9ijStRZsf65xd12aydn4f", + "resource_type": "earning_rule" + } + }, + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Summer Loyalty Campaign", + "request_id": "v-0ae2be04d146b71e50", + "resource_id": "Summer Loyalty Campaign", + "resource_type": "campaign" } } - }, - "404": { - "description": "Returns an error if the resource cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find earning_rule with id ern_A2RArBE30Tkt56utVLrRv7r", - "request_id": "v-0c0d842ed5ce67373f", - "resource_id": "ern_A2RArBE30Tkt56utVLrRv7r", - "resource_type": "earning_rule" - } - } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/enable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" + }, + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "Unique earning rule ID." + } + ], + "post": { + "operationId": "enable-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Enable Earning Rule", + "description": "Enable an earning rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the `active` parameter set to `true`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesEnableEarningRulesResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T14:07:39.460Z", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" } } } @@ -71765,239 +71710,101 @@ } } }, - "/v1/loyalties/members/{memberId}/rewards": { - "parameters": [ - { + "404": { + "description": "Returns an error if the resource cannot be found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." - } - ], - "get": { - "operationId": "list-member-rewards", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Member Rewards", - "description": "Retrieves the list of rewards that the given customer (identified by `member_id`, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. \n\nYou can use the `affordable_only` parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). \n\nPlease note that rewards that are disabled (i.e. set to `Not Available` in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.", - "parameters": [ - { - "in": "query", - "name": "affordable_only", - "description": "Limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Set this flag to `true` to return rewards which the customer can actually afford.", - "schema": { - "type": "boolean" + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_raVUcdXruvXGuzm682ESrAz", + "request_id": "v-0c0d849dde0e6737d9", + "resource_id": "ern_raVUcdXruvXGuzm682ESrAz", + "resource_type": "earning_rule" + } } } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of rewards for the given `member_id`. Returns a filtered list if the query parameter `affordable_only` is set to `true`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_member_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "reward": { - "id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "name": "Material Reward", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619" - } - }, - "stock": 4, - "redeemed": 1, - "attributes": { - "description": "Get a Comic Book in Archie's series." - }, - "created_at": "2022-08-17T07:46:18.619169+00:00", - "updated_at": "2022-08-17T08:13:48.30747+00:00", - "metadata": {}, - "object": "reward" - }, - "assignment": { - "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", - "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 39 - } - }, - "created_at": "2022-08-24T11:40:22.418972+00:00", - "updated_at": "2022-08-24T13:23:50.409121+00:00", - "object": "reward_assignment" - }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", - "name": "Pay with Points", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 1, - "points_ratio": 1 - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-06-23T11:06:06.222736+00:00", - "updated_at": null, - "metadata": null, - "object": "reward" - }, - "assignment": { - "id": "rewa_wrVYAfXWolq52gnl15dumPCq", - "reward_id": "rew_31M6Za6zkMRfhxYJz4aDo11h", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", - "name": "20% discount", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", - "type": "DISCOUNT_COUPONS" - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-08-11T09:52:39.032699+00:00", - "updated_at": null, - "metadata": {}, - "object": "reward" - }, - "assignment": { - "id": "rewa_nFREw86qh1LiqGPRygahNh8Z", - "reward_id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "name": "Get a product", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b2ac1dab28985cb1e", - "sku_id": null - } - }, - "stock": 1, - "redeemed": 1, - "attributes": { - "description": "Product" - }, - "created_at": "2022-06-13T10:43:15.929621+00:00", - "updated_at": "2022-08-11T15:59:30.820937+00:00", - "metadata": null, - "object": "reward" - }, - "assignment": { - "id": "rewa_SV4gMgPXTXDrsoTyqhY1B2ut", - "reward_id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 4000 - } - }, - "created_at": "2022-08-11T14:13:34.581194+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_reward" - }, - { - "reward": { - "id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", - "name": "Get a comic book", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "sku_id": null - } - }, - "stock": 1, - "redeemed": 2, - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", - "description": "Archie's Series" - }, - "created_at": "2022-08-11T14:35:44.694611+00:00", - "updated_at": "2022-08-17T07:52:56.965366+00:00", - "metadata": { - "Type": "GR-2" - }, - "object": "reward" - }, - "assignment": { - "id": "rewa_7HHH6TjN7Q9WDr5ZePeZUg5p", - "reward_id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", - "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 - } - }, - "created_at": "2022-08-11T15:44:12.789086+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_reward" - } - ], - "total": 5 - } - } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ern_A2RArBE30Tkt56utVLrRv7rZ" + }, + "name": "earningRuleId", + "in": "path", + "required": true, + "description": "Unique earning rule ID." + } + ], + "post": { + "operationId": "disable-earning-rule", + "tags": [ + "LOYALTIES API" + ], + "summary": "Disable Earning Rule", + "description": "Disable an earning rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an earning rule object with the `active` parameter set to `false`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesDisableEarningRulesResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T14:12:57.167Z", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": false, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" } } } @@ -72005,76 +71812,121 @@ } } }, - "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { + "404": { + "description": "Returns an error if the resource cannot be found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "Unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-details", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Details", - "description": "Get reward details in the context of a loyalty campaign and reward assignment ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find earning_rule with id ern_A2RArBE30Tkt56utVLrRv7r", + "request_id": "v-0c0d842ed5ce67373f", + "resource_id": "ern_A2RArBE30Tkt56utVLrRv7r", + "resource_type": "earning_rule" + } + } } - ], - "responses": { - "200": { - "description": "Returns reward details in the context of a loyalty *campaign* and reward assignment ID.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" - }, - "examples": { - "Material": { - "value": { - "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", - "name": "Get a product", + } + } + } + } + } + }, + "/v1/loyalties/members/{memberId}/rewards": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "list-member-rewards", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Member Rewards", + "description": "Retrieves the list of rewards that the given customer (identified by `member_id`, which is a loyalty card assigned to a particular customer) **can get in exchange for loyalty points**. \n\nYou can use the `affordable_only` parameter to limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). \n\nPlease note that rewards that are disabled (i.e. set to `Not Available` in the Dashboard) for a given loyalty tier reward mapping will not be returned in this endpoint.", + "parameters": [ + { + "in": "query", + "name": "affordable_only", + "description": "Limit the results to rewards that the customer can actually afford (only rewards whose price in points is not higher than the loyalty points balance on a loyalty card). Set this flag to `true` to return rewards which the customer can actually afford.", + "schema": { + "type": "boolean" + } + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of rewards for the given `member_id`. Returns a filtered list if the query parameter `affordable_only` is set to `true`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_member_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "reward": { + "id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "name": "Material Reward", "type": "MATERIAL", "parameters": { "product": { - "id": "prod_0b2ac1dab28985cb1e", - "sku_id": null + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619" } }, - "stock": "1", - "redeemed": "1", + "stock": 4, + "redeemed": 1, "attributes": { - "description": "Product" + "description": "Get a Comic Book in Archie's series." }, - "created_at": "2022-06-13T10:43:15.929Z", - "updated_at": "2022-08-11T15:59:30.820Z", - "metadata": null, + "created_at": "2022-08-17T07:46:18.619169+00:00", + "updated_at": "2022-08-17T08:13:48.30747+00:00", + "metadata": {}, "object": "reward" - } + }, + "assignment": { + "id": "rewa_pJYQBXSitK2OVPK3XMXZK76X", + "reward_id": "rew_C7wS9eHFDN4CIbXI5PpLSkGY", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 39 + } + }, + "created_at": "2022-08-24T11:40:22.418972+00:00", + "updated_at": "2022-08-24T13:23:50.409121+00:00", + "object": "reward_assignment" + }, + "object": "loyalty_reward" }, - "Pay with Points": { - "value": { + { + "reward": { "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", "name": "Pay with Points", "type": "COIN", @@ -72087,14 +71939,24 @@ "stock": null, "redeemed": null, "attributes": {}, - "created_at": "2022-06-23T11:06:06.222Z", + "created_at": "2022-06-23T11:06:06.222736+00:00", "updated_at": null, "metadata": null, "object": "reward" - } + }, + "assignment": { + "id": "rewa_wrVYAfXWolq52gnl15dumPCq", + "reward_id": "rew_31M6Za6zkMRfhxYJz4aDo11h", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", + "created_at": "2022-08-11T14:13:34.581194+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" }, - "Discount Coupon": { - "value": { + { + "reward": { "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", "name": "20% discount", "type": "CAMPAIGN", @@ -72107,2504 +71969,2335 @@ "stock": null, "redeemed": null, "attributes": {}, - "created_at": "2022-08-11T09:52:39.032Z", + "created_at": "2022-08-11T09:52:39.032699+00:00", "updated_at": null, "metadata": {}, "object": "reward" - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/reward-assignments": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-reward-assignments-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Reward Assignments", - "description": "Returns reward assignments from a given loyalty campaign.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:list-reward-assignments-2). The URL was re-designed to be more ontextual to the type of data returned in the response.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" - }, - "in": "query", - "name": "assignmentId", - "description": "A unique reward assignment ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_2EPffrq151ArmjR7j3CumxGE", - "reward_id": "rew_6uCtsIjgcuzi4NW43mKZQWd5", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 18 - } - }, - "created_at": "2022-06-22T11:02:19.564Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_75e6oBjYfIKUDbM4Dsgg6xAU", - "reward_id": "rew_gI4GYbXMeHAJUAIiZCad5LaS", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 25 - } - }, - "created_at": "2022-06-22T11:00:49.034Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_dJ5nFBpmL8DVhmY1j4zYYOqF", - "reward_id": "rew_VSi5rNvb67bn2tqkNwVBBP7u", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-06-22T10:57:24.051Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_874iVl5bHrZFr2FSsG9ilKzF", - "reward_id": "rew_QQ73sIywuMoEj6L8K6ft2Mn7", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "created_at": "2022-06-22T10:47:55.934Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_GgSlEk4bnR09lMMts6CgR6aV", - "reward_id": "rew_URQeO2fgbjxHnulgYVguuidX", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 9 - } - }, - "created_at": "2022-06-22T10:21:53.109Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_i6VcsXr3ovJ2JCpZk9k1JOj1", - "reward_id": "rew_YNr7tRr9TPAiFEJBZBAsuKCq", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "created_at": "2022-06-22T10:18:27.684Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_YjTw2InYSVx1nA88brDASS9e", - "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 30 - } - }, - "created_at": "2022-06-22T09:58:12.133Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 10 - } - }, - "created_at": "2022-06-13T11:56:49.185Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_gb6U5byuRh12EvdiL46P4Cxy", - "reward_id": "rew_NQB7WbdQLBrFQW1DZmBNcLvH", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-06-13T11:50:23.429Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_hfyF9IGez9i3z5a3Uwlkcg7S", - "reward_id": "rew_87ItIc9P5Bky10eS7vEm7Dc7", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 20 - } - }, - "created_at": "2022-06-13T11:20:43.961Z", - "updated_at": null, - "object": "reward_assignment" - } - ], - "total": 12 - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/rewards": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - } - ], - "get": { - "operationId": "list-reward-assignments-2", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Reward Assignments", - "description": "Returns active rewards from a given loyalty campaign.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" - }, - "in": "query", - "name": "assignment_id", - "description": "A unique reward assignment ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_reward_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT", - "reward_id": "rew_pjJKIZgjIopIPZyibEAt7oPk", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "created_at": "2022-08-30T08:24:32.171Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_7gFZsNg8oiry63FtzML0N52R", - "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 3000000 - } - }, - "created_at": "2022-05-13T11:14:58.146Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_eAGhQSY4FS4T3q4zMkiarHoN", - "reward_id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", - "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 100 - } - }, - "created_at": "2022-02-28T11:56:55.241Z", - "updated_at": null, - "object": "reward_assignment" - } - ], - "total": 3 - } - } - } - } - } - } - } - }, - "post": { - "operationId": "create-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Create Reward Assignment", - "description": "Add rewards to a loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of reward assignment objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_create_reward_assignment" - }, - "examples": { - "Example": { - "value": [ - { - "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", - "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 2 - } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": null, - "object": "reward_assignment" - }, - { - "id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv", - "reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 2 - } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": null, - "object": "reward_assignment" - } - ] - } - } - } - } - }, - "409": { - "description": "Returns an error if there's a reward assignment created for the given reward.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Example": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC", - "request_id": "v-0c11a10ed2ce676da9", - "resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC", - "resource_type": "reward_assignment" - } - } - } - } - } - } - }, - "requestBody": { - "description": "Define the cost of the rewards in loyalty points.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_create_reward_assignment" - }, - "examples": { - "Example": { - "value": [ - { - "reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "parameters": { - "loyalty": { - "points": 2 - } - } }, - { - "reward": "rew_z35ffKoH0tCcck8EL56p6SIs", + "assignment": { + "id": "rewa_nFREw86qh1LiqGPRygahNh8Z", + "reward_id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "related_object_type": "campaign", "parameters": { "loyalty": { - "points": 2 + "points": 100 } - } - } - ] - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "Unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve specific reward assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns specific reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" - }, - "examples": { - "Example": { - "value": { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + }, + "created_at": "2022-08-11T14:13:34.581194+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "name": "Get a product", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b2ac1dab28985cb1e", + "sku_id": null + } + }, + "stock": 1, + "redeemed": 1, + "attributes": { + "description": "Product" + }, + "created_at": "2022-06-13T10:43:15.929621+00:00", + "updated_at": "2022-08-11T15:59:30.820937+00:00", + "metadata": null, + "object": "reward" + }, + "assignment": { + "id": "rewa_SV4gMgPXTXDrsoTyqhY1B2ut", + "reward_id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", "related_object_type": "campaign", "parameters": { "loyalty": { - "points": 10 + "points": 4000 } }, - "created_at": "2022-06-13T11:56:49.185Z", + "created_at": "2022-08-11T14:13:34.581194+00:00", "updated_at": null, "object": "reward_assignment" - } - } - } - } - } - } - } - } - }, - "/v1/loyalties/{campaignId}/rewards/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " - }, - { - "schema": { - "type": "string", - "example": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH" - }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique reward assignment ID." - } - ], - "get": { - "operationId": "get-reward-assignment-2", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Reward Assignment", - "description": "Retrieve specific reward assignment.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:get-reward-assignment-2). ", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns specific reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - }, - "examples": { - "Example": { - "value": { - "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", - "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + }, + "object": "loyalty_reward" + }, + { + "reward": { + "id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", + "name": "Get a comic book", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "sku_id": null + } + }, + "stock": 1, + "redeemed": 2, + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-11T14:35:44.694611+00:00", + "updated_at": "2022-08-17T07:52:56.965366+00:00", + "metadata": { + "Type": "GR-2" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_7HHH6TjN7Q9WDr5ZePeZUg5p", + "reward_id": "rew_oQEYtUNYcVe2IdBEUBdLfkCD", + "related_object_id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", "related_object_type": "campaign", "parameters": { "loyalty": { "points": 10 } }, - "created_at": "2022-06-13T11:56:49.185Z", + "created_at": "2022-08-11T15:44:12.789086+00:00", "updated_at": null, "object": "reward_assignment" - } - } - } - } - } - }, - "404": { - "description": "Returns an error if the reward assignment cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "request_id": "v-0c0be6ee648e67609b", - "resource_id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", - "resource_type": "reward_assignment" - } + }, + "object": "loyalty_reward" } - } + ], + "total": 5 } } } } - }, - "put": { - "operationId": "update-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Update Reward Assignment", - "description": "Updates rewards parameters, i.e. the points cost for the specific reward.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a reward assignment with an updated points value.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - }, - "examples": { - "Example": { - "value": { - "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", - "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 3 - } - }, - "created_at": "2022-11-28T18:54:19.747Z", - "updated_at": "2022-11-28T19:27:40.604Z", - "object": "reward_assignment" - } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}/reward": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "Unique reward assignment ID." + } + ], + "get": { + "operationId": "get-reward-details", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Details", + "description": "Get reward details in the context of a loyalty campaign and reward assignment ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns reward details in the context of a loyalty *campaign* and reward assignment ID.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetRewardDetailsResponseBody" + }, + "examples": { + "Material": { + "value": { + "id": "rew_Dev2yQLodRV33UKPKHTUQWk1", + "name": "Get a product", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b2ac1dab28985cb1e", + "sku_id": null } - } + }, + "stock": "1", + "redeemed": "1", + "attributes": { + "description": "Product" + }, + "created_at": "2022-06-13T10:43:15.929Z", + "updated_at": "2022-08-11T15:59:30.820Z", + "metadata": null, + "object": "reward" } - } - } - }, - "requestBody": { - "description": "Update the points cost for the reward assignment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_update_reward_assignment" - }, - "examples": { - "Example": { - "value": { - "parameters": { - "loyalty": { - "points": 3 - } - } - } - } + }, + "Pay with Points": { + "value": { + "id": "rew_31M6Za6zkMRfhxYJz4aDo11h", + "name": "Pay with Points", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 1, + "points_ratio": 1 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-06-23T11:06:06.222Z", + "updated_at": null, + "metadata": null, + "object": "reward" } - } - } - } - }, - "delete": { - "operationId": "delete-reward-assignment-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Delete Reward Assignment", - "description": "This method deletes a reward assignment for a particular loyalty campaign.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the loyalty campaign or reward assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Reward Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find reward_assignment with id rewa_0b4hqJpVFssxXXrq56Ddtyo", - "request_id": "v-0ae2b69e0cd0c1364f", - "resource_id": "rewa_0b4hqJpVFssxXXrq56Ddtyo", - "resource_type": "reward_assignment" - } - }, - "Loyalty Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id Loyalty Summer Campaign", - "request_id": "v-0ae2b71e57d027e263", - "resource_id": "Loyalty Summer Campaign", - "resource_type": "campaign" - } + }, + "Discount Coupon": { + "value": { + "id": "rew_Jhq0ecLGSx8eF4pFdlhFr9P6", + "name": "20% discount", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_4B1jDE63pCeSij3HU7gx3gPT", + "type": "DISCOUNT_COUPONS" } - } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-08-11T09:52:39.032Z", + "updated_at": null, + "metadata": {}, + "object": "reward" } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/reward-assignments": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" }, - "/v1/loyalties/{campaignId}/members/{memberId}/redemption": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID." - }, - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "list-reward-assignments-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Reward Assignments", + "description": "Returns reward assignments from a given loyalty campaign.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:list-reward-assignments-2). The URL was re-designed to be more ontextual to the type of data returned in the response.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + }, + "in": "query", + "name": "assignmentId", + "description": "A unique reward assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with reward assignment objects.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "A code that identifies the loyalty card." - } - ], - "post": { - "operationId": "redeem-reward-1", - "tags": [ - "LOYALTIES API" - ], - "summary": "Redeem Reward", - "description": "Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_redeem_reward" - }, - "examples": { - "Redeem Reward that adds points to a loyalty card": { - "value": { - "id": "r_0c6b3abbfe8e60a9dd", - "object": "redemption", - "date": "2023-02-06T09:07:55.514Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 1, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6887 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:07:55.515Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 9, - "redeemed_points": 1113, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", - "voucher": { - "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", - "code": "LOYALTY-CARD-zOR2sV9Q", - "campaign": "Loyalty Program", - "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "category": null, - "category_id": null, - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 1020, - "balance": 890 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-11T08:19:28.780Z", - "updated_at": "2023-01-25T15:44:33.500Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 26, - "redeemed_points": 130, - "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", - "object": "reward", - "name": "Present on Loyalty Card", - "created_at": "2023-01-25T15:43:40.716Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", - "balance": 20, - "type": "LOYALTY_PROGRAM" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 + "$ref": "#/components/schemas/8_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rewa_2EPffrq151ArmjR7j3CumxGE", + "reward_id": "rew_6uCtsIjgcuzi4NW43mKZQWd5", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 18 } - } + }, + "created_at": "2022-06-22T11:02:19.564Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem Reward that adds credits to a gift card": { - "value": { - "id": "r_0c6b3bedf3478a0167", - "object": "redemption", - "date": "2023-02-06T09:13:08.813Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 1, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6886 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:13:08.814Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 10, - "redeemed_points": 1114, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", - "voucher": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 59080, - "balance": 48780 - }, - "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2023-01-25T14:42:25.214Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", - "object": "reward", - "name": "Present Credits on Gift Card", - "created_at": "2023-01-25T14:41:31.858Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "balance": 4000, - "type": "GIFT_VOUCHERS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 1 + { + "id": "rewa_75e6oBjYfIKUDbM4Dsgg6xAU", + "reward_id": "rew_gI4GYbXMeHAJUAIiZCad5LaS", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 25 } - } + }, + "created_at": "2022-06-22T11:00:49.034Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem Reward that gives a discount coupon": { - "value": { - "id": "r_0c6b3ca77e0e60b534", - "object": "redemption", - "date": "2023-02-06T09:16:18.808Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6884 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:16:18.809Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 11, - "redeemed_points": 1116, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", - "voucher": { - "id": "v_a3Ba1neDwPa3rBE0HkDd0C7CbiehBulo", - "code": "HAPPY-ORDERctb", - "campaign": "$20 off the entire order", - "campaign_id": "camp_5h0wc453_4", - "category": null, - "category_id": "cat_0b688929a2476386a6", - "categories": [], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ORDER" - }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-20T00:00:00.000Z", - "expiration_date": "2022-09-30T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "7d646e7d-9b5a-40b6-a44e-6bae848e108e", - "url": "https://dl.voucherify.io/api/v1/assets/qr/7d646e7d-9b5a-40b6-a44e-6bae848e108e" - }, - "barcode": { - "id": "dfb3e48d-ce4f-4187-a114-483feb4ca88d", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/dfb3e48d-ce4f-4187-a114-483feb4ca88d" - } - }, - "is_referral_code": false, - "created_at": "2023-02-06T09:16:18.845Z", - "updated_at": null, - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "redemption": { - "quantity": null, - "redeemed_quantity": 0, - "object": "list", - "url": "/v1/vouchers/HAPPY-ORDERctb/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/HAPPY-ORDERctb/publications?page=1&limit=10" - }, - "object": "voucher" - }, - "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", - "object": "reward", - "name": "Digital Present", - "created_at": "2023-01-25T12:16:44.557Z", - "updated_at": null, - "parameters": { - "campaign": { - "id": "camp_5h0wc453_4", - "type": "DISCOUNT_COUPONS" - } - }, - "type": "CAMPAIGN" - }, - "loyalty_card": { - "points": 2 + { + "id": "rewa_dJ5nFBpmL8DVhmY1j4zYYOqF", + "reward_id": "rew_VSi5rNvb67bn2tqkNwVBBP7u", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 } - } + }, + "created_at": "2022-06-22T10:57:24.051Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem a Material reward of a SKU type": { - "value": { - "id": "r_0c6b3d1357878a0813", - "object": "redemption", - "date": "2023-02-06T09:18:09.246Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 6, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6878 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:18:09.247Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 12, - "redeemed_points": 1122, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", - "product": { - "id": "prod_5h0wc453_2", - "source_id": "jonah-nystrom-bourbon", - "name": "Johan & Nyström - Bourbon", - "price": null, - "attributes": [ - "categories", - "description", - "weight" - ], - "metadata": { - "company": "Johan & Nyström", - "showcase": true - }, - "image_url": null, - "created_at": "2021-12-01T08:00:49.418Z", - "updated_at": null, - "object": "product" - }, - "sku": { - "id": "sku_0a3efc9044dd121803", - "source_id": "jonah-nystrom-bourbon-250g", - "product_id": "prod_5h0wc453_2", - "sku": "250g", - "price": 1750, - "currency": null, - "attributes": { - "categories": "Coffee, Whole Bean", - "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", - "weight": 250 - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-01T08:00:49.427Z", - "updated_at": null, - "object": "sku" - }, - "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", - "object": "reward", - "name": "Present - SKU", - "created_at": "2023-01-25T12:10:16.060Z", - "updated_at": "2023-01-25T12:10:59.662Z", - "parameters": { - "product": { - "id": "prod_5h0wc453_2", - "sku_id": "sku_0a3efc9044dd121803" - } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 6 + { + "id": "rewa_874iVl5bHrZFr2FSsG9ilKzF", + "reward_id": "rew_QQ73sIywuMoEj6L8K6ft2Mn7", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "created_at": "2022-06-22T10:47:55.934Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_GgSlEk4bnR09lMMts6CgR6aV", + "reward_id": "rew_URQeO2fgbjxHnulgYVguuidX", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 9 } - } + }, + "created_at": "2022-06-22T10:21:53.109Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem a Material Reward of a Product Type": { - "value": { - "id": "r_0c6b3d8c35546f8673", - "object": "redemption", - "date": "2023-02-06T09:20:13.013Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 4, - "result": "SUCCESS", - "order": null, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@voucherify.io", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 6874 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:20:13.014Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 13, - "redeemed_points": 1126, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@voucherify.io", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "source_id": "97", - "name": "[Sample] Tiered Wire Basket", - "price": 11995, - "attributes": [], - "metadata": { - "source": "bigcommerce", - "bigcommerce_product_categories": [ - 21, - 23 - ] - }, - "image_url": null, - "created_at": "2022-06-03T13:36:16.084Z", - "updated_at": "2022-06-07T09:10:44.644Z", - "object": "product" - }, - "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", - "object": "reward", - "name": "Present", - "created_at": "2022-06-13T06:59:01.694Z", - "updated_at": "2023-02-03T15:04:14.102Z", - "parameters": { - "product": { - "id": "prod_0b2c2ddf35150b83bb", - "sku_id": null - } - }, - "type": "MATERIAL" - }, - "loyalty_card": { - "points": 4 + { + "id": "rewa_i6VcsXr3ovJ2JCpZk9k1JOj1", + "reward_id": "rew_YNr7tRr9TPAiFEJBZBAsuKCq", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "created_at": "2022-06-22T10:18:27.684Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_YjTw2InYSVx1nA88brDASS9e", + "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 30 } - } + }, + "created_at": "2022-06-22T09:58:12.133Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem Pay with Points Reward": { - "value": { - "id": "r_0c6b4142ecc78a21d0", - "object": "redemption", - "date": "2023-02-06T09:36:26.547Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 2300, - "result": "SUCCESS", - "order": { - "id": "ord_QBnrJlVWA2EEiZoKOptFROnp", - "source_id": null, - "created_at": "2023-02-06T09:36:26.503Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 45000, - "total_discount_amount": 45000, - "total_amount": 0, - "applied_discount_amount": 45000, - "total_applied_discount_amount": 45000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } - }, - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b4142ecc78a21d0": { - "date": "2023-02-06T09:36:26.547Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8000, - "balance": 4574 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:36:26.548Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 14, - "redeemed_points": 3426, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 2300 + { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_gb6U5byuRh12EvdiL46P4Cxy", + "reward_id": "rew_NQB7WbdQLBrFQW1DZmBNcLvH", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 100 + } + }, + "created_at": "2022-06-13T11:50:23.429Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_hfyF9IGez9i3z5a3Uwlkcg7S", + "reward_id": "rew_87ItIc9P5Bky10eS7vEm7Dc7", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 20 + } + }, + "created_at": "2022-06-13T11:20:43.961Z", + "updated_at": null, + "object": "reward_assignment" + } + ], + "total": 12 + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/rewards": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + } + ], + "get": { + "operationId": "list-reward-assignments-2", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Reward Assignments", + "description": "Returns active rewards from a given loyalty campaign.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "example": "rewa_m9hEAu10KsPcLhGXiHG85aY0" + }, + "in": "query", + "name": "assignment_id", + "description": "A unique reward assignment ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with reward assignment objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_reward_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "rewa_6VSWcXjfm5PuZlfeuZxl5JZT", + "reward_id": "rew_pjJKIZgjIopIPZyibEAt7oPk", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "created_at": "2022-08-30T08:24:32.171Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_7gFZsNg8oiry63FtzML0N52R", + "reward_id": "rew_BUfchmIo7pOR8GrZMw0vVL08", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 3000000 } - } + }, + "created_at": "2022-05-13T11:14:58.146Z", + "updated_at": null, + "object": "reward_assignment" }, - "Redeem Pay with Points Reward with a specific amount of points": { - "value": { - "id": "r_0c6b423368146fa4bb", - "object": "redemption", - "date": "2023-02-06T09:40:32.800Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 100, - "result": "SUCCESS", - "order": { - "id": "ord_1L67XS8EYDDp5A4B3k62G2tr", - "source_id": null, - "created_at": "2023-02-06T09:40:32.784Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 43000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } - }, - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b423368146fa4bb": { - "date": "2023-02-06T09:40:32.800Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 8500, - "balance": 4974 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T09:40:32.801Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 15, - "redeemed_points": 3526, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { + { + "id": "rewa_eAGhQSY4FS4T3q4zMkiarHoN", + "reward_id": "rew_nIy4gHpQHle2c3pNMwuj7G6j", + "related_object_id": "camp_7s3uXI44aKfIk5IhmeOPr6ic", + "related_object_type": "campaign", + "parameters": { + "loyalty": { "points": 100 } - } + }, + "created_at": "2022-02-28T11:56:55.241Z", + "updated_at": null, + "object": "reward_assignment" } - } + ], + "total": 3 } } + } + } + } + } + } + }, + "post": { + "operationId": "create-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Create Reward Assignment", + "description": "Add rewards to a loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of reward assignment objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_create_reward_assignment" }, - "404": { - "description": "Returns an error if the campaign was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Campaign Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find campaign with id :campaignId", - "request_id": "v-0c6b39288084e3435a", - "resource_id": ":campaignId", - "resource_type": "campaign" + "examples": { + "Example": { + "value": [ + { + "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", + "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 2 } - } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": null, + "object": "reward_assignment" + }, + { + "id": "rewa_tAFZ7cHiTwZyOg1QaWHt6yYv", + "reward_id": "rew_z35ffKoH0tCcck8EL56p6SIs", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 2 + } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": null, + "object": "reward_assignment" } + ] + } + } + } + } + }, + "409": { + "description": "Returns an error if there's a reward assignment created for the given reward.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Example": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated reward_assignment exists with id rewa_50O40FgyojhUiZAs3vDQbKiC", + "request_id": "v-0c11a10ed2ce676da9", + "resource_id": "rewa_50O40FgyojhUiZAs3vDQbKiC", + "resource_type": "reward_assignment" } } } + } + } + } + }, + "requestBody": { + "description": "Define the cost of the rewards in loyalty points.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_create_reward_assignment" }, - "requestBody": { - "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_redeem_reward" + "examples": { + "Example": { + "value": [ + { + "reward": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "parameters": { + "loyalty": { + "points": 2 + } + } }, - "examples": { - "Pay with Points": { - "value": { - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "points": 100 - }, - "order": { - "items": [ - { - "product_id": "prod_0c5d6689b39320059b", - "quantity": "1" - }, - { - "product_id": "prod_0b2c36568000039138", - "quantity": "2" - } - ] - } + { + "reward": "rew_z35ffKoH0tCcck8EL56p6SIs", + "parameters": { + "loyalty": { + "points": 2 } } } + ] + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/reward-assignments/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "Unique reward assignment ID." + } + ], + "get": { + "operationId": "get-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve specific reward assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns specific reward assignment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesGetRewardAssignmentResponseBody" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/rewards/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_0dJG7cCAjquzcxWmZ634bA0C" }, - "/v1/loyalties/members/{memberId}/redemption": { - "parameters": [ - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "The campaign ID or name of the loyalty campaign. You can either pass the campaign ID, which was assigned by Voucherify, or the `name` of the campaign as the path parameter value, e.g., `Loyalty%20Campaign`. " + }, + { + "schema": { + "type": "string", + "example": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique reward assignment ID." + } + ], + "get": { + "operationId": "get-reward-assignment-2", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Reward Assignment", + "description": "Retrieve specific reward assignment.\n\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:get-reward-assignment-2). ", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns specific reward assignment.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" + "$ref": "#/components/schemas/4_obj_reward_assignment_object" }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." + "examples": { + "Example": { + "value": { + "id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "reward_id": "rew_injbwG52POgfpSogTlQl4hA6", + "related_object_id": "camp_Vr97XXNOnFEUIMFymKK99FAA", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 10 + } + }, + "created_at": "2022-06-13T11:56:49.185Z", + "updated_at": null, + "object": "reward_assignment" + } + } + } } - ], - "post": { - "operationId": "redeem-reward", - "tags": [ - "LOYALTIES API" - ], - "summary": "Redeem Reward", - "description": "\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:redeem-reward-1). The URL was re-designed to allow you to redeem a reward without having to provide the `campaignId` as a path parameter.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + }, + "404": { + "description": "Returns an error if the reward assignment cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "request_id": "v-0c0be6ee648e67609b", + "resource_id": "rewa_1gJ6VyYQI0IcnEvhArbr9XFH", + "resource_type": "reward_assignment" + } + } } - ], - "responses": { - "200": { - "description": "Returns a redemption object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_redeem_reward" - }, - "examples": { - "Redeem Pay with Points Reward with a specific number of Points": { - "value": { - "id": "r_0c6b4bf721439bf02b", - "object": "redemption", - "date": "2023-02-06T10:23:12.517Z", - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", - "metadata": null, - "amount": 100, - "result": "SUCCESS", - "order": { - "id": "ord_71Ayjxq2gFV80v3OP3qrxh37", - "source_id": null, - "created_at": "2023-02-06T10:23:12.485Z", - "updated_at": null, - "status": "PAID", - "amount": 45000, - "discount_amount": 2000, - "total_discount_amount": 2000, - "total_amount": 43000, - "applied_discount_amount": 2000, - "total_applied_discount_amount": 2000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0c5d6689b39320059b", - "quantity": 1, - "product": { - "id": "prod_0c5d6689b39320059b", - "source_id": "prod_anJ03RZZq74z4v", - "name": "Apple iPhone 8" - } - }, - { - "object": "order_item", - "product_id": "prod_0b2c36568000039138", - "quantity": 2, - "amount": 45000, - "price": 22500, - "subtotal_amount": 45000, - "product": { - "id": "prod_0b2c36568000039138", - "source_id": "86", - "name": "[Sample] Able Brewing System", - "price": 22500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "object": "customer" - }, - "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0c6b4bf721439bf02b": { - "date": "2023-02-06T10:23:12.517Z", - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" - } - } - }, - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "related_object_type": "voucher", - "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "voucher": { - "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", - "code": "AnsvocvP", - "campaign": "Loyalty Campaign - Test Points", - "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", - "category": null, - "category_id": "cat_0bb81a481615a37b5e", - "categories": [], - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 9000, - "balance": 5374 - }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" - }, - "barcode": { - "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-11-10T06:28:59.970Z", - "updated_at": "2023-02-06T10:23:12.517Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "holder": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 16, - "redeemed_points": 3626, - "object": "list", - "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" - }, - "object": "voucher", - "applicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - }, - "inapplicable_to": { - "data": [], - "total": 0, - "data_ref": "data", - "object": "list" - } - }, - "reward": { - "customer": { - "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "name": "Bob Jones", - "email": "bob.jones@email.com", - "source_id": "36_bob", - "metadata": { - "age": 26, - "favorite_brands": [ - "Nike", - "Adidas", - "Reebok" - ], - "accepts_marketing": false, - "acquisition_channel": "Facebook" - }, - "object": "customer" - }, - "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "object": "reward", - "name": "100 = $20", - "created_at": "2022-11-10T06:28:39.582Z", - "updated_at": null, - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "type": "COIN" - }, - "loyalty_card": { - "points": 100 + } + } + } + } + }, + "put": { + "operationId": "update-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Update Reward Assignment", + "description": "Updates rewards parameters, i.e. the points cost for the specific reward.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a reward assignment with an updated points value.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/4_obj_reward_assignment_object" + }, + "examples": { + "Example": { + "value": { + "id": "rewa_Iw9VopmlLm0topBG17ZH1gp5", + "reward_id": "rew_wg2pvCr5LDhCq4uVQZ9LhuZm", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 3 + } + }, + "created_at": "2022-11-28T18:54:19.747Z", + "updated_at": "2022-11-28T19:27:40.604Z", + "object": "reward_assignment" + } + } + } + } + } + } + }, + "requestBody": { + "description": "Update the points cost for the reward assignment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_update_reward_assignment" + }, + "examples": { + "Example": { + "value": { + "parameters": { + "loyalty": { + "points": 3 + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-reward-assignment-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Delete Reward Assignment", + "description": "This method deletes a reward assignment for a particular loyalty campaign.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the loyalty campaign or reward assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Reward Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find reward_assignment with id rewa_0b4hqJpVFssxXXrq56Ddtyo", + "request_id": "v-0ae2b69e0cd0c1364f", + "resource_id": "rewa_0b4hqJpVFssxXXrq56Ddtyo", + "resource_type": "reward_assignment" + } + }, + "Loyalty Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id Loyalty Summer Campaign", + "request_id": "v-0ae2b71e57d027e263", + "resource_id": "Loyalty Summer Campaign", + "resource_type": "campaign" + } + } + } + } + } + } + } + } + }, + "/v1/loyalties/{campaignId}/members/{memberId}/redemption": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID." + }, + { + "schema": { + "type": "string" + }, + "name": "memberId", + "in": "path", + "required": true, + "description": "A code that identifies the loyalty card." + } + ], + "post": { + "operationId": "redeem-reward-1", + "tags": [ + "LOYALTIES API" + ], + "summary": "Redeem Reward", + "description": "Exchange points from a loyalty card for a specified reward. This API method returns an assigned award in the response. It means that if a requesting customer gets a coupon code with a discount for the next order, that discount code will be visible in response as part of the reward object definition.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_redeem_reward" + }, + "examples": { + "Redeem Reward that adds points to a loyalty card": { + "value": { + "id": "r_0c6b3abbfe8e60a9dd", + "object": "redemption", + "date": "2023-02-06T09:07:55.514Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 1, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6887 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:07:55.515Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 9, + "redeemed_points": 1113, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_BpytIepuSekuXXwb9qkLJfCU", + "voucher": { + "id": "v_pQZDYaH8LzoOvgh3234DqZQjGJgbPov6", + "code": "LOYALTY-CARD-zOR2sV9Q", + "campaign": "Loyalty Program", + "campaign_id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "category": null, + "category_id": null, + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 1020, + "balance": 890 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/THRRj1QegAan0r5U+wRoHuFEA6FR7TrvZm8N+8cK7niF/8uAqFdVYTU1JD0/CdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU+YrPDeT2HCB7o0Ts7h1FnbD85+0F7lwrbKmkGW6kub0mjCaRdJYS/axIAq4=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FTHRRj1QegAan0r5U%2BwRoHuFEA6FR7TrvZm8N%2B8cK7niF%2F8uAqFdVYTU1JD0%2FCdoSXlYqiGgz3PAFOGWFSJt8vkM50fcMtMNLsaudU%2BYrPDeT2HCB7o0Ts7h1FnbD85%2B0F7lwrbKmkGW6kub0mjCaRdJYS%2FaxIAq4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+yREd0zRAfZY9uwtMZsl4eDd8+LeiKGVI5OzOQRpjhtV91IuEe7/SXEW8m4F2Llg2//yieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb+kZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2ByREd0zRAfZY9uwtMZsl4eDd8%2BLeiKGVI5OzOQRpjhtV91IuEe7%2FSXEW8m4F2Llg2%2F%2FyieX2zsP3UtWasWxw8ZkHMRSIdxfxzSdSj8ap0dI5xwKW4OE1Q6Sgsb%2BkZVfCKUHbwXCcd8y5a6xTpVIg97y74Ng1Vg2PY%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-11T08:19:28.780Z", + "updated_at": "2023-01-25T15:44:33.500Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 26, + "redeemed_points": 130, + "object": "list", + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-zOR2sV9Q/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_7ZM476Q77dH5KvHk4KzoRNvF", + "object": "reward", + "name": "Present on Loyalty Card", + "created_at": "2023-01-25T15:43:40.716Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_Hpt5hPTA8kSKRWGxBGw8Y0So", + "balance": 20, + "type": "LOYALTY_PROGRAM" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 + } + } + }, + "Redeem Reward that adds credits to a gift card": { + "value": { + "id": "r_0c6b3bedf3478a0167", + "object": "redemption", + "date": "2023-02-06T09:13:08.813Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 1, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6886 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:13:08.814Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 10, + "redeemed_points": 1114, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_U554pL2BhDIDZOvZ8y9YQ9hA", + "voucher": { + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 59080, + "balance": 48780 + }, + "loyalty_card": null, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" + }, + "barcode": { + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2023-01-25T14:42:25.214Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 7, + "redeemed_amount": 10300, + "object": "list", + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_6bvM4vnaVdbPVQxYpuN37rhH", + "object": "reward", + "name": "Present Credits on Gift Card", + "created_at": "2023-01-25T14:41:31.858Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", + "balance": 4000, + "type": "GIFT_VOUCHERS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 1 + } + } + }, + "Redeem Reward that gives a discount coupon": { + "value": { + "id": "r_0c6b3ca77e0e60b534", + "object": "redemption", + "date": "2023-02-06T09:16:18.808Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6884 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:16:18.809Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 11, + "redeemed_points": 1116, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_0ZwLAHgeU9IrI2V1ofYRmW7g", + "voucher": { + "id": "v_a3Ba1neDwPa3rBE0HkDd0C7CbiehBulo", + "code": "HAPPY-ORDERctb", + "campaign": "$20 off the entire order", + "campaign_id": "camp_5h0wc453_4", + "category": null, + "category_id": "cat_0b688929a2476386a6", + "categories": [], + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ORDER" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2022-09-20T00:00:00.000Z", + "expiration_date": "2022-09-30T00:00:00.000Z", + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "7d646e7d-9b5a-40b6-a44e-6bae848e108e", + "url": "https://dl.voucherify.io/api/v1/assets/qr/7d646e7d-9b5a-40b6-a44e-6bae848e108e" + }, + "barcode": { + "id": "dfb3e48d-ce4f-4187-a114-483feb4ca88d", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/dfb3e48d-ce4f-4187-a114-483feb4ca88d" + } + }, + "is_referral_code": false, + "created_at": "2023-02-06T09:16:18.845Z", + "updated_at": null, + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "redemption": { + "quantity": null, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/HAPPY-ORDERctb/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/HAPPY-ORDERctb/publications?page=1&limit=10" + }, + "object": "voucher" + }, + "id": "rew_MF4hKh1IKYgJkPjbcFbH94Ho", + "object": "reward", + "name": "Digital Present", + "created_at": "2023-01-25T12:16:44.557Z", + "updated_at": null, + "parameters": { + "campaign": { + "id": "camp_5h0wc453_4", + "type": "DISCOUNT_COUPONS" + } + }, + "type": "CAMPAIGN" + }, + "loyalty_card": { + "points": 2 + } + } + }, + "Redeem a Material reward of a SKU type": { + "value": { + "id": "r_0c6b3d1357878a0813", + "object": "redemption", + "date": "2023-02-06T09:18:09.246Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 6, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6878 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:18:09.247Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 12, + "redeemed_points": 1122, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_gfpRNkOT0pwzF7P5tXWXOs4H", + "product": { + "id": "prod_5h0wc453_2", + "source_id": "jonah-nystrom-bourbon", + "name": "Johan & Nyström - Bourbon", + "price": null, + "attributes": [ + "categories", + "description", + "weight" + ], + "metadata": { + "company": "Johan & Nyström", + "showcase": true + }, + "image_url": null, + "created_at": "2021-12-01T08:00:49.418Z", + "updated_at": null, + "object": "product" + }, + "sku": { + "id": "sku_0a3efc9044dd121803", + "source_id": "jonah-nystrom-bourbon-250g", + "product_id": "prod_5h0wc453_2", + "sku": "250g", + "price": 1750, + "currency": null, + "attributes": { + "categories": "Coffee, Whole Bean", + "description": "Background for this blend comes from the longing for a real dark roasting of high-quality coffee beans. Although the beans are dark roasted, they keep their clear and intense aroma. This coffee has a smoky flavour with a slight hint of sweetness and loads of fruit notes. Thanks to the experience in the dark roasting of coffee, the beans still retain most of their aromas. Its aftertaste is clear and remains for a long time. This coffee is perfect for a Dripper, French Press, Moka coffee maker and the traditional espresso brewing method.", + "weight": 250 + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-01T08:00:49.427Z", + "updated_at": null, + "object": "sku" + }, + "id": "rew_SfQCsap5R8UBTVbdMTRx10x8", + "object": "reward", + "name": "Present - SKU", + "created_at": "2023-01-25T12:10:16.060Z", + "updated_at": "2023-01-25T12:10:59.662Z", + "parameters": { + "product": { + "id": "prod_5h0wc453_2", + "sku_id": "sku_0a3efc9044dd121803" + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 6 + } + } + }, + "Redeem a Material Reward of a Product Type": { + "value": { + "id": "r_0c6b3d8c35546f8673", + "object": "redemption", + "date": "2023-02-06T09:20:13.013Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 4, + "result": "SUCCESS", + "order": null, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@voucherify.io", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 6874 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:20:13.014Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 13, + "redeemed_points": 1126, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@voucherify.io", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_LRx3Y1iHFWTt217NVrknkpi5", + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "source_id": "97", + "name": "[Sample] Tiered Wire Basket", + "price": 11995, + "attributes": [], + "metadata": { + "source": "bigcommerce", + "bigcommerce_product_categories": [ + 21, + 23 + ] + }, + "image_url": null, + "created_at": "2022-06-03T13:36:16.084Z", + "updated_at": "2022-06-07T09:10:44.644Z", + "object": "product" + }, + "id": "rew_EPx1hCTpqzF0HW1z9NKckZH4", + "object": "reward", + "name": "Present", + "created_at": "2022-06-13T06:59:01.694Z", + "updated_at": "2023-02-03T15:04:14.102Z", + "parameters": { + "product": { + "id": "prod_0b2c2ddf35150b83bb", + "sku_id": null + } + }, + "type": "MATERIAL" + }, + "loyalty_card": { + "points": 4 + } + } + }, + "Redeem Pay with Points Reward": { + "value": { + "id": "r_0c6b4142ecc78a21d0", + "object": "redemption", + "date": "2023-02-06T09:36:26.547Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 2300, + "result": "SUCCESS", + "order": { + "id": "ord_QBnrJlVWA2EEiZoKOptFROnp", + "source_id": null, + "created_at": "2023-02-06T09:36:26.503Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 45000, + "total_discount_amount": 45000, + "total_amount": 0, + "applied_discount_amount": 45000, + "total_applied_discount_amount": 45000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } + }, + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 } } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b4142ecc78a21d0": { + "date": "2023-02-06T09:36:26.547Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8000, + "balance": 4574 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:36:26.548Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 14, + "redeemed_points": 3426, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 2300 } } - } - }, - "400": { - "description": "Returns an error indicating that a reward is missing.", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/e_400_missing_reward" - }, + }, + "Redeem Pay with Points Reward with a specific amount of points": { + "value": { + "id": "r_0c6b423368146fa4bb", + "object": "redemption", + "date": "2023-02-06T09:40:32.800Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 100, + "result": "SUCCESS", + "order": { + "id": "ord_1L67XS8EYDDp5A4B3k62G2tr", + "source_id": null, + "created_at": "2023-02-06T09:40:32.784Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 43000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ { - "$ref": "#/components/schemas/e_400_missing_order" + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } }, { - "$ref": "#/components/schemas/e_400_loyalty_card_points_exceeded" + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } } - ] - } - } - } - }, - "404": { - "description": "Returns an error indicating a resource was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Member Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id :memberId", - "request_id": "v-0c6b4b525d8e40cf3e", - "resource_id": ":memberId", - "resource_type": "voucher" + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b423368146fa4bb": { + "date": "2023-02-06T09:40:32.800Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" } } - } - } - } - } - }, - "requestBody": { - "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_req_redeem_reward" - }, - "examples": { - "Pay with Points": { - "value": { - "reward": { - "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", - "points": 100 + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 8500, + "balance": 4974 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" }, - "order": { - "items": [ - { - "product_id": "prod_0c5d6689b39320059b", - "quantity": "1" - }, - { - "product_id": "prod_0b2c36568000039138", - "quantity": "2" - } - ] + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T09:40:32.801Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 15, + "redeemed_points": 3526, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 100 } } } @@ -74612,314 +74305,301 @@ } } }, - "/v1/loyalties/{campaignId}/tiers": { - "parameters": [ - { + "404": { + "description": "Returns an error if the campaign was not found.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique loyalty campaign ID or name." - } - ], - "get": { - "operationId": "list-loyalty-tiers", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tiers", - "description": "Retrieve a list of loyalty tiers which were added to the loyalty program.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + "$ref": "#/components/schemas/e_404_not_found" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of loyalty tier objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "name": "Bottom", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": {}, - "created_at": "2022-11-10T12:20:52.755Z", - "updated_at": "2022-11-25T11:27:58.616Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 1 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 5 - } - }, - "rewards": { - "rewa_t88DnSdNnE0IzQX6gqH3jHGQ": { - "type": "MULTIPLY", - "multiplier": 4 - } - }, - "config": { - "points": { - "from": 1, - "to": 249 - } - }, - "points": { - "from": 1, - "to": 249 - }, - "object": "loyalty_tier" - }, - { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1", - "name": "Middle", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": {}, - "created_at": "2022-11-10T12:20:52.755Z", - "updated_at": "2022-11-25T11:27:58.579Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 2 - } - }, - "rewards": {}, - "config": { - "points": { - "from": 250, - "to": 499 - } - }, - "points": { - "from": 250, - "to": 499 - }, - "object": "loyalty_tier" - }, - { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 - } - }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 - } - }, - "config": { - "points": { - "from": 500, - "to": 1000 - } - }, - "points": { - "from": 500, - "to": 1000 - }, - "object": "loyalty_tier" - } - ], - "total": 3 - } - } - } + "examples": { + "Campaign Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find campaign with id :campaignId", + "request_id": "v-0c6b39288084e3435a", + "resource_id": ":campaignId", + "resource_type": "campaign" } } } } - }, - "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": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_redeem_reward" }, - "requestBody": { - "description": "Provide tier definitions you want to add to existing loyalty campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesCreateTiersRequestBody" + "examples": { + "Pay with Points": { + "value": { + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "points": 100 + }, + "order": { + "items": [ + { + "product_id": "prod_0c5d6689b39320059b", + "quantity": "1" + }, + { + "product_id": "prod_0b2c36568000039138", + "quantity": "2" + } + ] } } } } } + } + } + } + }, + "/v1/loyalties/members/{memberId}/redemption": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" }, - "/v1/loyalties/{campaignId}/tiers/{tierId}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique loyalty campaign ID or name." - }, - { + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "post": { + "operationId": "redeem-reward", + "tags": [ + "LOYALTIES API" + ], + "summary": "Redeem Reward", + "description": "\n> 📘 Alternative endpoint\n>\n> This endpoint is an alternative to this [endpoint](ref:redeem-reward-1). The URL was re-designed to allow you to redeem a reward without having to provide the `campaignId` as a path parameter.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a redemption object.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique loyalty tier ID." - } - ], - "get": { - "operationId": "get-loyalty-tier", - "tags": [ - "LOYALTIES API" - ], - "summary": "Get Loyalty Tier", - "description": "Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a loyalty tier object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltyTier" - }, - "examples": { - "Example": { - "value": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 - } - }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 - } - }, - "config": { - "points": { - "from": 500, - "to": 1000 - } - }, - "points": { - "from": 500, - "to": 1000 - }, - "object": "loyalty_tier" + "$ref": "#/components/schemas/8_res_redeem_reward" + }, + "examples": { + "Redeem Pay with Points Reward with a specific number of Points": { + "value": { + "id": "r_0c6b4bf721439bf02b", + "object": "redemption", + "date": "2023-02-06T10:23:12.517Z", + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "tracking_id": "track_9B0kB92+bJa8a+PegaWREw==", + "metadata": null, + "amount": 100, + "result": "SUCCESS", + "order": { + "id": "ord_71Ayjxq2gFV80v3OP3qrxh37", + "source_id": null, + "created_at": "2023-02-06T10:23:12.485Z", + "updated_at": null, + "status": "PAID", + "amount": 45000, + "discount_amount": 2000, + "total_discount_amount": 2000, + "total_amount": 43000, + "applied_discount_amount": 2000, + "total_applied_discount_amount": 2000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0c5d6689b39320059b", + "quantity": 1, + "product": { + "id": "prod_0c5d6689b39320059b", + "source_id": "prod_anJ03RZZq74z4v", + "name": "Apple iPhone 8" + } + }, + { + "object": "order_item", + "product_id": "prod_0b2c36568000039138", + "quantity": 2, + "amount": 45000, + "price": 22500, + "subtotal_amount": 45000, + "product": { + "id": "prod_0b2c36568000039138", + "source_id": "86", + "name": "[Sample] Able Brewing System", + "price": 22500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "object": "customer" + }, + "customer_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0c6b4bf721439bf02b": { + "date": "2023-02-06T10:23:12.517Z", + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "related_object_parent_id": "camp_22noMlhTADb7Fq2UL3vWu3d1" + } + } + }, + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "related_object_type": "voucher", + "related_object_id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "voucher": { + "id": "v_u3dRiZ0XHqX5Euhy5ezB5UQ5Sf85VXFP", + "code": "AnsvocvP", + "campaign": "Loyalty Campaign - Test Points", + "campaign_id": "camp_22noMlhTADb7Fq2UL3vWu3d1", + "category": null, + "category_id": "cat_0bb81a481615a37b5e", + "categories": [], + "type": "LOYALTY_CARD", + "discount": null, + "gift": null, + "loyalty_card": { + "points": 9000, + "balance": 5374 + }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, + "assets": { + "qr": { + "id": "U2FsdGVkX1/Au841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm+d2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO+qL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2FAu841M0T7UjYYRxYTzCRbNdZW6jW5YRNcV9PgblvN2MD5hdRuZfBRHEAm%2Bd2pvzc2FOVHFkuh9BQoaIq4KVyvy0FvkWtKkMLe4zO%2BqL4ocNUIbaRMSLeY6Xiz4hjxKNq918oLyGrp9w%3D%3D" + }, + "barcode": { + "id": "U2FsdGVkX1+xG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA/8H4gu04dxO/hrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY+8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BxG42zWo9nivfp6tg5jNuFCYOIFtw7iwas8kcA%2F8H4gu04dxO%2FhrbD41gFvxDhCuTSnIKwIPg9dEXzOvh8qy9VWN0UwDc6PL7lfNQuY%2B8Os7dqVsyNhoRned9pBo1uO6V4pjNu1gRTrw%3D%3D" } + }, + "is_referral_code": false, + "created_at": "2022-11-10T06:28:59.970Z", + "updated_at": "2023-02-06T10:23:12.517Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "holder": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, + "redemption": { + "quantity": null, + "redeemed_quantity": 16, + "redeemed_points": 3626, + "object": "list", + "url": "/v1/vouchers/AnsvocvP/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 1, + "url": "/v1/vouchers/AnsvocvP/publications?page=1&limit=10" + }, + "object": "voucher", + "applicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" + }, + "inapplicable_to": { + "data": [], + "total": 0, + "data_ref": "data", + "object": "list" } + }, + "reward": { + "customer": { + "id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "name": "Bob Jones", + "email": "bob.jones@email.com", + "source_id": "36_bob", + "metadata": { + "age": 26, + "favorite_brands": [ + "Nike", + "Adidas", + "Reebok" + ], + "accepts_marketing": false, + "acquisition_channel": "Facebook" + }, + "object": "customer" + }, + "assignment_id": "rewa_YAIuU7AY6LNJVlUbRxSbNgiD", + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "object": "reward", + "name": "100 = $20", + "created_at": "2022-11-10T06:28:39.582Z", + "updated_at": null, + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "type": "COIN" + }, + "loyalty_card": { + "points": 100 } } } @@ -74927,3977 +74607,4303 @@ } } }, - "/v1/loyalties/members/{memberId}/tiers": { - "parameters": [ - { + "400": { + "description": "Returns an error indicating that a reward is missing.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "MmFAzfDe" - }, - "name": "memberId", - "in": "path", - "required": true, - "description": "Unique loyalty card assigned to a particular customer." + "oneOf": [ + { + "$ref": "#/components/schemas/e_400_missing_reward" + }, + { + "$ref": "#/components/schemas/e_400_missing_order" + }, + { + "$ref": "#/components/schemas/e_400_loyalty_card_points_exceeded" + } + ] + } } - ], - "get": { - "operationId": "get-member-loyalty-tier", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Member's Loyalty Tiers", - "description": "Retrieve member tiers using the loyalty card ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + }, + "404": { + "description": "Returns an error indicating a resource was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Member Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id :memberId", + "request_id": "v-0c6b4b525d8e40cf3e", + "resource_id": ":memberId", + "resource_type": "voucher" + } + } } - ], - "responses": { - "200": { - "description": "Returns a data array containing the member's loyalty tiers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "name": "Tier 1 - Top", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "metadata": { - "has_funds": true - }, - "created_at": "2022-11-09T06:26:54.797Z", - "updated_at": "2022-11-25T11:27:58.578Z", - "earning_rules": { - "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_AdlWO2yt6b6llWsibIdiRXVE": { - "type": "MULTIPLY", - "multiplier": 5 - }, - "ern_HnRXyJHoj3E79r3KUWhgMgtD": { - "type": "MULTIPLY", - "multiplier": 3 - }, - "ern_raVUcdXruvXGuzm682ESrAzt": { - "type": "CUSTOM", - "points": 200 - } - }, - "rewards": { - "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { - "type": "CUSTOM", - "points": 300 - } - }, - "config": { - "points": { - "from": 500, - "to": 1000 - } - }, - "points": { - "from": 500, - "to": 1000 - }, - "expiration": { - "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", - "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "tier_id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "start_date": "2022-11-10", - "expiration_date": "2023-02-28", - "created_at": "2022-11-09T11:26:26.719Z", - "updated_at": "2022-11-10T08:54:47.200Z" - }, - "object": "loyalty_tier" - } - ], - "total": 1 - } + } + } + } + }, + "requestBody": { + "description": "Specify the reward to be redeemed. In case of a pay with points reward, specify the order and the number of points to be applied to the order. Please note that if you do not specify the amount of points, the application will default to applying the number of points to pay for the remainder of the order. If the limit of available points on the card is reached, then only the available points on the card will be applied to the order.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_req_redeem_reward" + }, + "examples": { + "Pay with Points": { + "value": { + "reward": { + "id": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1", + "points": 100 + }, + "order": { + "items": [ + { + "product_id": "prod_0c5d6689b39320059b", + "quantity": "1" + }, + { + "product_id": "prod_0b2c36568000039138", + "quantity": "2" } - } + ] } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique loyalty campaign ID or name." + } + ], + "get": { + "operationId": "list-loyalty-tiers", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tiers", + "description": "Retrieve a list of loyalty tiers which were added to the loyalty program.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of loyalty tier objects.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique tier ID." - } - ], - "get": { - "operationId": "list-loyalty-tier-earning-rules", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tier Earning Rules", - "description": "Retrieve available earning rules for a given tier and the calculation method for earning points.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a list of earning rules for a given tier. The object for each earning rule also contains information about how the points are calculated; this includes mapping. If a specific multiplier was used to calculate points for a given tier, then the `loyalty.points` parameter will account for this calculation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" - }, - "examples": { - "example-1": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "created_at": "2022-11-09T06:26:54.332Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 300, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_bfi69WIbztany4iX6prkKbGN", - "metadata": { - "Type": "Joined Any" - } - }, - { - "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", - "created_at": "2022-11-10T12:25:12.927Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 300, - "type": "FIXED" - }, - "segment": { - "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" - }, - "event": "customer.segment.entered", - "source": { - "banner": "New Customers", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", - "metadata": {} - }, - { - "id": "ern_raVUcdXruvXGuzm682ESrAzt", - "created_at": "2022-11-24T09:03:14.534Z", - "updated_at": "2022-11-25T09:48:26.284Z", - "validation_rule_id": "val_7SxpdhPeBngA", - "loyalty": { - "points": 20, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-11-23T00:00:00.000Z", - "expiration_date": "2022-11-30T00:00:00.000Z", - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", - "metadata": { - "Type": "Order has been paid - Fixed" - } - }, - { - "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", - "created_at": "2022-11-24T14:48:36.567Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_AMOUNT", - "order": { - "amount": { - "every": 1000, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", - "metadata": { - "Type": "Order has been paid - Proportional - 1" - } - }, - { - "id": "ern_jwtacKdEEHoc85QbouRw3CR8", - "created_at": "2022-11-24T15:17:11.539Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_TOTAL_AMOUNT", - "order": { - "total_amount": { - "every": 1100, - "points": 1 - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order has been paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", - "metadata": { - "Type": "Order has been paid - Proportional - 2" - } - }, - { - "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", - "created_at": "2022-11-24T15:20:04.392Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_METADATA", - "order": { - "metadata": { - "every": 10, - "points": 2, - "property": "number_of_store_visits" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", - "metadata": { - "Type": "Order has been paid - Proportional - 3 - Metadata" - } - }, - { - "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", - "created_at": "2022-11-24T15:23:44.514Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 1000, - "points": 3, - "object": "products_collection", - "id": "pc_75U0dHlr7u75BJodrW1AE3t6" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", - "metadata": { - "Type": "Order has been paid - Proportional - 4" - } - }, - { - "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", - "created_at": "2022-11-24T15:44:45.301Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", - "order_items": { - "subtotal_amount": { - "every": 1000, - "points": 4, - "object": "sku", - "id": "sku_0b7d7dfb090be5c619" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", - "metadata": { - "Type": "Order has been paid - Proportional - 5 - Items" - } - }, - { - "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", - "created_at": "2022-11-24T15:56:58.710Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "ORDER_ITEMS_AMOUNT", - "order_items": { - "amount": { - "every": 10000, - "points": 1, - "object": "product", - "id": "prod_0bae32322150fd0546" - } - } - }, - "event": "order.paid", - "source": { - "banner": "Order paid", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", - "metadata": {} - }, - { - "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", - "created_at": "2022-11-24T16:19:20.571Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 1, - "points": 5, - "property": "customer_life_time_value" - } - } - }, - "segment": { - "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered Segment", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", - "metadata": {} - }, - { - "id": "ern_L8dFanPxJzhw0f5voTwPurGP", - "created_at": "2022-11-24T16:27:13.917Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 3, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" - }, - "event": "page_view", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", - "metadata": { - "Type": "Fixed" - } - }, - { - "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", - "created_at": "2022-11-24T16:41:48.830Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOM_EVENT_METADATA", - "custom_event": { - "metadata": { - "every": 2, - "points": 2, - "property": "volume_number" - } - } - }, - "custom_event": { - "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "event": "user_subscribed", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", - "metadata": { - "Type": "Event" - } - }, - { - "id": "ern_afo3Ea760hAKv07JYpycnhiE", - "created_at": "2022-11-24T16:50:12.945Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 3, - "property": "customer_life_time_value" - } - } - }, - "custom_event": { - "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" - }, - "event": "cart_abandoned", - "source": { - "banner": "Custom Event", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", - "metadata": {} - }, - { - "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", - "created_at": "2022-11-24T16:51:31.595Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier joined - Any", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", - "metadata": { - "Type": "Tier joined - any - fixed" - } - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" - } - }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T09:48:26.506Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 25, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "total": 19 - } + "$ref": "#/components/schemas/LoyaltiesListTiersResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN", + "name": "Bottom", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": {}, + "created_at": "2022-11-10T12:20:52.755Z", + "updated_at": "2022-11-25T11:27:58.616Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 1 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 5 + } + }, + "rewards": { + "rewa_t88DnSdNnE0IzQX6gqH3jHGQ": { + "type": "MULTIPLY", + "multiplier": 4 + } + }, + "config": { + "points": { + "from": 1, + "to": 249 + } + }, + "points": { + "from": 1, + "to": 249 + }, + "object": "loyalty_tier" + }, + { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1", + "name": "Middle", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": {}, + "created_at": "2022-11-10T12:20:52.755Z", + "updated_at": "2022-11-25T11:27:58.579Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 2 + } + }, + "rewards": {}, + "config": { + "points": { + "from": 250, + "to": 499 + } + }, + "points": { + "from": 250, + "to": 499 + }, + "object": "loyalty_tier" + }, + { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": { + "has_funds": true + }, + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 + } + }, + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 + }, + "object": "loyalty_tier" } - } + ], + "total": 3 } } } } } - }, - "/v1/loyalties/{campaignId}/tiers/{tierId}/rewards": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "name": "campaignId", - "in": "path", - "required": true, - "description": "Unique campaign ID or name." - }, - { + } + } + }, + "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": { - "type": "string", - "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" - }, - "name": "tierId", - "in": "path", - "required": true, - "description": "Unique tier ID." - } - ], - "get": { - "operationId": "list-loyalty-tier-rewards", - "tags": [ - "LOYALTIES API" - ], - "summary": "List Loyalty Tier Rewards", - "description": "Get available rewards for a given tier.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "$ref": "#/components/schemas/LoyaltiesCreateTiersResponseBody" } - ], - "responses": { - "200": { - "description": "Returns a dictionary of loyalty tier reward objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "reward": { - "id": "rew_QuWYsBNB2G3fikffjnl0G3gH", - "name": "API - Testing", - "type": "CAMPAIGN", - "parameters": { - "campaign": { - "id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", - "balance": 500, - "type": "LOYALTY_PROGRAM" - } - }, - "stock": null, - "redeemed": null, - "created_at": "2022-08-25T09:32:04.579424+00:00", - "updated_at": "2022-08-25T09:33:46.680639+00:00", - "metadata": { - "Type": "Second campaign" - }, - "object": "reward" - }, - "assignment": { - "id": "rewa_3Z2sP0bmqcL0ggU28GvFeHU3", - "reward_id": "rew_QuWYsBNB2G3fikffjnl0G3gH", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 40 - } - }, - "created_at": "2022-11-23T22:11:58.759092+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" - }, - { - "reward": { - "id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", - "name": "Material", - "type": "MATERIAL", - "parameters": { - "product": { - "id": "prod_0b15f6b9f650c16990", - "sku_id": "sku_0b1621b319d248b79f" - } - }, - "stock": 2, - "redeemed": 1, - "attributes": { - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", - "description": "Archie's Series" - }, - "created_at": "2022-08-29T06:02:36.753873+00:00", - "updated_at": "2022-11-08T08:01:26.883166+00:00", - "metadata": { - "Type": "Material" - }, - "object": "reward" - }, - "assignment": { - "id": "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k", - "reward_id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "parameters": { - "loyalty": { - "points": 30 - } - }, - "created_at": "2022-11-23T22:11:58.759092+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" - }, - { - "reward": { - "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "name": "100 Points = $20", - "type": "COIN", - "parameters": { - "coin": { - "exchange_ratio": 20, - "points_ratio": 100 - } - }, - "stock": null, - "redeemed": null, - "attributes": {}, - "created_at": "2022-09-09T06:41:54.496035+00:00", - "updated_at": null, - "metadata": {}, - "object": "reward" - }, - "assignment": { - "id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", - "reward_id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", - "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "related_object_type": "campaign", - "created_at": "2022-11-09T11:01:21.065681+00:00", - "updated_at": null, - "object": "reward_assignment" - }, - "object": "loyalty_tier_reward" - } - ], - "total": 3 - } + } + } + } + }, + "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}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_fkZ28pe7DUAEmmabofkxHI8N" + }, + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique loyalty campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique loyalty tier ID." + } + ], + "get": { + "operationId": "get-loyalty-tier", + "tags": [ + "LOYALTIES API" + ], + "summary": "Get Loyalty Tier", + "description": "Retrieve a loyalty tier from a loyalty campaign by the loyalty tier ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a loyalty tier object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltyTier" + }, + "examples": { + "Example": { + "value": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": { + "has_funds": true + }, + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 } - } + }, + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 + }, + "object": "loyalty_tier" } } } } } + } + } + } + }, + "/v1/loyalties/members/{memberId}/tiers": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "MmFAzfDe" }, - "/v1/customer-object": { - "get": { - "operationId": "customer-object", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Customer Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - } + "name": "memberId", + "in": "path", + "required": true, + "description": "Unique loyalty card assigned to a particular customer." + } + ], + "get": { + "operationId": "get-member-loyalty-tier", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Member's Loyalty Tiers", + "description": "Retrieve member tiers using the loyalty card ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a data array containing the member's loyalty tiers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesListMemberLoyaltyTiersResponseBody" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "name": "Tier 1 - Top", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "metadata": { + "has_funds": true + }, + "created_at": "2022-11-09T06:26:54.797Z", + "updated_at": "2022-11-25T11:27:58.578Z", + "earning_rules": { + "ern_95aq3JaE5A8xzHjoJPYNRqXZ": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_AdlWO2yt6b6llWsibIdiRXVE": { + "type": "MULTIPLY", + "multiplier": 5 + }, + "ern_HnRXyJHoj3E79r3KUWhgMgtD": { + "type": "MULTIPLY", + "multiplier": 3 + }, + "ern_raVUcdXruvXGuzm682ESrAzt": { + "type": "CUSTOM", + "points": 200 + } + }, + "rewards": { + "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k": { + "type": "CUSTOM", + "points": 300 + } + }, + "config": { + "points": { + "from": 500, + "to": 1000 + } + }, + "points": { + "from": 500, + "to": 1000 + }, + "expiration": { + "customer_id": "cust_qBwHpagDOFu71Z3F22UzR80X", + "campaign_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "tier_id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", + "start_date": "2022-11-10", + "expiration_date": "2023-02-28", + "created_at": "2022-11-09T11:26:26.719Z", + "updated_at": "2022-11-10T08:54:47.200Z" + }, + "object": "loyalty_tier" + } + ], + "total": 1 } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/tiers/{tierId}/earning-rules": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" }, - "/v1/customer-activity-object": { - "get": { - "operationId": "customer-activity-object", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Customer Activity Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Activity Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_activity_object" - } + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique tier ID." + } + ], + "get": { + "operationId": "list-loyalty-tier-earning-rules", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tier Earning Rules", + "description": "Retrieve available earning rules for a given tier and the calculation method for earning points.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of earning rules for a given tier. The object for each earning rule also contains information about how the points are calculated; this includes mapping. If a specific multiplier was used to calculate points for a given tier, then the `loyalty.points` parameter will account for this calculation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoyaltiesListLoyaltyTierEarningRulesResponseBody" + }, + "examples": { + "example-1": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", + "created_at": "2022-11-09T06:26:54.332Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 300, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_bfi69WIbztany4iX6prkKbGN", + "metadata": { + "Type": "Joined Any" + } + }, + { + "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD", + "created_at": "2022-11-10T12:25:12.927Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 300, + "type": "FIXED" + }, + "segment": { + "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5" + }, + "event": "customer.segment.entered", + "source": { + "banner": "New Customers", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap", + "metadata": {} + }, + { + "id": "ern_raVUcdXruvXGuzm682ESrAzt", + "created_at": "2022-11-24T09:03:14.534Z", + "updated_at": "2022-11-25T09:48:26.284Z", + "validation_rule_id": "val_7SxpdhPeBngA", + "loyalty": { + "points": 20, + "type": "FIXED" + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-11-23T00:00:00.000Z", + "expiration_date": "2022-11-30T00:00:00.000Z", + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L", + "metadata": { + "Type": "Order has been paid - Fixed" + } + }, + { + "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR", + "created_at": "2022-11-24T14:48:36.567Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_AMOUNT", + "order": { + "amount": { + "every": 1000, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz", + "metadata": { + "Type": "Order has been paid - Proportional - 1" + } + }, + { + "id": "ern_jwtacKdEEHoc85QbouRw3CR8", + "created_at": "2022-11-24T15:17:11.539Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_TOTAL_AMOUNT", + "order": { + "total_amount": { + "every": 1100, + "points": 1 + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order has been paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK", + "metadata": { + "Type": "Order has been paid - Proportional - 2" + } + }, + { + "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ", + "created_at": "2022-11-24T15:20:04.392Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_METADATA", + "order": { + "metadata": { + "every": 10, + "points": 2, + "property": "number_of_store_visits" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z", + "metadata": { + "Type": "Order has been paid - Proportional - 3 - Metadata" + } + }, + { + "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR", + "created_at": "2022-11-24T15:23:44.514Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 1000, + "points": 3, + "object": "products_collection", + "id": "pc_75U0dHlr7u75BJodrW1AE3t6" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg", + "metadata": { + "Type": "Order has been paid - Proportional - 4" + } + }, + { + "id": "ern_4qSQVjfGEH7OmXKMzotS0juY", + "created_at": "2022-11-24T15:44:45.301Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT", + "order_items": { + "subtotal_amount": { + "every": 1000, + "points": 4, + "object": "sku", + "id": "sku_0b7d7dfb090be5c619" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW", + "metadata": { + "Type": "Order has been paid - Proportional - 5 - Items" + } + }, + { + "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP", + "created_at": "2022-11-24T15:56:58.710Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "ORDER_ITEMS_AMOUNT", + "order_items": { + "amount": { + "every": 10000, + "points": 1, + "object": "product", + "id": "prod_0bae32322150fd0546" + } + } + }, + "event": "order.paid", + "source": { + "banner": "Order paid", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e", + "metadata": {} + }, + { + "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr", + "created_at": "2022-11-24T16:19:20.571Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 1, + "points": 5, + "property": "customer_life_time_value" + } + } + }, + "segment": { + "id": "seg_OlE7DmfzMI5pHyD5VAv512r1" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered Segment", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E", + "metadata": {} + }, + { + "id": "ern_L8dFanPxJzhw0f5voTwPurGP", + "created_at": "2022-11-24T16:27:13.917Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 3, + "type": "FIXED" + }, + "custom_event": { + "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13" + }, + "event": "page_view", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b", + "metadata": { + "Type": "Fixed" + } + }, + { + "id": "ern_ngdugZ2hzg35hGASFF8nDjUO", + "created_at": "2022-11-24T16:41:48.830Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOM_EVENT_METADATA", + "custom_event": { + "metadata": { + "every": 2, + "points": 2, + "property": "volume_number" + } + } + }, + "custom_event": { + "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" + }, + "event": "user_subscribed", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh", + "metadata": { + "Type": "Event" + } + }, + { + "id": "ern_afo3Ea760hAKv07JYpycnhiE", + "created_at": "2022-11-24T16:50:12.945Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 3, + "property": "customer_life_time_value" + } + } + }, + "custom_event": { + "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma" + }, + "event": "cart_abandoned", + "source": { + "banner": "Custom Event", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP", + "metadata": {} + }, + { + "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT", + "created_at": "2022-11-24T16:51:31.595Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier joined - Any", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW", + "metadata": { + "Type": "Tier joined - any - fixed" + } + }, + { + "id": "ern_gVo6CHBduFPoh1hctASfXHLT", + "created_at": "2022-11-24T17:01:42.809Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 4, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.joined", + "loyalty_tier": { + "id": "ltr_pudTGWasuIqxdiDM0go31OV1" + }, + "source": { + "banner": "Tier joined", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", + "metadata": { + "Type": "Tier joined - customer metadata - proportional" + } + }, + { + "id": "ern_66OdCyLADv5IGFoQe18vGUwa", + "created_at": "2022-11-24T17:03:59.414Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 2, + "points": 2, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.left", + "loyalty_tier": { + "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" + }, + "source": { + "banner": "Tier left", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", + "metadata": { + "Type": "Tier left" + } + }, + { + "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", + "created_at": "2022-11-25T07:29:38.961Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "type": "PROPORTIONAL", + "calculation_type": "CUSTOMER_METADATA", + "customer": { + "metadata": { + "every": 3, + "points": 4, + "property": "customer_life_time_value" + } + } + }, + "event": "customer.loyalty.tier.upgraded", + "loyalty_tier": { + "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" + }, + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" + } + }, + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T09:48:26.506Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" + } + }, + { + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, + "validation_rule_id": null, + "loyalty": { + "points": 25, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} + } + ], + "total": 19 } } } } } + } + } + } + }, + "/v1/loyalties/{campaignId}/tiers/{tierId}/rewards": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" }, - "/v1/customers": { - "get": { - "operationId": "list-customers", - "tags": [ - "CUSTOMERS API" - ], - "summary": "List Customers", - "description": "Returns a list of customers.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "email", - "description": "Limit the customers to the ones that have this specific email address." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Limit the customers to the ones that are located in the specified city.", - "name": "city" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Filter customers by the name property.", - "name": "name" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "source_id", - "-source_id" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "starting_after", - "description": "A cursor for use in pagination. This is a date-time value that defines your place in the list based on `created_at` property from the customer object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list. \n\n| **Option** | **Format** | **Sorting** |\n|:---|:---|:---|\n| Return customers **before** a specific creation date | - set `starting_after` parameter to the breakpoint date | Sorting order is **descending**; the most recent dates first and least recent dates last. |\n| Return customers **after** a specific create or update date | - include the `order` parameter set to `created_at` or `updated_at`
                  - set `starting_after` to the breakpoint date | Sorting order is **ascending**; the least recent dates first and the most recent dates last. |\n" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with customer objects. The customers are returned sorted by creation date, with the most recent customers appearing first.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_res_list_customers" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "customers", - "customers": [ - { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "source_id": "source_123", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 5", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 1, - "total_failed": 0, - "total_succeeded": 1, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 4200 - } - }, - "orders": { - "total_amount": 1600, - "total_count": 1, - "average_amount": 1600, - "last_order_amount": 1600, - "last_order_date": "2022-08-30T10:17:39.220Z" - } - }, - "loyalty": { - "points": 2200, - "referred_customers": 0, - "campaigns": { - "Christmas Campaign": { - "points": 1000, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Summer Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 1000, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 1, - "campaigns": [ - { - "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", - "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "related_object_id": "r_0b9d4c5121d64dd01d", - "related_object_type": "redemption", - "date": "2022-08-30T10:17:41.089Z" - } - ] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-08-30T06:32:07.380Z", - "updated_at": "2022-08-30T10:17:58.049Z", - "object": "customer" - }, - { - "id": "cust_X0hU04x7FeisPnD5lctZcQkI", - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-02", - "address": { - "city": "New Yorke", - "state": "NY", - "line_1": "123 Main Ste.", - "line_2": "APT 3 BLG 4e", - "country": "United Statese", - "postal_code": "10001e" - }, - "summary": { - "redemptions": { - "total_redeemed": 4, - "total_failed": 0, - "total_succeeded": 4, - "total_rolled_back": 1, - "total_rollback_failed": 0, - "total_rollback_succeeded": 1, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 15549 - } - }, - "orders": { - "total_amount": 210000, - "total_count": 3, - "average_amount": 70000, - "last_order_amount": 70000, - "last_order_date": "2022-08-30T11:51:08.029Z" - } - }, - "loyalty": { - "points": 15399, - "referred_customers": 0, - "campaigns": { - "Christmas Campaign": { - "points": 7000, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 2299, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 25, - "referred_customers": 0 - }, - "Summer Campaign": { - "points": 75, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 6000, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 2, - "campaigns": [ - { - "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", - "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", - "related_object_id": "r_0b9d4cc4aa164dd073", - "related_object_type": "redemption", - "date": "2022-08-30T10:19:39.196Z" - }, - { - "campaign_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "related_object_id": "r_0b9d61b6484ead0324", - "related_object_type": "redemption", - "date": "2022-08-30T11:51:10.445Z" - } - ] - }, - "metadata": { - "lang": "en", - "test": false - }, - "system_metadata": {}, - "created_at": "2022-08-09T09:50:53.620Z", - "updated_at": "2022-08-30T11:51:24.327Z", - "object": "customer" + "name": "campaignId", + "in": "path", + "required": true, + "description": "Unique campaign ID or name." + }, + { + "schema": { + "type": "string", + "example": "ltr_mtWowJBBhVYnY8oXaLJ2tUnk" + }, + "name": "tierId", + "in": "path", + "required": true, + "description": "Unique tier ID." + } + ], + "get": { + "operationId": "list-loyalty-tier-rewards", + "tags": [ + "LOYALTIES API" + ], + "summary": "List Loyalty Tier Rewards", + "description": "Get available rewards for a given tier.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of loyalty tier reward objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/8_res_list_loyalty_tier_rewards" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "reward": { + "id": "rew_QuWYsBNB2G3fikffjnl0G3gH", + "name": "API - Testing", + "type": "CAMPAIGN", + "parameters": { + "campaign": { + "id": "camp_jcErmtGAOmHUAy0oUgkwKnPZ", + "balance": 500, + "type": "LOYALTY_PROGRAM" } - ], - "total": 2 - } + }, + "stock": null, + "redeemed": null, + "created_at": "2022-08-25T09:32:04.579424+00:00", + "updated_at": "2022-08-25T09:33:46.680639+00:00", + "metadata": { + "Type": "Second campaign" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_3Z2sP0bmqcL0ggU28GvFeHU3", + "reward_id": "rew_QuWYsBNB2G3fikffjnl0G3gH", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 40 + } + }, + "created_at": "2022-11-23T22:11:58.759092+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" + }, + { + "reward": { + "id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", + "name": "Material", + "type": "MATERIAL", + "parameters": { + "product": { + "id": "prod_0b15f6b9f650c16990", + "sku_id": "sku_0b1621b319d248b79f" + } + }, + "stock": 2, + "redeemed": 1, + "attributes": { + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_fPH9ohe0pZf4EiIt295sk9Ob.png", + "description": "Archie's Series" + }, + "created_at": "2022-08-29T06:02:36.753873+00:00", + "updated_at": "2022-11-08T08:01:26.883166+00:00", + "metadata": { + "Type": "Material" + }, + "object": "reward" + }, + "assignment": { + "id": "rewa_Or6gWZ5ASuGkBLjOf0IyiD4k", + "reward_id": "rew_XoDgmQ2HZX7qPM6aIEuslObo", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "parameters": { + "loyalty": { + "points": 30 + } + }, + "created_at": "2022-11-23T22:11:58.759092+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" + }, + { + "reward": { + "id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "name": "100 Points = $20", + "type": "COIN", + "parameters": { + "coin": { + "exchange_ratio": 20, + "points_ratio": 100 + } + }, + "stock": null, + "redeemed": null, + "attributes": {}, + "created_at": "2022-09-09T06:41:54.496035+00:00", + "updated_at": null, + "metadata": {}, + "object": "reward" + }, + "assignment": { + "id": "rewa_nMXB59qGTNYawMT8eP8M4oUp", + "reward_id": "rew_MVXA2kV7lZ1zC057WUaTrvNz", + "related_object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "related_object_type": "campaign", + "created_at": "2022-11-09T11:01:21.065681+00:00", + "updated_at": null, + "object": "reward_assignment" + }, + "object": "loyalty_tier_reward" } - } + ], + "total": 3 } } } } - }, - "post": { - "operationId": "create-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Create Customer", - "description": "Creates a customer object.\n\n\n\n> 📘 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/customer-object": { + "get": { + "operationId": "customer-object", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Customer Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" } - ], - "requestBody": { - "description": "Create a customer with specified parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_create_customer" - }, - "examples": { - "Example": { - "value": { + } + } + } + } + } + }, + "/v1/customer-activity-object": { + "get": { + "operationId": "customer-activity-object", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Customer Activity Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Activity Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_activity_object" + } + } + } + } + } + } + }, + "/v1/customers": { + "get": { + "operationId": "list-customers", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customers", + "description": "Returns a list of customers.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "email", + "description": "Limit the customers to the ones that have this specific email address." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Limit the customers to the ones that are located in the specified city.", + "name": "city" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Filter customers by the name property.", + "name": "name" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "source_id", + "-source_id" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after", + "description": "A cursor for use in pagination. This is a date-time value that defines your place in the list based on `created_at` property from the customer object. For instance, if you make a list request and receive 100 objects, ending with an object created at `2020-05-24T13:43:09.024Z`, your subsequent call can include `starting_after=2020-05-24T13:43:09.024Z` in order to fetch the next page of the list. \n\n| **Option** | **Format** | **Sorting** |\n|:---|:---|:---|\n| Return customers **before** a specific creation date | - set `starting_after` parameter to the breakpoint date | Sorting order is **descending**; the most recent dates first and least recent dates last. |\n| Return customers **after** a specific create or update date | - include the `order` parameter set to `created_at` or `updated_at`
                  - set `starting_after` to the breakpoint date | Sorting order is **ascending**; the least recent dates first and the most recent dates last. |\n" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with customer objects. The customers are returned sorted by creation date, with the most recent customers appearing first.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_res_list_customers" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "customers", + "customers": [ + { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", "source_id": "source_123", "name": "Bob Smith", "description": "A frequent customer", "email": "bob.smith@email.com", "phone": "+1 933 222 3333", + "birthdate": "2022-01-01", "address": { "city": "New York", - "country": "United States", + "state": "NY", "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" + "line_2": "APT 3 BLG 5", + "country": "United States", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 1, + "total_failed": 0, + "total_succeeded": 1, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 4200 + } + }, + "orders": { + "total_amount": 1600, + "total_count": 1, + "average_amount": 1600, + "last_order_amount": 1600, + "last_order_date": "2022-08-30T10:17:39.220Z" + } + }, + "loyalty": { + "points": 2200, + "referred_customers": 0, + "campaigns": { + "Christmas Campaign": { + "points": 1000, + "referred_customers": 0 + }, + "Fall Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Summer Campaign": { + "points": 50, + "referred_customers": 0 + }, + "Spring Campaign": { + "points": 1000, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 1, + "campaigns": [ + { + "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", + "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "related_object_id": "r_0b9d4c5121d64dd01d", + "related_object_type": "redemption", + "date": "2022-08-30T10:17:41.089Z" + } + ] }, "metadata": { "lang": "en", "test": true }, - "birthdate": "2022-01-01" + "system_metadata": {}, + "created_at": "2022-08-30T06:32:07.380Z", + "updated_at": "2022-08-30T10:17:58.049Z", + "object": "customer" + }, + { + "id": "cust_X0hU04x7FeisPnD5lctZcQkI", + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3333", + "birthdate": "2022-01-02", + "address": { + "city": "New Yorke", + "state": "NY", + "line_1": "123 Main Ste.", + "line_2": "APT 3 BLG 4e", + "country": "United Statese", + "postal_code": "10001e" + }, + "summary": { + "redemptions": { + "total_redeemed": 4, + "total_failed": 0, + "total_succeeded": 4, + "total_rolled_back": 1, + "total_rollback_failed": 0, + "total_rollback_succeeded": 1, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 15549 + } + }, + "orders": { + "total_amount": 210000, + "total_count": 3, + "average_amount": 70000, + "last_order_amount": 70000, + "last_order_date": "2022-08-30T11:51:08.029Z" + } + }, + "loyalty": { + "points": 15399, + "referred_customers": 0, + "campaigns": { + "Christmas Campaign": { + "points": 7000, + "referred_customers": 0 + }, + "Fall Campaign": { + "points": 2299, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 25, + "referred_customers": 0 + }, + "Summer Campaign": { + "points": 75, + "referred_customers": 0 + }, + "Spring Campaign": { + "points": 6000, + "referred_customers": 0 + } + } + }, + "referrals": { + "total": 2, + "campaigns": [ + { + "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal", + "referrer_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Zi", + "related_object_id": "r_0b9d4cc4aa164dd073", + "related_object_type": "redemption", + "date": "2022-08-30T10:19:39.196Z" + }, + { + "campaign_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "related_object_id": "r_0b9d61b6484ead0324", + "related_object_type": "redemption", + "date": "2022-08-30T11:51:10.445Z" + } + ] + }, + "metadata": { + "lang": "en", + "test": false + }, + "system_metadata": {}, + "created_at": "2022-08-09T09:50:53.620Z", + "updated_at": "2022-08-30T11:51:24.327Z", + "object": "customer" } - } + ], + "total": 2 } } } + } + } + } + } + }, + "post": { + "operationId": "create-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Create Customer", + "description": "Creates a customer object.\n\n\n\n> 📘 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the customer database, Voucherify will return a related customer object with updated fields.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Create a customer with specified parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_create_customer" }, - "responses": { - "200": { - "description": "Returns a customer object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "examples": { - "Example": { - "value": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "source_id": "source_123", - "name": "Bob Smith", - "description": "A frequent customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 0, - "total_failed": 0, - "total_succeeded": 0, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 0 - } - }, - "orders": { - "total_amount": 0, - "total_count": 0, - "average_amount": 0, - "last_order_amount": 0 - } - }, - "loyalty": { - "points": 0, - "referred_customers": 0, - "campaigns": {} - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-08-30T06:32:07.380Z", - "object": "customer" + "examples": { + "Example": { + "value": { + "source_id": "source_123", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-01-01" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a customer object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_obj_customer_object" + }, + "examples": { + "Example": { + "value": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "source_id": "source_123", + "name": "Bob Smith", + "description": "A frequent customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "birthdate": "2022-01-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "country": "United States", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 0, + "total_failed": 0, + "total_succeeded": 0, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 0 } + }, + "orders": { + "total_amount": 0, + "total_count": 0, + "average_amount": 0, + "last_order_amount": 0 } - } + }, + "loyalty": { + "points": 0, + "referred_customers": 0, + "campaigns": {} + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "lang": "en", + "test": true + }, + "system_metadata": {}, + "created_at": "2022-08-30T06:32:07.380Z", + "object": "customer" } } } } } + } + } + } + }, + "/v1/customers/{customerId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" }, - "/v1/customers/{customerId}": { - "parameters": [ - { + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or `source_id`." + } + ], + "get": { + "operationId": "get-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Get Customer", + "description": "Retrieve customer details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a customer object if a valid identifier was provided.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" + "$ref": "#/components/schemas/9_obj_customer_object" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or `source_id`." - } - ], - "get": { - "operationId": "get-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Get Customer", - "description": "Retrieve customer details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a customer object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "examples": { - "Example": { - "value": { - "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "source_id": "alice.morgan@email.com", - "name": "Alice Morgan", - "email": "alice.morgan@email.com", - "address": null, - "summary": { - "redemptions": { - "total_redeemed": 2, - "total_failed": 0, - "total_succeeded": 2, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 3303 - } - }, - "orders": { - "total_amount": 203900, - "total_count": 2, - "average_amount": 101950, - "last_order_amount": 3900, - "last_order_date": "2022-07-26T14:59:52.814Z" - } - }, - "loyalty": { - "points": 3303, - "referred_customers": 0, - "campaigns": { - "Summer Campaign": { - "points": 3303, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "system_metadata": {}, - "created_at": "2022-02-07T08:28:23.644Z", - "updated_at": "2022-07-26T14:59:59.806Z", - "assets": { - "cockpit_url": "https://www.url.com" - }, - "object": "customer" + "examples": { + "Example": { + "value": { + "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "source_id": "alice.morgan@email.com", + "name": "Alice Morgan", + "email": "alice.morgan@email.com", + "address": null, + "summary": { + "redemptions": { + "total_redeemed": 2, + "total_failed": 0, + "total_succeeded": 2, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 3303 } + }, + "orders": { + "total_amount": 203900, + "total_count": 2, + "average_amount": 101950, + "last_order_amount": 3900, + "last_order_date": "2022-07-26T14:59:52.814Z" } - } - } - } - }, - "404": { - "description": "Not Found. When requesting the ID of a customer that has been deleted or does not exist in the system, the resource will not be returned.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_sehkNIi8Uq2qQuRqSr7xn4Z", - "request_id": "v-0b4c590350857970df", - "resource_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Z", - "resource_type": "customer" + }, + "loyalty": { + "points": 3303, + "referred_customers": 0, + "campaigns": { + "Summer Campaign": { + "points": 3303, + "referred_customers": 0 } } - } + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "system_metadata": {}, + "created_at": "2022-02-07T08:28:23.644Z", + "updated_at": "2022-07-26T14:59:59.806Z", + "assets": { + "cockpit_url": "https://www.url.com" + }, + "object": "customer" } } } } - }, - "delete": { - "operationId": "delete-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Delete Customer", - "description": "This method deletes a customer.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the customer with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Customer Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_7pm0hh0yemiydeFsdYXZlr1", - "request_id": "v-0ae398fd9ac683dc84", - "resource_id": "cust_7pm0hh0yemiydeFsdYXZlr1", - "resource_type": "customer" - } - } - } + } + }, + "404": { + "description": "Not Found. When requesting the ID of a customer that has been deleted or does not exist in the system, the resource will not be returned.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_sehkNIi8Uq2qQuRqSr7xn4Z", + "request_id": "v-0b4c590350857970df", + "resource_id": "cust_sehkNIi8Uq2qQuRqSr7xn4Z", + "resource_type": "customer" } } } } - }, - "put": { - "operationId": "update-customer", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer", - "description": "Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customer" - }, - "examples": { - "Example": { - "value": { - "name": "Alice McDonald", - "email": "alice.mdconald@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-01-01", - "birthday": "2022-01-02" - } - } + } + } + } + }, + "delete": { + "operationId": "delete-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Delete Customer", + "description": "This method deletes a customer.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Customer Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_7pm0hh0yemiydeFsdYXZlr1", + "request_id": "v-0ae398fd9ac683dc84", + "resource_id": "cust_7pm0hh0yemiydeFsdYXZlr1", + "resource_type": "customer" } } } + } + } + } + } + }, + "put": { + "operationId": "update-customer", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer", + "description": "Updates the specified customer by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customer" }, - "responses": { - "200": { - "description": "Returns a customer object if updates were successful.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "examples": { - "Example": { - "value": { - "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", - "source_id": "alice@morgan.com", - "name": "Alice McDonald", - "description": "Updating customer data", - "email": "alice.mdconald@email.com", - "phone": "+1 (132) 222-2222", - "birthday": "2022-01-02", - "birthdate": "2022-01-01", - "address": { - "city": "New York", - "state": "NY", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "country": "United States", - "postal_code": "10001" - }, - "summary": { - "redemptions": { - "total_redeemed": 2, - "total_failed": 0, - "total_succeeded": 2, - "total_rolled_back": 0, - "total_rollback_failed": 0, - "total_rollback_succeeded": 0, - "gift": { - "redeemed_amount": 0, - "amount_to_go": 0 - }, - "loyalty_card": { - "redeemed_points": 0, - "points_to_go": 4428 - } - }, - "orders": { - "total_amount": 203900, - "total_count": 2, - "average_amount": 101950, - "last_order_amount": 3900, - "last_order_date": "2022-07-26T14:59:52.814Z" - } - }, - "loyalty": { - "points": 3403, - "referred_customers": 0, - "campaigns": { - "Summer Campaign": { - "points": 0, - "referred_customers": 0 - }, - "Spring Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Fall Campaign": { - "points": 50, - "referred_customers": 0 - }, - "Winter Campaign": { - "points": 3303, - "referred_customers": 0 - } - } - }, - "referrals": { - "total": 0, - "campaigns": [] - }, - "metadata": { - "lang": "en", - "test": true - }, - "system_metadata": {}, - "created_at": "2022-02-07T08:28:23.644Z", - "updated_at": "2022-08-31T09:58:30.475Z", - "object": "customer" - } - } - } - } - } - }, - "404": { - "description": "Returns an error indicating that a customer with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id alice2@morgan.com", - "request_id": "v-0b9e924dd243bf26e2", - "resource_id": "alice2@morgan.com", - "resource_type": "customer" - } - } - } - } + "examples": { + "Example": { + "value": { + "name": "Alice McDonald", + "email": "alice.mdconald@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-01-01", + "birthday": "2022-01-02" } } } } - }, - "/v1/customers/{customerId}/permanent-deletion": { - "parameters": [ - { + } + }, + "responses": { + "200": { + "description": "Returns a customer object if updates were successful.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/9_obj_customer_object" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or `source_id`." - } - ], - "post": { - "operationId": "delete-customer-permanently", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Delete Customer Permanently", - "description": "The organization user can remove consumer data permanently from the Voucherify system by using this API method. It d​eletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a permanent deletion object and status of the deletion.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_permanent_deletion_response_body" - }, - "examples": { - "Example": { - "value": { - "id": "del_7k3buMvBsJuXiLRmdh1WZvZs", - "created_at": "2022-09-02T17:50:29.302Z", - "related_object_id": "cust_XI8sPLvznzVpNI1BMIWGcUJa", - "related_object": "customer", - "status": "DONE", - "data_json": { - "events": 16, - "customer_events": 28, - "daily_events": 0, - "segments": 0, - "orders": 9, - "order_events": 5, - "customer": 1 - }, - "object": "pernament_deletion" + "examples": { + "Example": { + "value": { + "id": "cust_T849EgzNVVmn5icJ2FAkT2rO", + "source_id": "alice@morgan.com", + "name": "Alice McDonald", + "description": "Updating customer data", + "email": "alice.mdconald@email.com", + "phone": "+1 (132) 222-2222", + "birthday": "2022-01-02", + "birthdate": "2022-01-01", + "address": { + "city": "New York", + "state": "NY", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "country": "United States", + "postal_code": "10001" + }, + "summary": { + "redemptions": { + "total_redeemed": 2, + "total_failed": 0, + "total_succeeded": 2, + "total_rolled_back": 0, + "total_rollback_failed": 0, + "total_rollback_succeeded": 0, + "gift": { + "redeemed_amount": 0, + "amount_to_go": 0 + }, + "loyalty_card": { + "redeemed_points": 0, + "points_to_go": 4428 } + }, + "orders": { + "total_amount": 203900, + "total_count": 2, + "average_amount": 101950, + "last_order_amount": 3900, + "last_order_date": "2022-07-26T14:59:52.814Z" } - } - } - } - }, - "404": { - "description": "Returns an error indicating that a customer with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find customer with id cust_W8n9I8pJDXlM69j49iKJeYp", - "request_id": "v-0b4c62635a154e96f1", - "resource_id": "cust_W8n9I8pJDXlM69j49iKJeYp", - "resource_type": "customer" + }, + "loyalty": { + "points": 3403, + "referred_customers": 0, + "campaigns": { + "Summer Campaign": { + "points": 0, + "referred_customers": 0 + }, + "Spring Campaign": { + "points": 50, + "referred_customers": 0 + }, + "Fall Campaign": { + "points": 50, + "referred_customers": 0 + }, + "Winter Campaign": { + "points": 3303, + "referred_customers": 0 } } - } + }, + "referrals": { + "total": 0, + "campaigns": [] + }, + "metadata": { + "lang": "en", + "test": true + }, + "system_metadata": {}, + "created_at": "2022-02-07T08:28:23.644Z", + "updated_at": "2022-08-31T09:58:30.475Z", + "object": "customer" } } } } } }, - "/v1/customers/importCSV": { - "post": { - "operationId": "import-customers-using-csv", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Import and Update Customers using CSV", - "description": "This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas. \n\n## Request Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/customers/importCSV \\\n -F file=@/path/to/customers.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n## CSV File Format\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.\n\n\n> 📘 Standard customer fields mapping\n>\n> **No spaces allowed in field names** \n> Name, Email, Phone, Birthdate, Source_id, Address_line_1, Address_line_2, Address_Postal_Code, Address_City, Address_State, Address_Country, Description, Metadata_name_1, Metadata_name_2\n\n## Update Customers using CSV\n\nIf you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - }, - "examples": {} + "404": { + "description": "Returns an error indicating that a customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id alice2@morgan.com", + "request_id": "v-0b9e924dd243bf26e2", + "resource_id": "alice2@morgan.com", + "resource_type": "customer" + } } } - }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + } + } + } + } + } + }, + "/v1/customers/{customerId}/permanent-deletion": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or `source_id`." + } + ], + "post": { + "operationId": "delete-customer-permanently", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Delete Customer Permanently", + "description": "The organization user can remove consumer data permanently from the Voucherify system by using this API method. It d​eletes all customer data and connected resources. It makes the customer profile forgotten by Voucherify.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a permanent deletion object and status of the deletion.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_permanent_deletion_response_body" + }, + "examples": { + "Example": { + "value": { + "id": "del_7k3buMvBsJuXiLRmdh1WZvZs", + "created_at": "2022-09-02T17:50:29.302Z", + "related_object_id": "cust_XI8sPLvznzVpNI1BMIWGcUJa", + "related_object": "customer", + "status": "DONE", + "data_json": { + "events": 16, + "customer_events": 28, + "daily_events": 0, + "segments": 0, + "orders": 9, + "order_events": 5, + "customer": 1 }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + "object": "pernament_deletion" } } } } } }, - "/v1/customers/bulk/async": { - "post": { - "operationId": "update-customers-in-bulk", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customers in bulk", - "description": "Update several customers in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the customer fields that you would like to update in each customer object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_update_in_bulk_request_body" - }, - "examples": { - "Example": { - "value": [ - { - "source_id": "John.Smith@email.com", - "name": "John Smith", - "email": "john.smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "2022-04-04" - }, - { - "source_id": "Jane.Smith@email.com", - "name": "Jane Smith", - "email": "Jane.Smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthday": "2022-03-03" - }, - { - "source_id": "Sally.Smith@email.com", - "name": "Sally Smith", - "email": "Sally.Smith@email.com", - "description": "Updating customer data", - "phone": "+1 (132) 222-2222", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-02-02" - } - ] - } + "404": { + "description": "Returns an error indicating that a customer with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find customer with id cust_W8n9I8pJDXlM69j49iKJeYp", + "request_id": "v-0b4c62635a154e96f1", + "resource_id": "cust_W8n9I8pJDXlM69j49iKJeYp", + "resource_type": "customer" } } } + } + } + } + } + } + }, + "/v1/customers/importCSV": { + "post": { + "operationId": "import-customers-using-csv", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Import and Update Customers using CSV", + "description": "This API method lets you import or update customer data. To get a proper and valid response, please send a CSV file with data separated by commas. \n\n## Request Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/customers/importCSV \\\n -F file=@/path/to/customers.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n## CSV File Format\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard customer fields will be added to the metadata object.\n\n\n> 📘 Standard customer fields mapping\n>\n> **No spaces allowed in field names** \n> Name, Email, Phone, Birthdate, Source_id, Address_line_1, Address_line_2, Address_Postal_Code, Address_City, Address_State, Address_Country, Description, Metadata_name_1, Metadata_name_2\n\n## Update Customers using CSV\n\nIf you would like to update customer's data, you can do it using the CSV file with new data. However, remember to include a `source_id` in your CSV file to manage the update successfully.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - } + "examples": {} + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } - }, - "400": { - "description": "Returns an error if metadata fields are incorrect data type or a customer's source ID is missing in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + } + } + } + } + } + } + }, + "/v1/customers/bulk/async": { + "post": { + "operationId": "update-customers-in-bulk", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customers in bulk", + "description": "Update several customers in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the customer fields that you would like to update in each customer object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_update_in_bulk_request_body" + }, + "examples": { + "Example": { + "value": [ + { + "source_id": "John.Smith@email.com", + "name": "John Smith", + "email": "john.smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" }, - "examples": { - "Metadata validation failed": { - "value": { - "code": 400, - "key": "metadata_validation_failed", - "message": "Metadata validation failed", - "details": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'true')", - "request_id": "v-0afb29d91094432cea" - } - }, - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'source_id'", - "request_id": "v-0ba51a2f5ec3bf76de" - } - } - } + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "2022-04-04" + }, + { + "source_id": "Jane.Smith@email.com", + "name": "Jane Smith", + "email": "Jane.Smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthday": "2022-03-03" + }, + { + "source_id": "Sally.Smith@email.com", + "name": "Sally Smith", + "email": "Sally.Smith@email.com", + "description": "Updating customer data", + "phone": "+1 (132) 222-2222", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-02-02" } - } + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + } + } + } + }, + "400": { + "description": "Returns an error if metadata fields are incorrect data type or a customer's source ID is missing in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - "429": { - "description": "Too Many Requests", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "default": 429 - }, - "message": { - "type": "string", - "default": "Too many requests hit the API too quickly." - } - } - } + "examples": { + "Metadata validation failed": { + "value": { + "code": 400, + "key": "metadata_validation_failed", + "message": "Metadata validation failed", + "details": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'true')", + "request_id": "v-0afb29d91094432cea" + } + }, + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'source_id'", + "request_id": "v-0ba51a2f5ec3bf76de" } } } } } }, - "/v1/customers/metadata/async": { - "post": { - "operationId": "update-customers-metadata-in-bulk", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customers' Metadata in bulk", - "description": "Update several customers metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "List the `source_ids` of the customer's you would like to update along with the metadata key value pairs.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body" + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "default": 429 }, - "examples": { - "Example": { - "value": { - "source_ids": [ - "source_123", - "source_456" - ], - "metadata": { - "lang": "en", - "test": false - } - } - } + "message": { + "type": "string", + "default": "Too many requests hit the API too quickly." } } } + } + } + } + } + } + }, + "/v1/customers/metadata/async": { + "post": { + "operationId": "update-customers-metadata-in-bulk", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customers' Metadata in bulk", + "description": "Update several customers metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. \n\nIf a requested customer object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "List the `source_ids` of the customer's you would like to update along with the metadata key value pairs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customers_update_metadata_in_bulk_request_body" }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + "examples": { + "Example": { + "value": { + "source_ids": [ + "source_123", + "source_456" + ], + "metadata": { + "lang": "en", + "test": false } } + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and customers will be updated in the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "400": { - "description": "An error will be returned when submitting a request with no source IDs or missing metadata.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Not enough source IDs": { - "value": { - "code": 400, - "key": "not_enough_source_ids", - "message": "Not enough source_ids", - "details": "Specify at least 1 source_id", - "request_id": "v-0ba50abf2843bf6585" - } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'metadata'", - "request_id": "v-0ba50c720789984b5c" - } - } - } + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/customers/{customerId}/consents": { - "parameters": [ - { + "400": { + "description": "An error will be returned when submitting a request with no source IDs or missing metadata.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify unique customer identifier or source ID." - } - ], - "put": { - "operationId": "update-customers-consents", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer's consents", - "description": "Update marketing permissions for the specified customer.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customers_consents" - }, - "examples": { - "Example": { - "value": { - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, - "cnst_VCmucIvAsmDYw2PPAok6bcYy": false - } - }, - "Opt-out of all": { - "value": { - "unsubscribed": true - } - } + "examples": { + "Not enough source IDs": { + "value": { + "code": 400, + "key": "not_enough_source_ids", + "message": "Not enough source_ids", + "details": "Specify at least 1 source_id", + "request_id": "v-0ba50abf2843bf6585" + } + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'metadata'", + "request_id": "v-0ba50c720789984b5c" } } } + } + } + } + } + } + }, + "/v1/customers/{customerId}/consents": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify unique customer identifier or source ID." + } + ], + "put": { + "operationId": "update-customers-consents", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer's consents", + "description": "Update marketing permissions for the specified customer.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customers_consents" }, - "responses": { - "204": { - "description": "Returns no content if the consents were updated successfully." + "examples": { + "Example": { + "value": { + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, + "cnst_VCmucIvAsmDYw2PPAok6bcYy": false + } }, - "400": { - "description": "Returns an error if the payload is empty.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "The payload cannot be empty", - "request_id": "v-0ba675252cc3bf6b03" - } - } - } - } + "Opt-out of all": { + "value": { + "unsubscribed": true } } } } + } + }, + "responses": { + "204": { + "description": "Returns no content if the consents were updated successfully." }, - "/client/v1/customers/{customerId}/consents#": { - "parameters": [ - { + "400": { + "description": "Returns an error if the payload is empty.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer identifier or `source_id`" - } - ], - "put": { - "operationId": "update-customers-consents-client-side", - "tags": [ - "CUSTOMERS API" - ], - "summary": "Update Customer's consents (client-side)", - "description": "Update marketing permissions for the specified customer.", - "parameters": [], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_req_update_customers_consents" - }, - "examples": { - "Example": { - "value": { - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, - "cnst_VCmucIvAsmDYw2PPAok6bcYy": false - } - }, - "Opt-out of all": { - "value": { - "unsubscribed": true - } - } + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "The payload cannot be empty", + "request_id": "v-0ba675252cc3bf6b03" } } } + } + } + } + } + } + }, + "/client/v1/customers/{customerId}/consents#": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer identifier or `source_id`" + } + ], + "put": { + "operationId": "update-customers-consents-client-side", + "tags": [ + "CUSTOMERS API" + ], + "summary": "Update Customer's consents (client-side)", + "description": "Update marketing permissions for the specified customer.", + "parameters": [], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Key-value pairs where the key is the consent identifier and value is a boolean that identifies if a customer has given the consent or not. To deny all consents use \"unsubscribed\" as a consent identifier and \"true\" as its value. \n\n#### Examples\n\n\n```json\n{\n \"cnst_aIdUulAh0SCsOCaS3005y7yS\": true,\n \"cnst_aIdUulAhwewqaS31213fdsfds\": false\n}\n```\n\nOpt-out from all communication:\n\n\n```json\n{\n \"unsubscribed\": true\n}\n```", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_req_update_customers_consents" }, - "responses": { - "204": { - "description": "Returns no content if the consents were updated successfully." + "examples": { + "Example": { + "value": { + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I": true, + "cnst_VCmucIvAsmDYw2PPAok6bcYy": false + } }, - "400": { - "description": "Returns an error if the payload is empty.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example": { - "value": {} - } - } - } + "Opt-out of all": { + "value": { + "unsubscribed": true } } } } + } + }, + "responses": { + "204": { + "description": "Returns no content if the consents were updated successfully." }, - "/v1/customers/{customerId}/activities": { - "parameters": [ - { + "400": { + "description": "Returns an error if the payload is empty.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "A Voucherify customer ID or source ID of the customer who performed the activities." - } - ], - "get": { - "operationId": "list-customer-activities", - "tags": [ - "CUSTOMERS API" - ], - "summary": "List Customer Activities", - "description": "Retrieve customer activities.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/order" - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "starting_after", - "description": "A cursor for use in pagination. `starting_after` is a date-time value that defines your place in the list based on `created_at` property from the activity object. For instance, if you make a list request and receive 100 objects, ending with an object created at 2020-05-24T13:43:09.024Z, your subsequent call can include starting_after=2020-05-24T13:43:09.024Z in order to fetch the next page of the list." - }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "starting_after_id", - "description": "By applying this filter value, you will get events starting after an event with the given ID." - }, - { - "schema": { - "enum": [ - "DISCOUNT_COUPONS", - "REFERRAL_PROGRAM", - "GIFT_VOUCHERS", - "PROMOTION", - "LOYALTY_PROGRAM" - ], - "type": "string" - }, - "in": "query", - "name": "campaign_type", - "description": "Through this parameter you can control a type of campaign by which Voucherify will filter related customer's activity. API will return only records related to that given type. Allowed values: DISCOUNT_COUPONS, REFERRAL_PROGRAM, GIFT_VOUCHERS, PROMOTION, LOYALTY_PROGRAM" + "$ref": "#/components/schemas/e_error_no_translation" }, - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "campaign_id", - "description": "By applying this parameter you request only events related to specific campaign identified by its ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with customer activities.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/9_res_list_customer_activities" - } - } + "examples": { + "Example": { + "value": {} } } } } + } + } + } + }, + "/v1/customers/{customerId}/activities": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/customers/{customerId}/segments": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "cust_aSeH6JH52DPjYLC1G475Ii0N" - }, - "name": "customerId", - "in": "path", - "required": true, - "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID." - } - ], - "get": { - "operationId": "list-customer-segments", - "tags": [ - "CUSTOMERS API" + "name": "customerId", + "in": "path", + "required": true, + "description": "A Voucherify customer ID or source ID of the customer who performed the activities." + } + ], + "get": { + "operationId": "list-customer-activities", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customer Activities", + "description": "Retrieve customer activities.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/order" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after", + "description": "A cursor for use in pagination. `starting_after` is a date-time value that defines your place in the list based on `created_at` property from the activity object. For instance, if you make a list request and receive 100 objects, ending with an object created at 2020-05-24T13:43:09.024Z, your subsequent call can include starting_after=2020-05-24T13:43:09.024Z in order to fetch the next page of the list." + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "starting_after_id", + "description": "By applying this filter value, you will get events starting after an event with the given ID." + }, + { + "schema": { + "enum": [ + "DISCOUNT_COUPONS", + "REFERRAL_PROGRAM", + "GIFT_VOUCHERS", + "PROMOTION", + "LOYALTY_PROGRAM" ], - "summary": "List Customer's Segments", - "description": "Returns the list of segments IDs to which the customer belongs to. \n\nIf you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "type": "string" + }, + "in": "query", + "name": "campaign_type", + "description": "Through this parameter you can control a type of campaign by which Voucherify will filter related customer's activity. API will return only records related to that given type. Allowed values: DISCOUNT_COUPONS, REFERRAL_PROGRAM, GIFT_VOUCHERS, PROMOTION, LOYALTY_PROGRAM" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "campaign_id", + "description": "By applying this parameter you request only events related to specific campaign identified by its ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with customer activities.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/9_res_list_customer_activities" } - ], - "responses": { - "200": { - "description": "The method returns segment(s) to which the given customer belongs to.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_res_customers_customerId_segments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "seg_DNAOhUtJffvX0f57ajLMFBYR", - "name": "area code not 123", - "object": "segment" - }, - { - "id": "seg_IPIYx96l92Op0Sy5MOaImhgw", - "name": "not bob.smith@email.com", - "object": "segment" - }, - { - "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2", - "name": "Birthday After Dec 31", - "object": "segment" - }, - { - "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2", - "name": "Start with S", - "object": "segment" - }, - { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt", - "name": "Loyalty Card", - "object": "segment" - } - ], - "total": 5 - } + } + } + } + } + } + }, + "/v1/customers/{customerId}/segments": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "cust_aSeH6JH52DPjYLC1G475Ii0N" + }, + "name": "customerId", + "in": "path", + "required": true, + "description": "Unique identifier of a customer represented by an internal customer ID or customer source ID." + } + ], + "get": { + "operationId": "list-customer-segments", + "tags": [ + "CUSTOMERS API" + ], + "summary": "List Customer's Segments", + "description": "Returns the list of segments IDs to which the customer belongs to. \n\nIf you pass a `customerId` which is not stored and recognized by Voucherify as an existing customer in the system, the response will generate a list of segments that the customer would potentialy qualify for if they were to become a customer tracked in the system.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "The method returns segment(s) to which the given customer belongs to.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_res_customers_customerId_segments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "seg_DNAOhUtJffvX0f57ajLMFBYR", + "name": "area code not 123", + "object": "segment" + }, + { + "id": "seg_IPIYx96l92Op0Sy5MOaImhgw", + "name": "not bob.smith@email.com", + "object": "segment" + }, + { + "id": "seg_1wc52c5z6r1kQ81brO8j9Hk2", + "name": "Birthday After Dec 31", + "object": "segment" + }, + { + "id": "seg_ZEbbT4mq1ePpM9PzR02lcww2", + "name": "Start with S", + "object": "segment" + }, + { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt", + "name": "Loyalty Card", + "object": "segment" } - } + ], + "total": 5 } } } } } - }, - "/v1/order-object": { - "get": { - "operationId": "order-object", - "tags": [ - "ORDERS API" - ], - "summary": "Order Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Order Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object" - } - } - } + } + } + } + }, + "/v1/order-object": { + "get": { + "operationId": "order-object", + "tags": [ + "ORDERS API" + ], + "summary": "Order Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Order Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object" } } } + } + } + } + }, + "/v1/orders": { + "get": { + "operationId": "list-orders", + "tags": [ + "ORDERS API" + ], + "summary": "List Orders", + "description": "Returns a list of orders.\n\n", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "/v1/orders": { - "get": { - "operationId": "list-orders", - "tags": [ - "ORDERS API" - ], - "summary": "List Orders", - "description": "Returns a list of orders.\n\n", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with order objects. The orders are returned sorted by creation date by default, with the most recent orders appearing last, unless you specify another sequence using the order query parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_res_list_orders" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "orders", - "orders": [ - { - "id": "ord_v5vupdacgud1CwUSyKqSlHuk", - "source_id": null, - "created_at": "2022-09-09T07:44:41.594Z", - "updated_at": "2022-09-09T07:44:42.331Z", - "status": "PAID", - "amount": 2700, - "discount_amount": 1243, - "items_discount_amount": 270, - "total_discount_amount": 1513, - "total_amount": 1187, - "items": [ - { - "object": "order_item", - "source_id": "prod_5h1pp1ng", - "related_object": "product", - "quantity": 1, - "amount": 700, - "discount_amount": 70, - "price": 700, - "subtotal_amount": 630, - "product": { - "name": "Shipping" - } - }, - { - "object": "order_item", - "source_id": "roses_1", - "related_object": "product", - "quantity": 1, - "amount": 500, - "discount_amount": 50, - "price": 500, - "subtotal_amount": 450, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 500 - } - }, - { - "object": "order_item", - "source_id": "vase_1", - "related_object": "product", - "quantity": 1, - "amount": 1500, - "discount_amount": 150, - "price": 1500, - "subtotal_amount": 1350, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0baa093537528ef645": { - "date": "2022-09-09T07:44:41.695Z", - "related_object_type": "redemption", - "related_object_id": "r_0baa093537528ef645", - "stacked": [ - "r_0baa093537528ef646", - "r_0baa093537528ef647", - "r_0baa093537528ef648" - ] - } - } - }, - { - "id": "ord_3JkWC6jG0JgyRf5lO3r4IyU1", - "source_id": null, - "created_at": "2022-09-09T07:04:22.597Z", - "updated_at": "2022-09-09T07:04:23.743Z", - "status": "PAID", - "amount": 73100, - "items_discount_amount": 7310, - "total_discount_amount": 7310, - "total_amount": 65790, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "discount_amount": 7000, - "price": 70000, - "subtotal_amount": 63000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "discount_amount": 160, - "price": 1600, - "subtotal_amount": 1440, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 1, - "amount": 1500, - "discount_amount": 150, - "price": 1500, - "subtotal_amount": 1350, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fffae90e1b2495": { - "date": "2022-09-09T07:04:22.692Z", - "related_object_type": "voucher", - "related_object_id": "v_24rljiUfdLNC9poBf0BPNmoh2txzFkLs" - } - } - }, - { - "id": "ord_HwdbziIPvUZJkIC7z74FKmPv", - "source_id": null, - "created_at": "2022-09-09T06:47:14.195Z", - "updated_at": "2022-09-09T06:47:15.369Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 7160, - "total_discount_amount": 7160, - "total_amount": 64440, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fc0eb00e1b2230": { - "date": "2022-09-09T06:47:14.369Z", - "related_object_type": "voucher", - "related_object_id": "v_3vEprqa6tbzfhFtpjr4mDlkNchXepW7s" - } - } - }, - { - "id": "ord_HRluwFS2seoILUkXxWML0D7Z", - "source_id": null, - "created_at": "2022-09-09T06:44:27.383Z", - "updated_at": "2022-09-09T06:44:28.252Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 100, - "total_discount_amount": 100, - "total_amount": 71500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order", - "redemptions": { - "r_0ba9fb6bb7928ed9ec": { - "date": "2022-09-09T06:44:27.486Z", - "related_object_type": "voucher", - "related_object_id": "v_vhHuiEmZSchWHtE0xKm0HM7PFCR9cNkA", - "related_object_parent_id": "camp_rRsfatlwN7unSeUIJDCYedal" - } - } - }, - { - "id": "ord_Qg5utCohAZ3tafYvc1O4C80r", - "source_id": null, - "created_at": "2022-09-09T06:42:34.083Z", - "updated_at": "2022-09-09T06:42:35.169Z", - "status": "PAID", - "amount": 70000, - "discount_amount": 4000, - "total_discount_amount": 4000, - "total_amount": 66000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fafd11d28ed999": { - "date": "2022-09-09T06:42:34.183Z", - "related_object_type": "voucher", - "related_object_id": "v_RaMaTT7F0Q47BetdGcFxsyqwo1aZGzJs", - "related_object_parent_id": "camp_hg7ajfHh6DcE1xa18mw3SdF6" - } - } + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with order objects. The orders are returned sorted by creation date by default, with the most recent orders appearing last, unless you specify another sequence using the order query parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_res_list_orders" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "orders", + "orders": [ + { + "id": "ord_v5vupdacgud1CwUSyKqSlHuk", + "source_id": null, + "created_at": "2022-09-09T07:44:41.594Z", + "updated_at": "2022-09-09T07:44:42.331Z", + "status": "PAID", + "amount": 2700, + "discount_amount": 1243, + "items_discount_amount": 270, + "total_discount_amount": 1513, + "total_amount": 1187, + "items": [ + { + "object": "order_item", + "source_id": "prod_5h1pp1ng", + "related_object": "product", + "quantity": 1, + "amount": 700, + "discount_amount": 70, + "price": 700, + "subtotal_amount": 630, + "product": { + "name": "Shipping" + } + }, + { + "object": "order_item", + "source_id": "roses_1", + "related_object": "product", + "quantity": 1, + "amount": 500, + "discount_amount": 50, + "price": 500, + "subtotal_amount": 450, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 500 + } + }, + { + "object": "order_item", + "source_id": "vase_1", + "related_object": "product", + "quantity": 1, + "amount": 1500, + "discount_amount": 150, + "price": 1500, + "subtotal_amount": 1350, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0baa093537528ef645": { + "date": "2022-09-09T07:44:41.695Z", + "related_object_type": "redemption", + "related_object_id": "r_0baa093537528ef645", + "stacked": [ + "r_0baa093537528ef646", + "r_0baa093537528ef647", + "r_0baa093537528ef648" + ] + } + } + }, + { + "id": "ord_3JkWC6jG0JgyRf5lO3r4IyU1", + "source_id": null, + "created_at": "2022-09-09T07:04:22.597Z", + "updated_at": "2022-09-09T07:04:23.743Z", + "status": "PAID", + "amount": 73100, + "items_discount_amount": 7310, + "total_discount_amount": 7310, + "total_amount": 65790, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "discount_amount": 7000, + "price": 70000, + "subtotal_amount": 63000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "discount_amount": 160, + "price": 1600, + "subtotal_amount": 1440, + "product": { + "name": "Comic Books1", + "price": 1600 }, - { - "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", - "source_id": null, - "created_at": "2022-09-09T06:38:17.984Z", - "updated_at": "2022-09-09T06:38:19.064Z", - "status": "PAID", - "amount": 4600, - "items_discount_amount": 300, - "total_discount_amount": 300, - "total_amount": 4300, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0a65b3ff8592d7a5b5", - "quantity": 1, - "amount": 3000, - "discount_amount": 300, - "price": 3000, - "subtotal_amount": 2700, - "product": { - "name": "Koffee Cup", - "price": 3000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "object": "customer" - }, - "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9fa02fcd28ed8f1": { - "date": "2022-09-09T06:38:18.099Z", - "related_object_type": "voucher", - "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", - "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" - } - } + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 1, + "amount": 1500, + "discount_amount": 150, + "price": 1500, + "subtotal_amount": 1350, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fffae90e1b2495": { + "date": "2022-09-09T07:04:22.692Z", + "related_object_type": "voucher", + "related_object_id": "v_24rljiUfdLNC9poBf0BPNmoh2txzFkLs" + } + } + }, + { + "id": "ord_HwdbziIPvUZJkIC7z74FKmPv", + "source_id": null, + "created_at": "2022-09-09T06:47:14.195Z", + "updated_at": "2022-09-09T06:47:15.369Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 7160, + "total_discount_amount": 7160, + "total_amount": 64440, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 }, - { - "id": "ord_N3YBowDTZs0UH2hHoMZLbUDN", - "source_id": null, - "created_at": "2022-09-09T06:18:31.459Z", - "updated_at": "2022-09-09T06:18:31.624Z", - "status": "PAID", - "amount": 71600, - "discount_amount": 7160, - "total_discount_amount": 7160, - "total_amount": 64440, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 1, - "amount": 1600, - "price": 1600, - "subtotal_amount": 1600, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba9f57c37128ed639": { - "date": "2022-09-09T06:18:31.516Z", - "related_object_type": "promotion_tier", - "related_object_id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", - "related_object_parent_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0" - } - } + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fc0eb00e1b2230": { + "date": "2022-09-09T06:47:14.369Z", + "related_object_type": "voucher", + "related_object_id": "v_3vEprqa6tbzfhFtpjr4mDlkNchXepW7s" + } + } + }, + { + "id": "ord_HRluwFS2seoILUkXxWML0D7Z", + "source_id": null, + "created_at": "2022-09-09T06:44:27.383Z", + "updated_at": "2022-09-09T06:44:28.252Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 100, + "total_discount_amount": 100, + "total_amount": 71500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 }, - { - "id": "ord_3R6vsxRZRkND8rpe0rAn9Agc", - "source_id": null, - "created_at": "2022-09-05T08:13:13.720Z", - "updated_at": "2022-09-05T08:13:14.498Z", - "status": "PAID", - "amount": 74000, - "items_discount_amount": 1500, - "total_discount_amount": 1500, - "total_amount": 72500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 1, - "amount": 70000, - "price": 70000, - "subtotal_amount": 70000, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 2, - "amount": 3000, - "discount_amount": 500, - "price": 1500, - "subtotal_amount": 2500, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b00ffed198e344", - "quantity": 2, - "amount": 1000, - "discount_amount": 1000, - "price": 500, - "subtotal_amount": 0, - "product": { - "name": "Bouquet - Romantic Roses", - "price": 500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" - }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba4e961444579711a": { - "date": "2022-09-05T08:13:13.873Z", - "related_object_type": "voucher", - "related_object_id": "v_hwySVBBk6YmMD4GzZHJzke1Fxo3QO7kP", - "related_object_parent_id": "camp_Uji5a53s5wRSUHqznncTkhHh" - } - } + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order", + "redemptions": { + "r_0ba9fb6bb7928ed9ec": { + "date": "2022-09-09T06:44:27.486Z", + "related_object_type": "voucher", + "related_object_id": "v_vhHuiEmZSchWHtE0xKm0HM7PFCR9cNkA", + "related_object_parent_id": "camp_rRsfatlwN7unSeUIJDCYedal" + } + } + }, + { + "id": "ord_Qg5utCohAZ3tafYvc1O4C80r", + "source_id": null, + "created_at": "2022-09-09T06:42:34.083Z", + "updated_at": "2022-09-09T06:42:35.169Z", + "status": "PAID", + "amount": 70000, + "discount_amount": 4000, + "total_discount_amount": 4000, + "total_amount": 66000, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fafd11d28ed999": { + "date": "2022-09-09T06:42:34.183Z", + "related_object_type": "voucher", + "related_object_id": "v_RaMaTT7F0Q47BetdGcFxsyqwo1aZGzJs", + "related_object_parent_id": "camp_hg7ajfHh6DcE1xa18mw3SdF6" + } + } + }, + { + "id": "ord_G9LBb5SOPa36pHdwxUvzkw4P", + "source_id": null, + "created_at": "2022-09-09T06:38:17.984Z", + "updated_at": "2022-09-09T06:38:19.064Z", + "status": "PAID", + "amount": 4600, + "items_discount_amount": 300, + "total_discount_amount": 300, + "total_amount": 4300, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 }, - { - "id": "ord_7bqlkoHyEJCQuxVZpKfZYNeA", - "source_id": null, - "created_at": "2022-09-02T17:12:13.213Z", - "updated_at": "2022-09-02T17:12:13.969Z", - "status": "PAID", - "amount": 292400, - "items_discount_amount": 900, - "total_discount_amount": 900, - "total_amount": 291500, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 4, - "amount": 6400, - "price": 1600, - "subtotal_amount": 6400, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 4, - "amount": 6000, - "price": 1500, - "subtotal_amount": 6000, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 4, - "amount": 280000, - "discount_amount": 900, - "price": 70000, - "subtotal_amount": 279100, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" - }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba187f9bb45792c13": { - "date": "2022-09-02T17:12:13.293Z", - "related_object_type": "voucher", - "related_object_id": "v_pg6DhwhmeZASoSoJ15PdzMT9MhsPjYuc", - "related_object_parent_id": "camp_W8DJVd8J0btqXT6FBwn7BSkC" - } - } + "sku": { + "sku": "Comics1", + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0a65b3ff8592d7a5b5", + "quantity": 1, + "amount": 3000, + "discount_amount": 300, + "price": 3000, + "subtotal_amount": 2700, + "product": { + "name": "Koffee Cup", + "price": 3000 + } + } + ], + "metadata": {}, + "customer": { + "id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "object": "customer" + }, + "customer_id": "cust_tAED42tFhLM9v7GmZUaklJFd", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9fa02fcd28ed8f1": { + "date": "2022-09-09T06:38:18.099Z", + "related_object_type": "voucher", + "related_object_id": "v_KqP2NOSb4dJb1D6UBhcq7ScPZXun0y40", + "related_object_parent_id": "camp_hC2GdqYtOmTT45zfhib62cK1" + } + } + }, + { + "id": "ord_N3YBowDTZs0UH2hHoMZLbUDN", + "source_id": null, + "created_at": "2022-09-09T06:18:31.459Z", + "updated_at": "2022-09-09T06:18:31.624Z", + "status": "PAID", + "amount": 71600, + "discount_amount": 7160, + "total_discount_amount": 7160, + "total_amount": 64440, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 1, + "amount": 1600, + "price": 1600, + "subtotal_amount": 1600, + "product": { + "name": "Comic Books1", + "price": 1600 }, - { - "id": "ord_7HwbJiHmS07O7FsVAtjJcuRS", - "source_id": null, - "created_at": "2022-09-02T17:08:37.794Z", - "updated_at": "2022-09-02T17:08:38.879Z", - "status": "PAID", - "amount": 223900, - "items_discount_amount": 900, - "total_discount_amount": 900, - "total_amount": 223000, - "items": [ - { - "object": "order_item", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku_id": "sku_0b7d7dfb090be5c619", - "quantity": 4, - "amount": 6400, - "discount_amount": 300, - "price": 1600, - "subtotal_amount": 6100, - "product": { - "name": "Comic Books1", - "price": 1600 - }, - "sku": { - "sku": "Comics1", - "price": 1600 - } - }, - { - "object": "order_item", - "product_id": "prod_0b7d7c4e814be5c502", - "quantity": 3, - "amount": 210000, - "discount_amount": 300, - "price": 70000, - "subtotal_amount": 209700, - "product": { - "name": "Apple iPhone 12", - "price": 70000 - } - }, - { - "object": "order_item", - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 5, - "amount": 7500, - "discount_amount": 300, - "price": 1500, - "subtotal_amount": 7200, - "product": { - "name": "Vase - Boho Vintage", - "price": 1500 - } - } - ], - "metadata": {}, - "customer": { - "id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "object": "customer" - }, - "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", - "referrer_id": null, - "object": "order", - "redemptions": { - "r_0ba1872762c5792b73": { - "date": "2022-09-02T17:08:37.899Z", - "related_object_type": "voucher", - "related_object_id": "v_yQydppWWJpSUuGNEWJ4I2upFGY2Ma4IY", - "related_object_parent_id": "camp_A5L21BD4cJii28882owYBqTV" - } - } + "sku": { + "sku": "Comics1", + "price": 1600 } - ], - "total": 441 + } + ], + "metadata": {}, + "customer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba9f57c37128ed639": { + "date": "2022-09-09T06:18:31.516Z", + "related_object_type": "promotion_tier", + "related_object_id": "promo_CQonGnrsFAdEJfJQ3oKB3a8G", + "related_object_parent_id": "camp_SGq39XXJ47vm7Xys3D0NLgQ0" + } } - } - } - } - } - } - } - }, - "post": { - "operationId": "create-order", - "tags": [ - "ORDERS API" - ], - "summary": "Create Order", - "description": "Creates an order object and triggers an order creation event. ", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the order parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_create_order" - }, - "examples": { - "Example": { - "value": { - "amount": 20000, + }, + { + "id": "ord_3R6vsxRZRkND8rpe0rAn9Agc", + "source_id": null, + "created_at": "2022-09-05T08:13:13.720Z", + "updated_at": "2022-09-05T08:13:14.498Z", + "status": "PAID", + "amount": 74000, + "items_discount_amount": 1500, + "total_discount_amount": 1500, + "total_amount": 72500, + "items": [ + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 1, + "amount": 70000, + "price": 70000, + "subtotal_amount": 70000, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 2, + "amount": 3000, + "discount_amount": 500, + "price": 1500, + "subtotal_amount": 2500, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b00ffed198e344", + "quantity": 2, + "amount": 1000, + "discount_amount": 1000, + "price": 500, + "subtotal_amount": 0, + "product": { + "name": "Bouquet - Romantic Roses", + "price": 500 + } + } + ], + "metadata": {}, "customer": { - "source_id": "sample_customer" + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba4e961444579711a": { + "date": "2022-09-05T08:13:13.873Z", + "related_object_type": "voucher", + "related_object_id": "v_hwySVBBk6YmMD4GzZHJzke1Fxo3QO7kP", + "related_object_parent_id": "camp_Uji5a53s5wRSUHqznncTkhHh" + } + } + }, + { + "id": "ord_7bqlkoHyEJCQuxVZpKfZYNeA", + "source_id": null, + "created_at": "2022-09-02T17:12:13.213Z", + "updated_at": "2022-09-02T17:12:13.969Z", "status": "PAID", + "amount": 292400, + "items_discount_amount": 900, + "total_discount_amount": 900, + "total_amount": 291500, "items": [ { - "quantity": 1, - "price": 20000, - "source_id": "sample product1", - "related_object": "product", + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 4, + "amount": 6400, + "price": 1600, + "subtotal_amount": 6400, "product": { - "metadata": { - "key": "value" - } + "name": "Comic Books1", + "price": 1600 + }, + "sku": { + "sku": "Comics1", + "price": 1600 } - } - ] - } - }, - "Example 2": { - "value": { - "source_id": "new", - "status": "FULFILLED", - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "source_id": "bob.smith.1@email.com", - "name": "Bob Smith", - "description": "A nice customer", - "email": "bob.smith.1@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United Statese", - "line_1": "123 Main St", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": false - }, - "birthdate": "2022-01-02" - }, - "referrer": { - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A really nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3334", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" }, - "metadata": { - "lang": "en", - "test": false + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 4, + "amount": 6000, + "price": 1500, + "subtotal_amount": 6000, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 + } }, - "birthday": "2022-03-03" - }, - "items": [ { - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 4, + "amount": 280000, + "discount_amount": 900, + "price": 70000, + "subtotal_amount": 279100, "product": { "name": "Apple iPhone 12", - "price": 60000, - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "override": true + "price": 70000 } - }, + } + ], + "metadata": {}, + "customer": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" + }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba187f9bb45792c13": { + "date": "2022-09-02T17:12:13.293Z", + "related_object_type": "voucher", + "related_object_id": "v_pg6DhwhmeZASoSoJ15PdzMT9MhsPjYuc", + "related_object_parent_id": "camp_W8DJVd8J0btqXT6FBwn7BSkC" + } + } + }, + { + "id": "ord_7HwbJiHmS07O7FsVAtjJcuRS", + "source_id": null, + "created_at": "2022-09-02T17:08:37.794Z", + "updated_at": "2022-09-02T17:08:38.879Z", + "status": "PAID", + "amount": 223900, + "items_discount_amount": 900, + "total_discount_amount": 900, + "total_amount": 223000, + "items": [ { - "source_id": "ComicBook_1", - "related_object": "sku", - "quantity": 1, + "object": "order_item", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku_id": "sku_0b7d7dfb090be5c619", + "quantity": 4, + "amount": 6400, + "discount_amount": 300, + "price": 1600, + "subtotal_amount": 6100, "product": { - "source_id": "Books", "name": "Comic Books1", - "price": 2100, - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "override": true + "price": 1600 }, "sku": { "sku": "Comics1", - "source_id": "ComicBook_1", - "price": 1700, - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "override": true + "price": 1600 + } + }, + { + "object": "order_item", + "product_id": "prod_0b7d7c4e814be5c502", + "quantity": 3, + "amount": 210000, + "discount_amount": 300, + "price": 70000, + "subtotal_amount": 209700, + "product": { + "name": "Apple iPhone 12", + "price": 70000 + } + }, + { + "object": "order_item", + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 5, + "amount": 7500, + "discount_amount": 300, + "price": 1500, + "subtotal_amount": 7200, + "product": { + "name": "Vase - Boho Vintage", + "price": 1500 } } - ] + ], + "metadata": {}, + "customer": { + "id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "object": "customer" + }, + "customer_id": "cust_CSnYd37MXmrbS19XCrghjBsv", + "referrer_id": null, + "object": "order", + "redemptions": { + "r_0ba1872762c5792b73": { + "date": "2022-09-02T17:08:37.899Z", + "related_object_type": "voucher", + "related_object_id": "v_yQydppWWJpSUuGNEWJ4I2upFGY2Ma4IY", + "related_object_parent_id": "camp_A5L21BD4cJii28882owYBqTV" + } + } } - } + ], + "total": 441 } } } + } + } + } + } + }, + "post": { + "operationId": "create-order", + "tags": [ + "ORDERS API" + ], + "summary": "Create Order", + "description": "Creates an order object and triggers an order creation event. ", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the order parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_create_order" }, - "responses": { - "200": { - "description": "Returns an order object if the operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object_no_discount_calculations" + "examples": { + "Example": { + "value": { + "amount": 20000, + "customer": { + "source_id": "sample_customer" + }, + "status": "PAID", + "items": [ + { + "quantity": 1, + "price": 20000, + "source_id": "sample product1", + "related_object": "product", + "product": { + "metadata": { + "key": "value" + } + } + } + ] + } + }, + "Example 2": { + "value": { + "source_id": "new", + "status": "FULFILLED", + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "source_id": "bob.smith.1@email.com", + "name": "Bob Smith", + "description": "A nice customer", + "email": "bob.smith.1@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United Statese", + "line_1": "123 Main St", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" }, - "examples": { - "Example": { - "value": { - "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", - "source_id": "new", - "created_at": "2022-09-09T09:20:01.660Z", - "updated_at": "2022-09-09T09:24:43.604Z", - "status": "FULFILLED", - "amount": 121700, - "total_amount": 121700, - "items": [ - { - "object": "order_item", - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "amount": 120000, - "price": 60000, - "subtotal_amount": 120000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "price": 60000 - } - }, - { - "object": "order_item", - "source_id": "ComicBook_1", - "related_object": "sku", - "product_id": "prod_0b7d7dfb05cbe5c616", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "price": 1700 - } - } + "metadata": { + "lang": "en", + "test": false + }, + "birthdate": "2022-01-02" + }, + "referrer": { + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A really nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3334", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": false + }, + "birthday": "2022-03-03" + }, + "items": [ + { + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "product": { + "name": "Apple iPhone 12", + "price": 60000, + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "override": true + } + }, + { + "source_id": "ComicBook_1", + "related_object": "sku", + "quantity": 1, + "product": { + "source_id": "Books", + "name": "Comic Books1", + "price": 2100, + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "override": true + }, + "sku": { + "sku": "Comics1", + "source_id": "ComicBook_1", + "price": 1700, + "metadata": { + "color": [ + "golden" ], + "vendor": "islands" + }, + "override": true + } + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns an order object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object_no_discount_calculations" + }, + "examples": { + "Example": { + "value": { + "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", + "source_id": "new", + "created_at": "2022-09-09T09:20:01.660Z", + "updated_at": "2022-09-09T09:24:43.604Z", + "status": "FULFILLED", + "amount": 121700, + "total_amount": 121700, + "items": [ + { + "object": "order_item", + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "amount": 120000, + "price": 60000, + "subtotal_amount": 120000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", "metadata": { - "location_id": [ - "L1", - "L2" + "color": [ + "purple" ], - "payment_mean": [ - "paypal", - "credit-card" - ] + "vendor": "mall" }, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" + "price": 60000 + } + }, + { + "object": "order_item", + "source_id": "ComicBook_1", + "related_object": "sku", + "product_id": "prod_0b7d7dfb05cbe5c616", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" + "price": 2100 + }, + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order" + "price": 1700 } } - } + ], + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order" } } } } } + } + } + } + }, + "/v1/orders/{orderId}": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/orders/{orderId}": { - "parameters": [ - { + "name": "orderId", + "in": "path", + "required": true, + "description": "Unique Voucherify order ID or order source ID." + } + ], + "get": { + "operationId": "get-order", + "tags": [ + "ORDERS API" + ], + "summary": "Get Order", + "description": "Retrieve an order.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an order object if a valid identifier was provided. ", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "orderId", - "in": "path", - "required": true, - "description": "Unique Voucherify order ID or order source ID." - } - ], - "get": { - "operationId": "get-order", - "tags": [ - "ORDERS API" - ], - "summary": "Get Order", - "description": "Retrieve an order.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "$ref": "#/components/schemas/10_obj_order_object" } - ], - "responses": { - "200": { - "description": "Returns an order object if a valid identifier was provided. ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object" - } - } - } + } + } + }, + "404": { + "description": "Returns an error when requesting an order that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Returns an error when requesting an order that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find order with id ord_nIcO2s8iD4Xh5E9IGDQ57Ax", - "request_id": "v-0baa1ad023d0656a84", - "resource_id": "ord_nIcO2s8iD4Xh5E9IGDQ57Ax", - "resource_type": "order" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find order with id ord_nIcO2s8iD4Xh5E9IGDQ57Ax", + "request_id": "v-0baa1ad023d0656a84", + "resource_id": "ord_nIcO2s8iD4Xh5E9IGDQ57Ax", + "resource_type": "order" } } } } - }, - "put": { - "operationId": "update-order", - "tags": [ - "ORDERS API" - ], - "summary": "Update Order", - "description": "Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters of the order that are to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_update_order" - }, - "examples": { - "Example": { - "value": { - "status": "CANCELED" - } - } - } - } - } + } + } + } + }, + "put": { + "operationId": "update-order", + "tags": [ + "ORDERS API" + ], + "summary": "Update Order", + "description": "Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters of the order that are to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_update_order" }, - "responses": { - "200": { - "description": "Returns the order object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_obj_order_object" - }, - "examples": { - "Example": { - "value": { - "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", - "source_id": "new", - "created_at": "2022-09-09T09:20:01.660Z", - "updated_at": "2022-09-09T09:41:00.881Z", - "status": "CANCELED", - "amount": 121700, - "total_amount": 121700, - "items": [ - { - "object": "order_item", - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "amount": 120000, - "price": 60000, - "subtotal_amount": 120000, - "product": { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "price": 60000 - } - }, - { - "object": "order_item", - "source_id": "ComicBook_1", - "related_object": "sku", - "product_id": "prod_0b7d7dfb05cbe5c616", - "quantity": 1, - "amount": 1700, - "price": 1700, - "subtotal_amount": 1700, - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "price": 2100 - }, - "sku": { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "sku": "Comics1", - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "price": 1700 - } - } - ], - "metadata": { - "location_id": [ - "L1", - "L2" - ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "object": "customer" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "customer" - }, - "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", - "object": "order" - } - } - } - } + "examples": { + "Example": { + "value": { + "status": "CANCELED" } } } } - }, - "/v1/orders/import": { - "post": { - "operationId": "import-orders", - "tags": [ - "ORDERS API" - ], - "summary": "Import Orders", - "description": "\n\n> 🚧 Historical orders\n>\n> This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the [create order](ref:create-order) and [update order](ref:update-order) endpoints should be used. This is critical because this endpoint does not store events or launch distributions.\n\n## Limitations\n\n### Import volume\n\nThere can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. \n\n### Maximum count of orders in single import\n\nThere is a `2000` limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time.\n\n## Notifications\n\nThere are no notifications on the Dashboard because this import is launched via the API.\n\n## Triggered actions\n \nIf you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segment's summary. Consequently, this update will trigger \n- **customers entering into segments** \n- **distributions** based on any rules tied to customer entering segment(s)\n- **earning rules** based on the customer entering segment(s)\n\n## What is not triggered\n\n1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. \n\n2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. \n\n3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you won't see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you won't see the Product created events listed, etc. \n\n4. Earning rules based on Order Paid won't be triggered.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The request body is sent in the form of an array of order objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_orders_import" - }, - "examples": { - "Example": { - "value": [ - { - "source_id": "orderImport14", - "status": "PAID", + } + }, + "responses": { + "200": { + "description": "Returns the order object if the update succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_obj_order_object" + }, + "examples": { + "Example": { + "value": { + "id": "ord_cRKOEXiBOj0EZKF7g9n6l0eH", + "source_id": "new", + "created_at": "2022-09-09T09:20:01.660Z", + "updated_at": "2022-09-09T09:41:00.881Z", + "status": "CANCELED", + "amount": 121700, + "total_amount": 121700, + "items": [ + { + "object": "order_item", + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "amount": 120000, + "price": 60000, + "subtotal_amount": 120000, + "product": { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", "metadata": { - "location_id": [ - "L1", - "L2" + "color": [ + "purple" ], - "payment_mean": [ - "paypal", - "credit-card" - ] - }, - "customer": { - "source_id": "bob2.smith@email.com", - "name": "Bob Smith", - "description": "A nice customer", - "email": "bob.smith@email.com", - "phone": "+1 933 222 3333", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": true - }, - "birthdate": "2022-01-01" - }, - "referrer": { - "source_id": "jane.smith@email.com", - "name": "Jane Smith", - "description": "A really nice customer", - "email": "jane.smith@email.com", - "phone": "+1 933 222 3334", - "address": { - "city": "New York", - "country": "United States", - "line_1": "123 Main St.", - "line_2": "APT 3 BLG 4", - "postal_code": "10001", - "state": "NY" - }, - "metadata": { - "lang": "en", - "test": false - }, - "birthday": "2022-03-03" + "vendor": "mall" }, - "items": [ - { - "source_id": "prod_1", - "related_object": "product", - "quantity": 2, - "product": { - "name": "Apple iPhone 12", - "price": 70000, - "metadata": { - "color": [ - "silver" - ], - "vendor": "mall" - }, - "override": true - } - }, - { - "source_id": "ComicBook_1", - "related_object": "sku", - "quantity": 1, - "product": { - "source_id": "Books", - "name": "Comic Books1", - "price": 1600, - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "override": true - }, - "sku": { - "sku": "Comics1", - "source_id": "ComicBook_1", - "price": 1600, - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "override": true - } - } - ] - }, - { - "source_id": "orderImport15", - "status": "PAID", + "price": 60000 + } + }, + { + "object": "order_item", + "source_id": "ComicBook_1", + "related_object": "sku", + "product_id": "prod_0b7d7dfb05cbe5c616", + "quantity": 1, + "amount": 1700, + "price": 1700, + "subtotal_amount": 1700, + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", "metadata": { - "location_id": [ - "L3" + "color": [ + "silver" ], - "payment_mean": [ - "wire-transfer" - ] + "vendor": "Bookstore1" }, - "customer": { - "source_id": "bob2.smith@email.com" - }, - "referrer": { - "source_id": "jane.smith@email.com" - }, - "items": [ - { - "source_id": "ComicBook_1", - "quantity": 4, - "related_object": "sku", - "sku": { - "source_id": "ComicBook_1" - } - }, - { - "source_id": "vase_1", - "quantity": 1, - "related_object": "product", - "product": { - "source_id": "vase_1" - } - } - ] + "price": 2100 }, - { - "source_id": "orderImport16", - "status": "FULFILLED", + "sku": { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "sku": "Comics1", "metadata": { - "location_id": [ - "L3" + "color": [ + "golden" ], - "payment_mean": [ - "wire-transfer" - ] - }, - "customer": { - "id": "cust_LMY4ZylSdUYB1J4tzqNcl5VV" - }, - "referrer": { - "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + "vendor": "islands" }, - "items": [ - { - "product_id": "prod_0b72b0bd64d198e3ae", - "quantity": 2 - }, - { - "sku_id": "sku_0b1621b319d248b79f", - "quantity": 2 - } - ] - }, - { - "source_id": "orderImport17", - "status": "CANCELED", - "amount": 7000, - "metadata": { - "location_id": [ - "L3" - ], - "payment_mean": [ - "wire-transfer" - ] - } - }, - { - "source_id": "orderImport18", - "status": "CREATED", + "price": 1700 + } + } + ], + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "object": "customer" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "customer" + }, + "customer_id": "cust_H0nXrItO1DNV3UiPIl54HA5o", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv", + "object": "order" + } + } + } + } + } + } + } + } + }, + "/v1/orders/import": { + "post": { + "operationId": "import-orders", + "tags": [ + "ORDERS API" + ], + "summary": "Import Orders", + "description": "\n\n> 🚧 Historical orders\n>\n> This endpoint should only be used to import historical orders into Voucherify. For on-going synchronization, the [create order](ref:create-order) and [update order](ref:update-order) endpoints should be used. This is critical because this endpoint does not store events or launch distributions.\n\n## Limitations\n\n### Import volume\n\nThere can be only a single on-going order import per tenant per project at a given time. The user can schedule more imports but those extra imports will be scheduled to run in sequence one by one. \n\n### Maximum count of orders in single import\n\nThere is a `2000` limit but we might decide to change it to a lower / higher value at any given time depending if we find this value is too high or too low with time.\n\n## Notifications\n\nThere are no notifications on the Dashboard because this import is launched via the API.\n\n## Triggered actions\n \nIf you import orders with customers, then a logic will be scheduled responsible for placing these customers into segments and refreshing the segment's summary. Consequently, this update will trigger \n- **customers entering into segments** \n- **distributions** based on any rules tied to customer entering segment(s)\n- **earning rules** based on the customer entering segment(s)\n\n## What is not triggered\n\n1. No webhooks are triggered during the import of orders - for both orders and upserted products / skus. \n\n2. Distributions based on Order Update, Order Paid, Order Created and Order Cancelled. In other words if you have a distribution based on Order Paid and you import an order with a PAID status, the distribution is not going to be triggered. \n\n3. No events are created during the import of orders - for both orders and upserted products / skus. In other words you won't see any events in the Activity tab in the Dashboard such as Order created or Order paid. If you are additionally upserting products / skus, then you won't see the Product created events listed, etc. \n\n4. Earning rules based on Order Paid won't be triggered.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The request body is sent in the form of an array of order objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_orders_import" + }, + "examples": { + "Example": { + "value": [ + { + "source_id": "orderImport14", + "status": "PAID", + "metadata": { + "location_id": [ + "L1", + "L2" + ], + "payment_mean": [ + "paypal", + "credit-card" + ] + }, + "customer": { + "source_id": "bob2.smith@email.com", + "name": "Bob Smith", + "description": "A nice customer", + "email": "bob.smith@email.com", + "phone": "+1 933 222 3333", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": true + }, + "birthdate": "2022-01-01" + }, + "referrer": { + "source_id": "jane.smith@email.com", + "name": "Jane Smith", + "description": "A really nice customer", + "email": "jane.smith@email.com", + "phone": "+1 933 222 3334", + "address": { + "city": "New York", + "country": "United States", + "line_1": "123 Main St.", + "line_2": "APT 3 BLG 4", + "postal_code": "10001", + "state": "NY" + }, + "metadata": { + "lang": "en", + "test": false + }, + "birthday": "2022-03-03" + }, + "items": [ + { + "source_id": "prod_1", + "related_object": "product", + "quantity": 2, + "product": { + "name": "Apple iPhone 12", + "price": 70000, "metadata": { - "location_id": [ - "L3" + "color": [ + "silver" ], - "payment_mean": [ - "wire-transfer" - ] + "vendor": "mall" }, - "items": [ - { - "source_id": "ComicBook_1", - "amount": 900, - "related_object": "sku" - }, - { - "source_id": "vase_1", - "amount": 2000, - "related_object": "product" - } - ] - }, - { - "source_id": "orderImport19", - "status": "CREATED", + "override": true + } + }, + { + "source_id": "ComicBook_1", + "related_object": "sku", + "quantity": 1, + "product": { + "source_id": "Books", + "name": "Comic Books1", + "price": 1600, "metadata": { - "location_id": [ - "L3" + "color": [ + "silver" ], - "payment_mean": [ - "wire-transfer" - ] + "vendor": "Bookstore1" }, - "items": [ - { - "amount": 900 - }, - { - "amount": 2000 - } - ] + "override": true }, - { - "source_id": "orderImport20", - "status": "CREATED", + "sku": { + "sku": "Comics1", + "source_id": "ComicBook_1", + "price": 1600, "metadata": { - "location_id": [ - "L3" + "color": [ + "golden" ], - "payment_mean": [ - "wire-transfer" - ] + "vendor": "islands" }, - "items": [ - { - "price": 900, - "quantity": 2 - }, - { - "price": 2000, - "quantity": 3 - } - ] + "override": true } + } + ] + }, + { + "source_id": "orderImport15", + "status": "PAID", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" ] - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the order(s) will be added to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" + "customer": { + "source_id": "bob2.smith@email.com" + }, + "referrer": { + "source_id": "jane.smith@email.com" + }, + "items": [ + { + "source_id": "ComicBook_1", + "quantity": 4, + "related_object": "sku", + "sku": { + "source_id": "ComicBook_1" + } + }, + { + "source_id": "vase_1", + "quantity": 1, + "related_object": "product", + "product": { + "source_id": "vase_1" } } - } - } - } - }, - "400": { - "description": "Returns an error if the payload is invalid.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + ] + }, + { + "source_id": "orderImport16", + "status": "FULFILLED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] }, - "examples": { - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .items[0].initial_quantity cannot be lower than 1", - "request_id": "v-0c5561d945cb0f0fb5" - } + "customer": { + "id": "cust_LMY4ZylSdUYB1J4tzqNcl5VV" + }, + "referrer": { + "id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "items": [ + { + "product_id": "prod_0b72b0bd64d198e3ae", + "quantity": 2 + }, + { + "sku_id": "sku_0b1621b319d248b79f", + "quantity": 2 } + ] + }, + { + "source_id": "orderImport17", + "status": "CANCELED", + "amount": 7000, + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] } + }, + { + "source_id": "orderImport18", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "items": [ + { + "source_id": "ComicBook_1", + "amount": 900, + "related_object": "sku" + }, + { + "source_id": "vase_1", + "amount": 2000, + "related_object": "product" + } + ] + }, + { + "source_id": "orderImport19", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "items": [ + { + "amount": 900 + }, + { + "amount": 2000 + } + ] + }, + { + "source_id": "orderImport20", + "status": "CREATED", + "metadata": { + "location_id": [ + "L3" + ], + "payment_mean": [ + "wire-transfer" + ] + }, + "items": [ + { + "price": 900, + "quantity": 2 + }, + { + "price": 2000, + "quantity": 3 + } + ] + } + ] + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the ID of the scheduled asynchronous action, informing you that your request has been accepted and the order(s) will be added to the repository asynchronously. To check the status and result, copy the `async_action_id` from the response and pass it using [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/orders/export": { - "post": { - "operationId": "create-order-export", - "tags": [ - "ORDERS API" - ], - "summary": "Create Orders Export", - "description": "Creates a downloadable CSV file containing a list of orders.\n\nThe parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the `parameters.fields` object in the request body.\n\nThe available filters are all [order object](ref:get-order) attributes. Additionally, any metadata defined in the metadata schema can be exported.\n\nPassing an empty JSON will generate a file containing three default fields: `id`, `source_id`, and `status`.\n\nThe fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify which order parameters you would like to export.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/10_req_create_order_export" - }, - "examples": { - "Using fields": { - "value": { - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ] - } - } - }, - "Using fields and filters": { - "value": { - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ], - "order": "-updated_at", - "filters": { - "discount_amount": { - "conditions": { - "$more_than": 100000 - } - } - } - } - } - } + "400": { + "description": "Returns an error if the payload is invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .items[0].initial_quantity cannot be lower than 1", + "request_id": "v-0c5561d945cb0f0fb5" } } } + } + } + } + } + } + }, + "/v1/orders/export": { + "post": { + "operationId": "create-order-export", + "tags": [ + "ORDERS API" + ], + "summary": "Create Orders Export", + "description": "Creates a downloadable CSV file containing a list of orders.\n\nThe parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the `parameters.fields` object in the request body.\n\nThe available filters are all [order object](ref:get-order) attributes. Additionally, any metadata defined in the metadata schema can be exported.\n\nPassing an empty JSON will generate a file containing three default fields: `id`, `source_id`, and `status`.\n\nThe fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Returns all order metadata. | Response will include all order metadata. |\n| metadata.X | Where X is the name of a particular order metadata property. | The returned value will depend on the type of data defined in the Dashboard > Project Settings > Metdata Schemas > Order. |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify which order parameters you would like to export.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/10_req_create_order_export" }, - "responses": { - "200": { - "description": "Returns the `id` of the export object and `status` of the file generation process. The `id` is used in the [Get Export](ref:get-export) method to generate the url for the downloadable CSV file or in the [Download Export](ref:download-export) method to return the contents of the CSV file. The status indicates whether the file has been scheduled for creation.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - }, - "examples": { - "Example": { - "value": { - "id": "exp_pT2Y1mgYsAgRAqsWTGf7PQX7", - "object": "export", - "created_at": "2022-09-09T10:45:52.362Z", - "status": "SCHEDULED", - "channel": "API", - "exported_object": "order", - "parameters": { - "fields": [ - "id", - "source_id", - "status", - "created_at", - "updated_at", - "amount", - "discount_amount", - "items_discount_amount", - "total_discount_amount", - "total_amount", - "customer_id", - "referrer_id", - "metadata.payment_mean" - ] - }, - "result": null, - "user_id": null - } - } - } + "examples": { + "Using fields": { + "value": { + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" + ] } } }, - "400": { - "description": "Returns an error if the request payload is specified incorrectly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .parameters.filters should match either `filters[${field}][conditions][${condition}][${index}]` or `filters[${field}][conditions][${condition}]` format and condition must be one of: $in, $not_in, $in_location, $not_in_location, $is, $is_days_ago, $is_days_in_future, $is_not, $has_value, $is_unknown, $contains, $not_contain, $starts_with, $ends_with, $more_than, $less_than, $more_than_ago, $less_than_ago, $more_than_future, $less_than_future, $more_than_equal, $less_than_equal, $after, $before, $count, $count_less, $count_more, $today, $tomorrow, $yesterday, $this_week, $last_week, $next_week, $this_month, $last_month, $next_month, $this_year, $next_year, $last_year, $is_day_of_month, $is_day, $is_month, $is_year, $today_md, $tomorrow_md, $yesterday_md, $this_week_md, $last_week_md, $next_week_md, $this_month_md, $last_month_md, $next_month_md, $is_days_ago_md, $is_more_days_ago_md, $is_less_days_ago_md, $is_days_in_future_md, $is_more_days_in_future_md, $is_less_days_in_future_md, $is_years_ago, $active, $failed, $in_progress, $expired, $before_start, $enabled, $disabled, $redeemed, $redeemable", - "request_id": "v-0c52e783650ae585b2" + "Using fields and filters": { + "value": { + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" + ], + "order": "-updated_at", + "filters": { + "discount_amount": { + "conditions": { + "$more_than": 100000 } } } @@ -78906,3591 +78912,3468 @@ } } } - }, - "/v1/product-object": { - "get": { - "operationId": "product-object", - "tags": [ - "PRODUCTS API" - ], - "summary": "Product Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Product Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" - } + } + }, + "responses": { + "200": { + "description": "Returns the `id` of the export object and `status` of the file generation process. The `id` is used in the [Get Export](ref:get-export) method to generate the url for the downloadable CSV file or in the [Download Export](ref:download-export) method to return the contents of the CSV file. The status indicates whether the file has been scheduled for creation.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + }, + "examples": { + "Example": { + "value": { + "id": "exp_pT2Y1mgYsAgRAqsWTGf7PQX7", + "object": "export", + "created_at": "2022-09-09T10:45:52.362Z", + "status": "SCHEDULED", + "channel": "API", + "exported_object": "order", + "parameters": { + "fields": [ + "id", + "source_id", + "status", + "created_at", + "updated_at", + "amount", + "discount_amount", + "items_discount_amount", + "total_discount_amount", + "total_amount", + "customer_id", + "referrer_id", + "metadata.payment_mean" + ] + }, + "result": null, + "user_id": null } } } } } }, - "/v1/sku-object": { - "get": { - "operationId": "sku-object", - "tags": [ - "PRODUCTS API" - ], - "summary": "SKU Object", - "description": "Data model description", - "responses": { - "200": { - "description": "SKU Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - } + "400": { + "description": "Returns an error if the request payload is specified incorrectly.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .parameters.filters should match either `filters[${field}][conditions][${condition}][${index}]` or `filters[${field}][conditions][${condition}]` format and condition must be one of: $in, $not_in, $in_location, $not_in_location, $is, $is_days_ago, $is_days_in_future, $is_not, $has_value, $is_unknown, $contains, $not_contain, $starts_with, $ends_with, $more_than, $less_than, $more_than_ago, $less_than_ago, $more_than_future, $less_than_future, $more_than_equal, $less_than_equal, $after, $before, $count, $count_less, $count_more, $today, $tomorrow, $yesterday, $this_week, $last_week, $next_week, $this_month, $last_month, $next_month, $this_year, $next_year, $last_year, $is_day_of_month, $is_day, $is_month, $is_year, $today_md, $tomorrow_md, $yesterday_md, $this_week_md, $last_week_md, $next_week_md, $this_month_md, $last_month_md, $next_month_md, $is_days_ago_md, $is_more_days_ago_md, $is_less_days_ago_md, $is_days_in_future_md, $is_more_days_in_future_md, $is_less_days_in_future_md, $is_years_ago, $active, $failed, $in_progress, $expired, $before_start, $enabled, $disabled, $redeemed, $redeemable", + "request_id": "v-0c52e783650ae585b2" } } } } } - }, - "/v1/products": { - "get": { - "operationId": "list-products", - "tags": [ - "PRODUCTS API" - ], - "summary": "List Products", - "description": "Retrieve a list of products.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + } + } + }, + "/v1/product-object": { + "get": { + "operationId": "product-object", + "tags": [ + "PRODUCTS API" + ], + "summary": "Product Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Product Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object" } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/sku-object": { + "get": { + "operationId": "sku-object", + "tags": [ + "PRODUCTS API" + ], + "summary": "SKU Object", + "description": "Data model description", + "responses": { + "200": { + "description": "SKU Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" } - ], - "responses": { - "200": { - "description": "Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_res_list_products" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "products", - "products": [ + } + } + } + } + } + }, + "/v1/products": { + "get": { + "operationId": "list-products", + "tags": [ + "PRODUCTS API" + ], + "summary": "List Products", + "description": "Retrieve a list of products.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with product objects. The products are returned sorted by creation date by default, with the most recent products appearing last, unless you specify another sequence using the `order` query parameter.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_res_list_products" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "products", + "products": [ + { + "id": "prod_f1r5Tpr0DuC7", + "source_id": "test_prod_id_1", + "name": "Apple iPhone 8", + "price": null, + "attributes": [ + "color", + "memory" + ], + "metadata": { + "test": true, + "vendor": "Cortland" + }, + "image_url": null, + "created_at": "2021-12-03T06:33:46.101Z", + "updated_at": null, + "object": "product", + "skus": { + "data": [ { - "id": "prod_f1r5Tpr0DuC7", - "source_id": "test_prod_id_1", - "name": "Apple iPhone 8", + "id": "sku_0a417bd1d9952f9d6f", + "source_id": "test_iphone_8_silver_256gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 256GB", "price": null, - "attributes": [ - "color", - "memory" - ], - "metadata": { - "test": true, - "vendor": "Cortland" + "currency": null, + "attributes": { + "color": "silver", + "memory": "256" }, "image_url": null, - "created_at": "2021-12-03T06:33:46.101Z", + "metadata": {}, + "created_at": "2021-12-03T06:33:46.599097+00:00", "updated_at": null, - "object": "product", - "skus": { - "data": [ - { - "id": "sku_0a417bd1d9952f9d6f", - "source_id": "test_iphone_8_silver_256gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 256GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "256" - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.599097+00:00", - "updated_at": null, - "object": "sku" - }, - { - "id": "sku_0a417bd1d9952f9d6e", - "source_id": "test_iphone_8_silver_64gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 64GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "64" - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.598595+00:00", - "updated_at": null, - "object": "sku" - } - ], - "total": 2 - } + "object": "sku" }, { - "id": "prod_0ac67e1bb8072eec48", - "source_id": "test_volleyball", - "name": "VolleyBall", - "price": 1100, - "attributes": [], + "id": "sku_0a417bd1d9952f9d6e", + "source_id": "test_iphone_8_silver_64gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 64GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "64" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.598595+00:00", + "updated_at": null, + "object": "sku" + } + ], + "total": 2 + } + }, + { + "id": "prod_0ac67e1bb8072eec48", + "source_id": "test_volleyball", + "name": "VolleyBall", + "price": 1100, + "attributes": [], + "metadata": { + "color": [ + "white" + ], + "label": true, + "origin": "PL" + }, + "image_url": null, + "created_at": "2022-03-16T14:01:45.459Z", + "updated_at": "2022-04-26T12:51:35.500Z", + "object": "product", + "skus": { + "data": [ + { + "id": "sku_0ac768973f5c4ea0d0", + "source_id": "test_volleyball_pl", + "product_id": "prod_0ac67e1bb8072eec48", + "sku": "PL", + "price": 500, + "currency": "USD", + "attributes": {}, + "image_url": null, "metadata": { "color": [ - "white" - ], - "label": true, - "origin": "PL" + "red" + ] }, + "created_at": "2022-03-17T07:06:13.629918+00:00", + "updated_at": null, + "object": "sku" + }, + { + "id": "sku_0ac7689713072e1df6", + "source_id": "test_volleyball_us", + "product_id": "prod_0ac67e1bb8072eec48", + "sku": "US", + "price": 1500, + "currency": "USD", + "attributes": {}, "image_url": null, - "created_at": "2022-03-16T14:01:45.459Z", - "updated_at": "2022-04-26T12:51:35.500Z", - "object": "product", - "skus": { - "data": [ - { - "id": "sku_0ac768973f5c4ea0d0", - "source_id": "test_volleyball_pl", - "product_id": "prod_0ac67e1bb8072eec48", - "sku": "PL", - "price": 500, - "currency": "USD", - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "red" - ] - }, - "created_at": "2022-03-17T07:06:13.629918+00:00", - "updated_at": null, - "object": "sku" - }, - { - "id": "sku_0ac7689713072e1df6", - "source_id": "test_volleyball_us", - "product_id": "prod_0ac67e1bb8072eec48", - "sku": "US", - "price": 1500, - "currency": "USD", - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "yellow" - ] - }, - "created_at": "2022-03-17T07:06:13.452532+00:00", - "updated_at": null, - "object": "sku" - } - ], - "total": 2 - } + "metadata": { + "color": [ + "yellow" + ] + }, + "created_at": "2022-03-17T07:06:13.452532+00:00", + "updated_at": null, + "object": "sku" } ], "total": 2 } } - } + ], + "total": 2 } } } } - }, - "post": { - "operationId": "create-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Create Product", - "description": "Creates a product object.\n\n\n\n> 🚧 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the product parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_create_product" + } + } + } + }, + "post": { + "operationId": "create-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Create Product", + "description": "Creates a product object.\n\n\n\n> 🚧 Upsert Mode\n>\n> If you pass a `source_id` that already exists in the product database, Voucherify will return a related product object with updated fields.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the product parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_create_product" + }, + "examples": { + "Example": { + "value": { + "source_id": "first_product", + "name": "Samsung Phone", + "price": 200000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store" }, - "examples": { - "Example": { - "value": { - "source_id": "first_product", - "name": "Samsung Phone", - "price": 200000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store" - }, - "image_url": "https://www.website.com/image.png" - } - } - } + "image_url": "https://www.website.com/image.png" } } - }, - "responses": { - "200": { - "description": "Returns a product object if the operation succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a product object if the operation succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object" + }, + "examples": { + "Example": { + "value": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone", + "price": 200000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store" }, - "examples": { - "Example": { - "value": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone", - "price": 200000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store" - }, - "image_url": "https://www.website.com/image.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T12:59:55.890Z", - "object": "product" - } - } - } + "image_url": "https://www.website.com/image.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T12:59:55.890Z", + "object": "product" } } } } } + } + } + } + }, + "/v1/products/{productId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "prod_f1r5Tpr0DuC7" }, - "/v1/products/{productId}": { - "parameters": [ - { + "name": "productId", + "in": "path", + "required": true, + "description": "A Voucherify product ID or source ID." + } + ], + "get": { + "operationId": "get-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Get Product", + "description": "Retrieve product details.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a product object if a valid identifier was provided.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "prod_f1r5Tpr0DuC7" - }, - "name": "productId", - "in": "path", - "required": true, - "description": "A Voucherify product ID or source ID." - } - ], - "get": { - "operationId": "get-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Get Product", - "description": "Retrieve product details.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a product object if a valid identifier was provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object" - }, - "examples": { - "Example": { - "value": { - "id": "prod_f1r5Tpr0DuC7", - "source_id": "test_prod_id_1", - "name": "Apple iPhone 8", + "$ref": "#/components/schemas/11_obj_product_object" + }, + "examples": { + "Example": { + "value": { + "id": "prod_f1r5Tpr0DuC7", + "source_id": "test_prod_id_1", + "name": "Apple iPhone 8", + "price": null, + "attributes": [ + "color", + "memory" + ], + "metadata": { + "test": true, + "vendor": "Cortland" + }, + "image_url": null, + "created_at": "2021-12-03T06:33:46.101Z", + "updated_at": null, + "object": "product", + "skus": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "sku_0a417bd1d9952f9d6f", + "source_id": "test_iphone_8_silver_256gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 256GB", "price": null, - "attributes": [ - "color", - "memory" - ], - "metadata": { - "test": true, - "vendor": "Cortland" + "currency": null, + "attributes": { + "color": "silver", + "memory": "256" }, "image_url": null, - "created_at": "2021-12-03T06:33:46.101Z", + "metadata": {}, + "created_at": "2021-12-03T06:33:46.599097+00:00", "updated_at": null, - "object": "product", - "skus": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "sku_0a417bd1d9952f9d6f", - "source_id": "test_iphone_8_silver_256gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 256GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "256" - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.599097+00:00", - "updated_at": null, - "object": "sku" - }, - { - "id": "sku_0a417bd1d9952f9d6e", - "source_id": "test_iphone_8_silver_64gb", - "product_id": "prod_f1r5Tpr0DuC7", - "sku": "iPhone 8 Silver 64GB", - "price": null, - "currency": null, - "attributes": { - "color": "silver", - "memory": "64" - }, - "image_url": null, - "metadata": {}, - "created_at": "2021-12-03T06:33:46.598595+00:00", - "updated_at": null, - "object": "sku" - } - ], - "total": 2 - } + "object": "sku" + }, + { + "id": "sku_0a417bd1d9952f9d6e", + "source_id": "test_iphone_8_silver_64gb", + "product_id": "prod_f1r5Tpr0DuC7", + "sku": "iPhone 8 Silver 64GB", + "price": null, + "currency": null, + "attributes": { + "color": "silver", + "memory": "64" + }, + "image_url": null, + "metadata": {}, + "created_at": "2021-12-03T06:33:46.598595+00:00", + "updated_at": null, + "object": "sku" } - } + ], + "total": 2 } } } + } + } + } + }, + "404": { + "description": "Returns an error when requesting a product that has been deleted or cannot be found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Returns an error when requesting a product that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id test_prod_id_", - "request_id": "v-0bae1d3caf478da111", - "resource_id": "test_prod_id_", - "resource_type": "product" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id test_prod_id_", + "request_id": "v-0bae1d3caf478da111", + "resource_id": "test_prod_id_", + "resource_type": "product" } } } } - }, - "put": { - "operationId": "update-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Product", - "description": "Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters of the product that are to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_product" - }, - "examples": { - "Example": { - "value": { - "price": 210000 - } - } - } + } + } + } + }, + "put": { + "operationId": "update-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Product", + "description": "Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters of the product that are to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_product" + }, + "examples": { + "Example": { + "value": { + "price": 210000 } } - }, - "responses": { - "200": { - "description": "Returns an updated product object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_product_object_truncated" + } + } + } + }, + "responses": { + "200": { + "description": "Returns an updated product object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_product_object_truncated" + }, + "examples": { + "Example": { + "value": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone", + "price": 210000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": false, + "vendor": "Online Stores" }, - "examples": { - "Example": { - "value": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone", - "price": 210000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": false, - "vendor": "Online Stores" - }, - "image_url": "https://www.website.com/image.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T13:33:48.904Z", - "object": "product" - } - } - } + "image_url": "https://www.website.com/image.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T13:33:48.904Z", + "object": "product" } } } } + } + } + } + }, + "delete": { + "operationId": "delete-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "Delete Product", + "description": "This method deletes a product.", + "parameters": [ + { + "schema": { + "type": "string" }, - "delete": { - "operationId": "delete-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "Delete Product", - "description": "This method deletes a product.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the product will be removed permanently. Going forward, the user will be able to create another product with exactly the same `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the product with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Product Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id prod_0a4934c50ddc5dbae", - "request_id": "v-0ae39cd7de8683dfd8", - "resource_id": "prod_0a4934c50ddc5dbae", - "resource_type": "product" - } - } - } + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the product will be removed permanently. Going forward, the user will be able to create another product with exactly the same `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the product with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id prod_0a4934c50ddc5dbae", + "request_id": "v-0ae39cd7de8683dfd8", + "resource_id": "prod_0a4934c50ddc5dbae", + "resource_type": "product" } } } } } - }, - "/v1/products/bulk/async": { - "post": { - "operationId": "update-products-in-bulk", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Products in bulk", - "description": "Update several products in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Create an array of product objects, each with the parameters which you want to update.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/11_req_update_product_bulk" - } - }, - "examples": { - "Example": { - "value": [ - { - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 3" - }, - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" - }, - { - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 4" - }, - "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" - } - ] - } - } - } + } + } + } + }, + "/v1/products/bulk/async": { + "post": { + "operationId": "update-products-in-bulk", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Products in bulk", + "description": "Update several products in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Create an array of product objects, each with the parameters which you want to update.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/11_req_update_product_bulk" } }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" + "examples": { + "Example": { + "value": [ + { + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 3" }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" + }, + { + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 4" + }, + "image_url": "https://voucherify-uploads.s3.amazonaws.com/org_2qt8DYlM/img_Z2qvs2KFnQyo2Ohz4uhsjGtf.png" } - } + ] + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "400": { - "description": "Returns an error if the required parameters are not included in the request body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Example": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'source_id'", - "request_id": "v-0bae44e063cca61aff" - } - } - } + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/products/metadata/async": { - "post": { - "operationId": "update-products-metadata-in-bulk", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update Products' Metadata in bulk", - "description": "Update several product metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the list of product source IDs and the metadata key value pairs to be udpated for these products.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_products_metadata_in_bulk" - }, - "examples": { - "Example": { - "value": { - "source_ids": [ - "123-567-3433", - "test_volleyball" - ], - "metadata": { - "label": true, - "origin": "PL" - } - } - } + "400": { + "description": "Returns an error if the required parameters are not included in the request body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Example": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'source_id'", + "request_id": "v-0bae44e063cca61aff" } } } + } + } + } + } + } + }, + "/v1/products/metadata/async": { + "post": { + "operationId": "update-products-metadata-in-bulk", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update Products' Metadata in bulk", + "description": "Update several product metadata properties in one asynchronous operation. \n\nIn one request, it is possible to update a maximum of **100** records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an **upsert** occurs. This is reflected in the [Get Async Action](ref:get-async-action) endpoint as follows: \n\n\n```json\n{\n \"found\": false,\n \"updated\": true\n}\n```\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the list of product source IDs and the metadata key value pairs to be udpated for these products.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_products_metadata_in_bulk" }, - "responses": { - "202": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Example": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + "examples": { + "Example": { + "value": { + "source_ids": [ + "123-567-3433", + "test_volleyball" + ], + "metadata": { + "label": true, + "origin": "PL" } } + } + } + } + } + }, + "responses": { + "202": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and updates will be added to the repository asynchronously. To check the update status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - "400": { - "description": "Returns an error if the request parameters are not provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Not enough source IDs": { - "value": { - "code": 400, - "key": "not_enough_source_ids", - "message": "Not enough source_ids", - "details": "Specify at least 1 ID in source_ids.", - "request_id": "v-0bae421d05078dcdb4" - } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'metadata'", - "request_id": "v-0bae428dab8ca61825" - } - } - } + "examples": { + "Example": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/skus/{skuId}": { - "parameters": [ - { + "400": { + "description": "Returns an error if the request parameters are not provided.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_error_no_translation" }, - "name": "skuId", - "in": "path", - "required": true, - "description": "A Voucherify SKU identifier or SKU source ID." - } - ], - "get": { - "operationId": "get-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Get SKU", - "description": "Retrieve details of a SKU.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns requested SKU object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "examples": { - "Example": { - "value": { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" - } - } - } + "examples": { + "Not enough source IDs": { + "value": { + "code": 400, + "key": "not_enough_source_ids", + "message": "Not enough source_ids", + "details": "Specify at least 1 ID in source_ids.", + "request_id": "v-0bae421d05078dcdb4" } - } - }, - "404": { - "description": "Returns an error indicating that the sku with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find sku with id sku_0b1621b319d248b79", - "request_id": "v-0b4fe3ddc55646d01d", - "resource_id": "sku_0b1621b319d248b79", - "resource_type": "sku" - } - } - } + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'metadata'", + "request_id": "v-0bae428dab8ca61825" } } } } } + } + } + } + }, + "/v1/skus/{skuId}": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/products/{productId}/skus": { - "parameters": [ - { + "name": "skuId", + "in": "path", + "required": true, + "description": "A Voucherify SKU identifier or SKU source ID." + } + ], + "get": { + "operationId": "get-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Get SKU", + "description": "Retrieve details of a SKU.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns requested SKU object.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "productId", - "in": "path", - "description": "A Voucherify [product](ref:get-product) ID or product source ID.", - "required": true - } - ], - "get": { - "operationId": "list-skus-in-product", - "tags": [ - "PRODUCTS API" - ], - "summary": "List SKUs in Product", - "description": "Retrieve all SKUs for a given product.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + "$ref": "#/components/schemas/11_obj_sku_object" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of SKUs.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_res_products_productId_skus" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "skus", - "skus": [ - { - "id": "sku_0b1621b2f25248b79c", - "source_id": "sku_source_id_1", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Extra Small Blue Shirt", - "price": 1300, - "currency": "USD", - "attributes": { - "size": "XS", - "color": "blue", - "ranking": 1 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.057Z", - "updated_at": "2022-07-01T05:34:16.822Z", - "object": "sku" - }, - { - "id": "sku_0b1621b3181248b79d", - "source_id": "sku_source_id_3", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Medium Yellow Shirt", - "price": 1450, - "currency": "USD", - "attributes": { - "size": "M", - "color": "yellow", - "ranking": 3 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.180Z", - "updated_at": "2022-07-01T05:34:16.842Z", - "object": "sku" - }, - { - "id": "sku_0b1621b3199248b79e", - "source_id": "sku_source_id_2", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Small Red Shirt", - "price": 1400, - "currency": "USD", - "attributes": { - "size": "S", - "color": "red", - "ranking": 2 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.183Z", - "updated_at": "2022-07-01T05:34:16.927Z", - "object": "sku" - }, - { - "id": "sku_0b1621b319d248b79f", - "source_id": "sku_source_id_4", - "product_id": "prod_0b15f6b9f650c16990", - "sku": "Large Pink Shirt -", - "price": 1700, - "currency": "USD", - "attributes": { - "size": "L", - "color": "pink", - "ranking": 4 - }, - "image_url": "", - "metadata": {}, - "created_at": "2022-05-17T10:36:30.187Z", - "updated_at": "2022-07-05T08:47:50.680Z", - "object": "sku" - } - ], - "total": 4 - } - } - } + "examples": { + "Example": { + "value": { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", + "price": 1300, + "currency": "USD", + "attributes": { + "size": "XS", + "color": "blue", + "ranking": 1 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" } } + } + } + } + }, + "404": { + "description": "Returns an error indicating that the sku with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Returns an error when requesting a product that has been deleted or cannot be found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Example": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id prod_0b15f6b9f650c6990", - "request_id": "v-0bae223075878da708", - "resource_id": "prod_0b15f6b9f650c6990", - "resource_type": "product" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find sku with id sku_0b1621b319d248b79", + "request_id": "v-0b4fe3ddc55646d01d", + "resource_id": "sku_0b1621b319d248b79", + "resource_type": "sku" } } } } + } + } + } + } + }, + "/v1/products/{productId}/skus": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "productId", + "in": "path", + "description": "A Voucherify [product](ref:get-product) ID or product source ID.", + "required": true + } + ], + "get": { + "operationId": "list-skus-in-product", + "tags": [ + "PRODUCTS API" + ], + "summary": "List SKUs in Product", + "description": "Retrieve all SKUs for a given product.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at" + ] }, - "post": { - "operationId": "create-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Create SKU", - "description": "This method adds product varients to a [created product](ref:create-product).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the SKU parameters to be created.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_create_sku" - }, - "examples": { - "Example": { - "value": { - "source_id": "first_product_sku_1", - "sku": "Samsung phone 256GB", + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of SKUs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_res_products_productId_skus" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "skus", + "skus": [ + { + "id": "sku_0b1621b2f25248b79c", + "source_id": "sku_source_id_1", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Extra Small Blue Shirt", "price": 1300, "currency": "USD", "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" + "size": "XS", + "color": "blue", + "ranking": 1 }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the created SKU object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "examples": { - "Example": { - "value": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 1300, - "currency": "USD", - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true - }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": null, - "object": "sku" - } + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.057Z", + "updated_at": "2022-07-01T05:34:16.822Z", + "object": "sku" + }, + { + "id": "sku_0b1621b3181248b79d", + "source_id": "sku_source_id_3", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Medium Yellow Shirt", + "price": 1450, + "currency": "USD", + "attributes": { + "size": "M", + "color": "yellow", + "ranking": 3 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.180Z", + "updated_at": "2022-07-01T05:34:16.842Z", + "object": "sku" + }, + { + "id": "sku_0b1621b3199248b79e", + "source_id": "sku_source_id_2", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Small Red Shirt", + "price": 1400, + "currency": "USD", + "attributes": { + "size": "S", + "color": "red", + "ranking": 2 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.183Z", + "updated_at": "2022-07-01T05:34:16.927Z", + "object": "sku" + }, + { + "id": "sku_0b1621b319d248b79f", + "source_id": "sku_source_id_4", + "product_id": "prod_0b15f6b9f650c16990", + "sku": "Large Pink Shirt -", + "price": 1700, + "currency": "USD", + "attributes": { + "size": "L", + "color": "pink", + "ranking": 4 + }, + "image_url": "", + "metadata": {}, + "created_at": "2022-05-17T10:36:30.187Z", + "updated_at": "2022-07-05T08:47:50.680Z", + "object": "sku" } - } + ], + "total": 4 } } } } } }, - "/v1/products/{productId}/skus/{skuId}": { - "parameters": [ - { + "404": { + "description": "Returns an error when requesting a product that has been deleted or cannot be found.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "productId", - "in": "path", - "required": true, - "description": "A unique Voucherify [product](ref:get-product) ID or product source ID." - }, - { - "schema": { - "type": "string" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "skuId", - "in": "path", - "required": true, - "description": "A Voucherify [SKU ID](ref:get-sku) or SKU source ID." - } - ], - "put": { - "operationId": "update-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Update SKU", - "description": "Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_req_update_sku" - }, - "examples": { - "Example": { - "value": { - "price": 210000, - "currency": "PLN" - } - } + "examples": { + "Example": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id prod_0b15f6b9f650c6990", + "request_id": "v-0bae223075878da708", + "resource_id": "prod_0b15f6b9f650c6990", + "resource_type": "product" } } } + } + } + } + } + }, + "post": { + "operationId": "create-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Create SKU", + "description": "This method adds product varients to a [created product](ref:create-product).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the SKU parameters to be created.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_create_sku" }, - "responses": { - "200": { - "description": "Returns the SKU object with the updated parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/11_obj_sku_object" - }, - "examples": { - "Example": { - "value": { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 210000, - "currency": "PLN", - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "imported": true - }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": "2022-09-12T14:09:40.859Z", - "object": "sku" - } - } - } + "examples": { + "Example": { + "value": { + "source_id": "first_product_sku_1", + "sku": "Samsung phone 256GB", + "price": 1300, + "currency": "USD", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true } } } } - }, - "delete": { - "operationId": "delete-sku", - "tags": [ - "PRODUCTS API" - ], - "summary": "Delete SKU", - "description": "This method deletes a product SKU.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the SKU will be removed permanently. Going forward, the user will be able to create another SKU with exactly the same `source_id`." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the product or sku with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Product Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find product with id 123-567-343", - "request_id": "v-0ae3a0d26fd40ecd11", - "resource_id": "123-567-343", - "resource_type": "product" - } - }, - "SKU Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find sku with id sku_0ae3a06b20019ba8f", - "request_id": "v-0ae3a1534d940ecd81", - "resource_id": "sku_0ae3a06b20019ba8f", - "resource_type": "sku" - } - } - } + } + } + }, + "responses": { + "200": { + "description": "Returns the created SKU object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" + }, + "examples": { + "Example": { + "value": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 1300, + "currency": "USD", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true + }, + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": null, + "object": "sku" } } } } } + } + } + } + }, + "/v1/products/{productId}/skus/{skuId}": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/products/importCSV": { - "post": { - "operationId": "import-products-using-csv", - "tags": [ - "PRODUCTS API" - ], - "summary": "Import Products using CSV", - "description": "Import products into the repository using a CSV file. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/products/importCSV \\\n -F file=@/path/to/products.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nThe CSV file has to include headers in the first line.\n\n\n\n> 📘 Standard product fields mapping\n>\n> - Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).\n> - Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`\n> - **Name** is a **required** field. The remaining fields in the CSV template are optional.\n> - Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.\n> - Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 norms**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11\n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Columns that can't be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata. \n> - To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).\n> - **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e \"attribute1,attribute2\".\n> - Headers with metadata names **can't contain white-space characters**.\n> - If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example: \n> - array of strings: \"subscribed,premium\" \n> - array of numbers: \"123,234\". \n> - array of dates: \"2000-01-01,2000-01-02\"\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" - } - } - } + "name": "productId", + "in": "path", + "required": true, + "description": "A unique Voucherify [product](ref:get-product) ID or product source ID." + }, + { + "schema": { + "type": "string" + }, + "name": "skuId", + "in": "path", + "required": true, + "description": "A Voucherify [SKU ID](ref:get-sku) or SKU source ID." + } + ], + "put": { + "operationId": "update-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Update SKU", + "description": "Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body schema won't be modified. Even if provided, they will be silently skipped.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_req_update_sku" }, - "responses": { - "200": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Async Action": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } - } + "examples": { + "Example": { + "value": { + "price": 210000, + "currency": "PLN" } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns the SKU object with the updated parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/11_obj_sku_object" }, - "400": { - "description": "Returns an invalid payload error. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + "examples": { + "Example": { + "value": { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 210000, + "currency": "PLN", + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "imported": true }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'file'", - "request_id": "v-0c4c46bbad0136789f" - } - } - } + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": "2022-09-12T14:09:40.859Z", + "object": "sku" } } } } } + } + } + }, + "delete": { + "operationId": "delete-sku", + "tags": [ + "PRODUCTS API" + ], + "summary": "Delete SKU", + "description": "This method deletes a product SKU.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the SKU will be removed permanently. Going forward, the user will be able to create another SKU with exactly the same `source_id`." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/skus/importCSV": { - "post": { - "operationId": "import-skus-using-csv", - "tags": [ - "PRODUCTS API" - ], - "summary": "Import SKUs using CSV", - "description": "Import SKUs into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/skus/importCSV \\\n -F file=@/path/to/skus.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n> 🚧 Import sequence\n>\n> First import products using the [dedicated endpoint](ref:import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.\n\n\n\n> 📘 Standard SKU fields mapping\n>\n> - **Required** fields are source_id and product_id.\n> - Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`\n> - SKU **source_id**'s must be unique in the entire product catalog, no duplicates allowed.\n> - SKU attributes need to be in the form of a stringy-fied json, i.e.`\"{'color':'blue'}\"`. These attributes must be defined in the **product** beforehand in order for you to be able to import them to the SKU.\n> - You can use this method to update the following parameters in bulk: **sku** and the sku **price**.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "The file path is stored in the form `file` header.", - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/a_req_importCSV" + "404": { + "description": "Returns an error indicating that the product or sku with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find product with id 123-567-343", + "request_id": "v-0ae3a0d26fd40ecd11", + "resource_id": "123-567-343", + "resource_type": "product" + } + }, + "SKU Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find sku with id sku_0ae3a06b20019ba8f", + "request_id": "v-0ae3a1534d940ecd81", + "resource_id": "sku_0ae3a06b20019ba8f", + "resource_type": "sku" } } } - }, - "responses": { - "200": { - "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/a_res_async_actions" - }, - "examples": { - "Async Action": { - "value": { - "async_action_id": "aa_0a875d56c805df6601" - } - } - } + } + } + } + } + } + }, + "/v1/products/importCSV": { + "post": { + "operationId": "import-products-using-csv", + "tags": [ + "PRODUCTS API" + ], + "summary": "Import Products using CSV", + "description": "Import products into the repository using a CSV file. \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/products/importCSV \\\n -F file=@/path/to/products.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n\nThe CSV file has to include headers in the first line.\n\n\n\n> 📘 Standard product fields mapping\n>\n> - Create a **comma separated value (CSV) file** or download our CSV import template. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b82ed68d51e779443f550/Import_products_template.csv).\n> - Supported CSV file headers: `name,source_id,price,attributes,image_url,Metadata_property_name`\n> - **Name** is a **required** field. The remaining fields in the CSV template are optional.\n> - Override/Update products' **names** in Voucherify using this method. Data will be updated for each product included in the CSV file whose **source_id** matches a source ID in Voucherify. No other data can be updated other than the product name.\n> - Note that dates and date-time attributes need to be provided in compliance with the **ISO 8601 norms**. For example, 2022-03-11T09:00:00.000Z or 2022-03-11\n> - `YYYY-MM-DD`\n> - `YYYY-MM-DDTHH`\n> - `YYYY-MM-DDTHH:mm`\n> - `YYYY-MM-DDTHH:mm:ss`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ssZ`\n> - `YYYY-MM-DDTHH:mm:ss.SSSZ`\n> - Columns that can't be mapped to standard fields, will be mapped to **Custom attributes** and added as **products' metadata**. There is no limit on the number of custom attributes that you can import as metadata. \n> - To provide the proper data type, you need to add all custom attributes to the metadata schema **before importing the file**. Read more [here](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).\n> - **Product attributes** (not custom attributes) need to be separated by a comma and enclosed in double quotes, i.e \"attribute1,attribute2\".\n> - Headers with metadata names **can't contain white-space characters**.\n> - If you import metadata defined in the schema as **arrays (multiple)**, you need to separate each value using a comma, for example: \n> - array of strings: \"subscribed,premium\" \n> - array of numbers: \"123,234\". \n> - array of dates: \"2000-01-01,2000-01-02\"\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + }, + "responses": { + "200": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and products will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" + }, + "examples": { + "Async Action": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" } } } } } }, - "/v1/product-collection-object": { - "get": { - "operationId": "product-collection-object", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Product Collection Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Product Collection Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_collection_item" - } + "400": { + "description": "Returns an invalid payload error. You may receive this error if you have incorrectly or have not specified the content type as `multipart/form-data` in the headers.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'file'", + "request_id": "v-0c4c46bbad0136789f" } } } } } - }, - "/v1/product-collections": { - "get": { - "operationId": "list-product-collections", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "List Product Collections", - "description": "This method returns a list of product collections.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + } + } + } + }, + "/v1/skus/importCSV": { + "post": { + "operationId": "import-skus-using-csv", + "tags": [ + "PRODUCTS API" + ], + "summary": "Import SKUs using CSV", + "description": "Import SKUs into the repository using a CSV file.\n\nThe CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](https://s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). \n\nCurl Example\n\n```cURL\ncurl -X POST \\\n https://api.voucherify.io/v1/skus/importCSV \\\n -F file=@/path/to/skus.csv \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\"\n```\n> 🚧 Import sequence\n>\n> First import products using the [dedicated endpoint](ref:import-products-using-csv), then import SKUs using this endpoint to properly match SKUs to products.\n\n\n\n> 📘 Standard SKU fields mapping\n>\n> - **Required** fields are source_id and product_id.\n> - Supported CSV file headers: `product_id,sku,source_id,price,image_url,attributes`\n> - SKU **source_id**'s must be unique in the entire product catalog, no duplicates allowed.\n> - SKU attributes need to be in the form of a stringy-fied json, i.e.`\"{'color':'blue'}\"`. These attributes must be defined in the **product** beforehand in order for you to be able to import them to the SKU.\n> - You can use this method to update the following parameters in bulk: **sku** and the sku **price**.\n\nThis API request starts a process that affects Voucherify data in bulk. \n\nIn case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the `IN_PROGRESS` status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. \n\nThe result will return the async ID. You can verify the status of your request via this [API request](ref:get-async-action).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "The file path is stored in the form `file` header.", + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/a_req_importCSV" + } + } + } + }, + "responses": { + "200": { + "description": "Returns ID of the scheduled async action. The response informs you that your request has been accepted and SKUs will be added to the repository asynchronously. To check the import status and result, copy the `async_action_id` from the response and pass it using the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/a_res_async_actions" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + "examples": { + "Async Action": { + "value": { + "async_action_id": "aa_0a875d56c805df6601" + } + } } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/product-collection-object": { + "get": { + "operationId": "product-collection-object", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Product Collection Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Product Collection Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_collection_item" } - ], - "responses": { - "200": { - "description": "Returns a dictionary containing a list of product collections and details about each product collection.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_list_response_body" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", - "name": "Products in Poland", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.product_location": { - "conditions": { - "$in_location": [ - "loc_RcYz537sV07e1t5aG5tIH9FD" - ] - } - } - }, - "created_at": "2022-07-14T16:12:26.377Z", - "object": "products_collection" - }, - { - "id": "pc_FJdBpaQyvK6Gcdul4D2HRChI", - "name": "Price less than 10", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "price": { - "conditions": { - "$less_than": [ - 1000 - ] - } - } - }, - "created_at": "2022-03-17T07:11:25.406Z", - "object": "products_collection" - }, - { - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "name": "Color is brown", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.color": { - "conditions": { - "$is": [ - "brown" - ] - } - } - }, - "created_at": "2022-03-16T14:27:49.612Z", - "object": "products_collection" - }, - { - "id": "pc_BxofAP7pyM9FO7M6iaIzIouy", - "name": "Color not brown", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.color": { - "conditions": { - "$is_not": [ - "brown" - ] - } - } - }, - "created_at": "2022-03-16T13:49:05.697Z", - "object": "products_collection" - }, - { - "id": "pc_uHpM9ipEQH2yEpm3D8aohkBM", - "name": "Price less than 20", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "price": { - "conditions": { - "$less_than": [ - 2000 - ] - } - } - }, - "created_at": "2022-03-16T13:46:01.102Z", - "object": "products_collection" - }, - { - "id": "pc_ZgM25PcZAMp6qItKJRtR2mEi", - "name": "Name starts with S", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "name": { - "conditions": { - "$starts_with": [ - "S" - ] - } - } - }, - "created_at": "2022-03-16T13:42:35.917Z", - "object": "products_collection" - }, - { - "id": "pc_41V4DiQQO8YGqj0J2oZD57j4", - "name": "Ends with baby", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "source_id": { - "conditions": { - "$ends_with": [ - "baby" - ] - } - } - }, - "created_at": "2022-03-14T12:50:19.885Z", - "object": "products_collection" - }, - { - "id": "pc_0cRX5wAFt1R1R5Ir6WdTowui", - "name": "C start", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "name": { - "conditions": { - "$starts_with": [ - "C" - ] - } - } - }, - "created_at": "2022-03-14T12:18:15.588Z", - "object": "products_collection" - }, - { - "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", - "name": "Shirts", - "type": "STATIC", - "products": [ - { - "id": "prod_0a9f9aeddb019a42db", - "object": "product" - }, - { - "id": "prod_0a9f9ab4ab019a42d5", - "object": "product" - } - ], - "created_at": "2022-02-28T11:42:12.484Z", - "object": "products_collection" + } + } + } + } + } + }, + "/v1/product-collections": { + "get": { + "operationId": "list-product-collections", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "List Product Collections", + "description": "This method returns a list of product collections.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary containing a list of product collections and details about each product collection.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_list_response_body" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", + "name": "Products in Poland", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.product_location": { + "conditions": { + "$in_location": [ + "loc_RcYz537sV07e1t5aG5tIH9FD" + ] } - ], - "total": 9 - } + } + }, + "created_at": "2022-07-14T16:12:26.377Z", + "object": "products_collection" + }, + { + "id": "pc_FJdBpaQyvK6Gcdul4D2HRChI", + "name": "Price less than 10", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "price": { + "conditions": { + "$less_than": [ + 1000 + ] + } + } + }, + "created_at": "2022-03-17T07:11:25.406Z", + "object": "products_collection" + }, + { + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "name": "Color is brown", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.color": { + "conditions": { + "$is": [ + "brown" + ] + } + } + }, + "created_at": "2022-03-16T14:27:49.612Z", + "object": "products_collection" + }, + { + "id": "pc_BxofAP7pyM9FO7M6iaIzIouy", + "name": "Color not brown", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.color": { + "conditions": { + "$is_not": [ + "brown" + ] + } + } + }, + "created_at": "2022-03-16T13:49:05.697Z", + "object": "products_collection" + }, + { + "id": "pc_uHpM9ipEQH2yEpm3D8aohkBM", + "name": "Price less than 20", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "price": { + "conditions": { + "$less_than": [ + 2000 + ] + } + } + }, + "created_at": "2022-03-16T13:46:01.102Z", + "object": "products_collection" + }, + { + "id": "pc_ZgM25PcZAMp6qItKJRtR2mEi", + "name": "Name starts with S", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "name": { + "conditions": { + "$starts_with": [ + "S" + ] + } + } + }, + "created_at": "2022-03-16T13:42:35.917Z", + "object": "products_collection" + }, + { + "id": "pc_41V4DiQQO8YGqj0J2oZD57j4", + "name": "Ends with baby", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "source_id": { + "conditions": { + "$ends_with": [ + "baby" + ] + } + } + }, + "created_at": "2022-03-14T12:50:19.885Z", + "object": "products_collection" + }, + { + "id": "pc_0cRX5wAFt1R1R5Ir6WdTowui", + "name": "C start", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "name": { + "conditions": { + "$starts_with": [ + "C" + ] + } + } + }, + "created_at": "2022-03-14T12:18:15.588Z", + "object": "products_collection" + }, + { + "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", + "name": "Shirts", + "type": "STATIC", + "products": [ + { + "id": "prod_0a9f9aeddb019a42db", + "object": "product" + }, + { + "id": "prod_0a9f9ab4ab019a42d5", + "object": "product" + } + ], + "created_at": "2022-02-28T11:42:12.484Z", + "object": "products_collection" } - } + ], + "total": 9 } } } } - }, - "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" - } - } + } + } + } + }, + "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}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "pc_41V4DiQQO8YGqj0J2oZD57j4" }, - "/v1/product-collections/{productCollectionId}": { - "parameters": [ - { + "name": "productCollectionId", + "in": "path", + "required": true, + "description": "A unique product collection ID." + } + ], + "get": { + "operationId": "get-product-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Get Product Collection", + "description": "Retrieves the product collection.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a products collection object if a valid identifier was provided in the path.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "pc_41V4DiQQO8YGqj0J2oZD57j4" - }, - "name": "productCollectionId", - "in": "path", - "required": true, - "description": "A unique product collection ID." - } - ], - "get": { - "operationId": "get-product-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Get Product Collection", - "description": "Retrieves the product collection.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a products collection object if a valid identifier was provided in the path.", - "content": { - "application/json": { - "schema": { - "$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": { - "value": { - "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", - "name": "Products in Poland", - "type": "AUTO_UPDATE", - "filter": { - "junction": "and", - "metadata.product_location": { - "conditions": { - "$in_location": [ - "loc_RcYz537sV07e1t5aG5tIH9FD" - ] - } - } - }, - "created_at": "2022-07-14T16:12:26.377Z", - "object": "products_collection" - } - }, - "Static": { - "value": { - "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", - "name": "Shirts", - "type": "STATIC", - "products": [ - { - "id": "prod_0a9f9aeddb019a42db", - "object": "product" - }, - { - "id": "prod_0a9f9ab4ab019a42d5", - "object": "product" - } - ], - "created_at": "2022-02-28T11:42:12.484Z", - "object": "products_collection" + "$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": { + "value": { + "id": "pc_Dj1qSH7bho4SVh7aSDKjU174", + "name": "Products in Poland", + "type": "AUTO_UPDATE", + "filter": { + "junction": "and", + "metadata.product_location": { + "conditions": { + "$in_location": [ + "loc_RcYz537sV07e1t5aG5tIH9FD" + ] } } - } + }, + "created_at": "2022-07-14T16:12:26.377Z", + "object": "products_collection" } - } - }, - "404": { - "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", - "request_id": "v-0b4ec2530e9646cb15", - "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", - "resource_type": "products_collection" - } + }, + "Static": { + "value": { + "id": "pc_bQ2p9TycbEhd3YzwFCR3JQYA", + "name": "Shirts", + "type": "STATIC", + "products": [ + { + "id": "prod_0a9f9aeddb019a42db", + "object": "product" + }, + { + "id": "prod_0a9f9ab4ab019a42d5", + "object": "product" } - } + ], + "created_at": "2022-02-28T11:42:12.484Z", + "object": "products_collection" } } } } - }, - "delete": { - "operationId": "delete-product-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "Delete Product Collection", - "description": "This method deletes a product collection.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "400": { - "description": "Returns an error indicating that the product collection with given ID is in use by other resources.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_resource_in_use" - }, - "examples": { - "Product Colllection In Use": { - "value": { - "code": 400, - "key": "resource_in_use", - "message": "Resource in use", - "details": "Resource products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j4 is in use by validation_ruless with ids [val_9TB89AjZeVEJ]", - "request_id": "v-0ae3a63aff940ed1b2", - "related_object_ids": [ - "val_9TB89AjZeVEJ" - ], - "related_object_type": "validation_rules" - } - } - } - } - } + } + }, + "404": { + "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "404": { - "description": "Returns an error indicating that the product collection with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Product Collection Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", - "request_id": "v-0ae3a49261d027b870", - "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", - "resource_type": "products_collection" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", + "request_id": "v-0b4ec2530e9646cb15", + "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", + "resource_type": "products_collection" } } } } } + } + } + }, + "delete": { + "operationId": "delete-product-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "Delete Product Collection", + "description": "This method deletes a product collection.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/product-collections/{productCollectionId}/products": { - "parameters": [ - { + "400": { + "description": "Returns an error indicating that the product collection with given ID is in use by other resources.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "productCollectionId", - "in": "path", - "required": true, - "description": "Unique product collection ID." - } - ], - "get": { - "operationId": "list-products-in-collection", - "tags": [ - "PRODUCT COLLECTIONS API" - ], - "summary": "List Products in Collection", - "description": "Retrieves list of products from a products collection; works for both dynamic and static product collections.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of products and/or SKUs grouped in the collection with each product's/SKU's details.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/product_collections_list_products_response_body" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "name": "Samsung Phone 2", - "price": 230000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 4" - }, - "image_url": "https://www.images.com/image4.png", - "created_at": "2022-09-12T14:44:13.212Z", - "updated_at": null, - "object": "product" - }, - { - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1", - "product_id": "prod_0bae2dc5a090fd0184", - "sku": "Samsung phone 256GB", - "price": 210000, - "attributes": { - "color": "vintage-black", - "memory": "256", - "processor": "Intel" - }, - "image_url": "https://www.website.com/image.png", - "metadata": { - "test": false, - "vendor": "Online Stores", - "imported": true - }, - "created_at": "2022-09-12T13:56:51.828Z", - "updated_at": "2022-09-12T14:09:40.859Z", - "object": "sku", - "product": { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone", - "price": null, - "attributes": [], - "metadata": {}, - "object": "product" - } - }, - { - "id": "prod_0bae2dc5a090fd0184", - "source_id": "first_product", - "name": "Samsung Phone 1", - "price": 220000, - "attributes": [ - "color", - "memory", - "processor" - ], - "metadata": { - "test": true, - "vendor": "Online Store - 3" - }, - "image_url": "https://www.images.com/image2.png", - "created_at": "2022-09-12T12:58:22.232Z", - "updated_at": "2022-09-12T14:44:13.208Z", - "object": "product" - }, - { - "id": "sku_0b7d7dfb090be5c619", - "source_id": "ComicBook_1", - "product_id": "prod_0b7d7dfb05cbe5c616", - "sku": "Comics1", - "price": 1700, - "attributes": {}, - "image_url": null, - "metadata": { - "color": [ - "golden" - ], - "vendor": "islands" - }, - "created_at": "2022-08-05T17:23:14.084Z", - "updated_at": "2022-09-09T09:24:43.806Z", - "object": "sku", - "product": { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": null, - "attributes": [], - "metadata": {}, - "object": "product" - } - }, - { - "id": "prod_0b7d7dfb05cbe5c616", - "source_id": "Books", - "name": "Comic Books1", - "price": 2100, - "attributes": [], - "metadata": { - "color": [ - "silver" - ], - "vendor": "Bookstore1" - }, - "image_url": "https://www.images.com/image1.png", - "created_at": "2022-08-05T17:23:14.071Z", - "updated_at": "2022-09-09T09:24:43.728Z", - "object": "product" - }, - { - "id": "prod_0b7d7c4e814be5c502", - "source_id": "prod_1", - "name": "Apple iPhone 12", - "price": 60000, - "attributes": [], - "metadata": { - "color": [ - "purple" - ], - "vendor": "mall" - }, - "image_url": null, - "created_at": "2022-08-05T17:15:55.270Z", - "updated_at": "2022-09-09T09:24:43.704Z", - "object": "product" - } - ], - "total": 6 - } - } - } - } - } - }, - "404": { - "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find products_collection with id pc_M5XgaWPx3Sl4v26atA15zFj", - "request_id": "v-0b4ec6429e5646d089", - "resource_id": "pc_M5XgaWPx3Sl4v26atA15zFj", - "resource_type": "products_collection" - } - } - } + "$ref": "#/components/schemas/e_400_resource_in_use" + }, + "examples": { + "Product Colllection In Use": { + "value": { + "code": 400, + "key": "resource_in_use", + "message": "Resource in use", + "details": "Resource products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j4 is in use by validation_ruless with ids [val_9TB89AjZeVEJ]", + "request_id": "v-0ae3a63aff940ed1b2", + "related_object_ids": [ + "val_9TB89AjZeVEJ" + ], + "related_object_type": "validation_rules" } } } } } }, - "/v1/validation-rule-object": { - "get": { - "operationId": "validation-rule-object", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Validation Rule Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Rule Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - } + "404": { + "description": "Returns an error indicating that the product collection with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Product Collection Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_41V4DiQQO8YGqj0J2oZD57j", + "request_id": "v-0ae3a49261d027b870", + "resource_id": "pc_41V4DiQQO8YGqj0J2oZD57j", + "resource_type": "products_collection" } } } } } + } + } + } + }, + "/v1/product-collections/{productCollectionId}/products": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/validation-rule-assignment-object": { - "get": { - "operationId": "validation-rule-assignment-object", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Validation Rule Assignment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Validation Rule Assignment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" - } + "name": "productCollectionId", + "in": "path", + "required": true, + "description": "Unique product collection ID." + } + ], + "get": { + "operationId": "list-products-in-collection", + "tags": [ + "PRODUCT COLLECTIONS API" + ], + "summary": "List Products in Collection", + "description": "Retrieves list of products from a products collection; works for both dynamic and static product collections.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of products and/or SKUs grouped in the collection with each product's/SKU's details.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/product_collections_list_products_response_body" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "name": "Samsung Phone 2", + "price": 230000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 4" + }, + "image_url": "https://www.images.com/image4.png", + "created_at": "2022-09-12T14:44:13.212Z", + "updated_at": null, + "object": "product" + }, + { + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1", + "product_id": "prod_0bae2dc5a090fd0184", + "sku": "Samsung phone 256GB", + "price": 210000, + "attributes": { + "color": "vintage-black", + "memory": "256", + "processor": "Intel" + }, + "image_url": "https://www.website.com/image.png", + "metadata": { + "test": false, + "vendor": "Online Stores", + "imported": true + }, + "created_at": "2022-09-12T13:56:51.828Z", + "updated_at": "2022-09-12T14:09:40.859Z", + "object": "sku", + "product": { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone", + "price": null, + "attributes": [], + "metadata": {}, + "object": "product" + } + }, + { + "id": "prod_0bae2dc5a090fd0184", + "source_id": "first_product", + "name": "Samsung Phone 1", + "price": 220000, + "attributes": [ + "color", + "memory", + "processor" + ], + "metadata": { + "test": true, + "vendor": "Online Store - 3" + }, + "image_url": "https://www.images.com/image2.png", + "created_at": "2022-09-12T12:58:22.232Z", + "updated_at": "2022-09-12T14:44:13.208Z", + "object": "product" + }, + { + "id": "sku_0b7d7dfb090be5c619", + "source_id": "ComicBook_1", + "product_id": "prod_0b7d7dfb05cbe5c616", + "sku": "Comics1", + "price": 1700, + "attributes": {}, + "image_url": null, + "metadata": { + "color": [ + "golden" + ], + "vendor": "islands" + }, + "created_at": "2022-08-05T17:23:14.084Z", + "updated_at": "2022-09-09T09:24:43.806Z", + "object": "sku", + "product": { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": null, + "attributes": [], + "metadata": {}, + "object": "product" + } + }, + { + "id": "prod_0b7d7dfb05cbe5c616", + "source_id": "Books", + "name": "Comic Books1", + "price": 2100, + "attributes": [], + "metadata": { + "color": [ + "silver" + ], + "vendor": "Bookstore1" + }, + "image_url": "https://www.images.com/image1.png", + "created_at": "2022-08-05T17:23:14.071Z", + "updated_at": "2022-09-09T09:24:43.728Z", + "object": "product" + }, + { + "id": "prod_0b7d7c4e814be5c502", + "source_id": "prod_1", + "name": "Apple iPhone 12", + "price": 60000, + "attributes": [], + "metadata": { + "color": [ + "purple" + ], + "vendor": "mall" + }, + "image_url": null, + "created_at": "2022-08-05T17:15:55.270Z", + "updated_at": "2022-09-09T09:24:43.704Z", + "object": "product" + } + ], + "total": 6 } } } } } }, - "/v1/validation-rules": { - "get": { - "operationId": "list-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rules", - "description": "Retrieve validation rules.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + "404": { + "description": "Returns an error when requesting a product collection that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "updated_at", - "-updated_at", - "name", - "-name" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of validation rules.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_res_list_validation_rules" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "val_auLlxlfTR9Ps", - "name": "Customer in Segment", - "rules": { - "1": { - "name": "customer.segment", - "rules": {}, - "property": null, - "conditions": { - "$is": [ - "seg_18tD3HR0h8ymPC07rBMLryk3" - ] - } - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-10T11:08:16.499Z", - "updated_at": "2021-12-10T12:01:41.665Z", - "type": "advanced", - "context_type": "earning_rule.order.paid", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_AvIe1WWuBXre", - "name": "Order Volume - Price of Any Item - = 1500 USD", - "rules": { - "1": { - "name": "order.items.price_any", - "rules": {}, - "property": null, - "conditions": { - "$is": [ - 150000 - ] - } - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-13T06:54:06.864Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" - }, - { - "id": "val_aZhPe4tQYMgr", - "name": "Business Validation Rule - excluded", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [ - { - "object": "products_collection", - "id": "pc_7fVU2RxybhR66YxC7r7BKKRh", - "source_id": null - }, - { - "object": "sku", - "id": "sku_0bae3b28f610fd0da1", - "source_id": "first_product_sku_1" - } - ], - "included": [], - "included_all": true - }, - "created_at": "2022-09-13T14:38:33.710Z", - "type": "basic", - "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_bbJCAXAWtYX0", - "name": "Business Validation Rule - Test - Discount Effect - Amount - Items - each unit of matched product", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [], - "included": [ - { - "object": "products_collection", - "id": "pc_a11pr0dUc75", - "source_id": null, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 1 - } - ], - "included_all": false - }, - "created_at": "2022-09-02T17:04:23.814Z", - "type": "basic", - "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", - "assignments_count": 1, - "object": "validation_rules" - }, - { - "id": "val_BkV21MUJGaiT", - "name": "Order Volume - Total Amount More than 100", - "rules": { - "1": { - "name": "order.amount", - "rules": {}, - "property": null, - "conditions": { - "$more_than": [ - 10000 - ] - } - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2021-12-10T14:01:10.750Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" - }, - { - "id": "val_BTQg027UGl0v", - "name": "Business Validation Rule - Get some $ off", - "rules": { - "logic": "" - }, - "applicable_to": { - "excluded": [], - "included": [ - { - "object": "product", - "id": "prod_0a41dd45dc85fcab40", - "source_id": "10474", - "strict": false - } - ], - "included_all": false - }, - "created_at": "2021-12-07T06:58:23.759Z", - "updated_at": "2021-12-22T08:11:18.773Z", - "type": "advanced", - "context_type": "campaign.discount_coupons.discount.apply_to_items", - "assignments_count": 1, - "object": "validation_rules" - } - ], - "total": 6 - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find products_collection with id pc_M5XgaWPx3Sl4v26atA15zFj", + "request_id": "v-0b4ec6429e5646d089", + "resource_id": "pc_M5XgaWPx3Sl4v26atA15zFj", + "resource_type": "products_collection" } } } } - }, - "post": { - "operationId": "create-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Create Validation Rules", - "description": "Create validation rules.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/validation-rule-object": { + "get": { + "operationId": "validation-rule-object", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Validation Rule Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Rule Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule" - }, - "examples": { - "Example": { - "value": { - "name": "Set of Validation Rules", - "error": { - "message": "Your order does not meet at least one of the required criteria." + } + } + } + } + } + }, + "/v1/validation-rule-assignment-object": { + "get": { + "operationId": "validation-rule-assignment-object", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Validation Rule Assignment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Validation Rule Assignment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + } + } + } + } + } + } + }, + "/v1/validation-rules": { + "get": { + "operationId": "list-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rules", + "description": "Retrieve validation rules.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "updated_at", + "-updated_at", + "name", + "-name" + ] + }, + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of validation rules.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_res_list_validation_rules" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "val_auLlxlfTR9Ps", + "name": "Customer in Segment", + "rules": { + "1": { + "name": "customer.segment", + "rules": {}, + "property": null, + "conditions": { + "$is": [ + "seg_18tD3HR0h8ymPC07rBMLryk3" + ] + } + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-10T11:08:16.499Z", + "updated_at": "2021-12-10T12:01:41.665Z", + "type": "advanced", + "context_type": "earning_rule.order.paid", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_AvIe1WWuBXre", + "name": "Order Volume - Price of Any Item - = 1500 USD", + "rules": { + "1": { + "name": "order.items.price_any", + "rules": {}, + "property": null, + "conditions": { + "$is": [ + 150000 + ] + } + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-13T06:54:06.864Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + }, + { + "id": "val_aZhPe4tQYMgr", + "name": "Business Validation Rule - excluded", + "rules": { + "logic": "" }, "applicable_to": { - "included_all": false, "excluded": [ { - "object": "product", - "id": "prod_0bae45ffc7003ffc52", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" + "object": "products_collection", + "id": "pc_7fVU2RxybhR66YxC7r7BKKRh", + "source_id": null + }, + { + "object": "sku", + "id": "sku_0bae3b28f610fd0da1", + "source_id": "first_product_sku_1" } ], + "included": [], + "included_all": true + }, + "created_at": "2022-09-13T14:38:33.710Z", + "type": "basic", + "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_bbJCAXAWtYX0", + "name": "Business Validation Rule - Test - Discount Effect - Amount - Items - each unit of matched product", + "rules": { + "logic": "" + }, + "applicable_to": { + "excluded": [], "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e344", - "source_id": null, - "effect": "APPLY_TO_MOST_EXPENSIVE", - "quantity_limit": 1 - }, { "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "id": "pc_a11pr0dUc75", "source_id": null, "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 + "quantity_limit": 1 } - ] + ], + "included_all": false }, + "created_at": "2022-09-02T17:04:23.814Z", + "type": "basic", + "context_type": "campaign.discount_coupons.discount.apply_to_items_by_quantity", + "assignments_count": 1, + "object": "validation_rules" + }, + { + "id": "val_BkV21MUJGaiT", + "name": "Order Volume - Total Amount More than 100", "rules": { "1": { - "name": "order.metadata", - "property": "location", - "rules": {}, - "conditions": { - "$is": [ - "Santorini" - ] - }, - "error": { - "message": "Your order must be placed at one of our Santorini shops." - } - }, - "2": { - "name": "custom_event.metadata", - "property": "test", + "name": "order.amount", "rules": {}, + "property": null, "conditions": { - "$greater_than_or_equal": [ - 1 + "$more_than": [ + 10000 ] } }, - "3": { - "name": "order.items.every", - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - } - } - }, - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2021-12-10T14:01:10.750Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + }, + { + "id": "val_BTQg027UGl0v", + "name": "Business Validation Rule - Get some $ off", + "rules": { + "logic": "" + }, + "applicable_to": { + "excluded": [], + "included": [ + { + "object": "product", + "id": "prod_0a41dd45dc85fcab40", + "source_id": "10474", + "strict": false } - }, - "logic": "1 or 2" - } + ], + "included_all": false + }, + "created_at": "2021-12-07T06:58:23.759Z", + "updated_at": "2021-12-22T08:11:18.773Z", + "type": "advanced", + "context_type": "campaign.discount_coupons.discount.apply_to_items", + "assignments_count": 1, + "object": "validation_rules" } - } + ], + "total": 6 } } - }, - "description": "Specify the validation rules parameters." + } + } + } + } + } + }, + "post": { + "operationId": "create-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Create Validation Rules", + "description": "Create validation rules.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule" }, - "responses": { - "200": { - "description": "Returns a validation rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" + "examples": { + "Example": { + "value": { + "name": "Set of Validation Rules", + "error": { + "message": "Your order does not meet at least one of the required criteria." + }, + "applicable_to": { + "included_all": false, + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffc52", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e344", + "source_id": null, + "effect": "APPLY_TO_MOST_EXPENSIVE", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 + } + ] + }, + "rules": { + "1": { + "name": "order.metadata", + "property": "location", + "rules": {}, + "conditions": { + "$is": [ + "Santorini" + ] + }, + "error": { + "message": "Your order must be placed at one of our Santorini shops." + } }, - "examples": { - "Example": { - "value": { - "id": "val_eR1c41hu0vUU", - "name": "Business Validation Rule", - "rules": { - "1": { - "name": "string", - "property": "string", - "conditions": { - "$one_of_voucherify_conditions": [ - "string" - ] - }, - "rules": { - "1": { - "name": "string", - "property": "string", - "conditions": {}, - "rules": {} - }, - "logic": "string" - }, - "error": { - "message": "string" - } - }, - "logic": "(1 and 2) and (3)" - }, - "error": { - "message": "string" - }, - "applicable_to": { - "excluded": [ - { - "object": "product", - "id": "string", - "source_id": "string", - "strict": true, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "string", - "source_id": "string", - "strict": true, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 0 - } - ], - "included_all": true - }, - "created_at": "2022-03-23T07:44:00.444Z", - "updated_at": "2022-04-26T08:35:54.960Z", - "type": "basic", - "context_type": "earning_rule.order.paid", - "object": "validation_rules" + "2": { + "name": "custom_event.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + }, + "3": { + "name": "order.items.every", + "rules": { + "1": { + "name": "order.items.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } } + }, + "conditions": { + "$is": [ + { + "id": "", + "effect": "APPLY_TO_EVERY", + "object": "product", + "source_id": "" + } + ] } - } + }, + "logic": "1 or 2" } } + } + } + } + }, + "description": "Specify the validation rules parameters." + }, + "responses": { + "200": { + "description": "Returns a validation rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" }, - "400": { - "description": "Returns an error if the request parameters were not specified correctly.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_validation_rules" + "examples": { + "Example": { + "value": { + "id": "val_eR1c41hu0vUU", + "name": "Business Validation Rule", + "rules": { + "1": { + "name": "string", + "property": "string", + "conditions": { + "$one_of_voucherify_conditions": [ + "string" + ] + }, + "rules": { + "1": { + "name": "string", + "property": "string", + "conditions": {}, + "rules": {} + }, + "logic": "string" + }, + "error": { + "message": "string" + } + }, + "logic": "(1 and 2) and (3)" }, - "examples": { - "Invalid Validation Rules": { - "value": { - "code": 400, - "key": "invalid_validation_rules", - "message": "Invalid Validation Rule Definition", - "details": "Rule 'custom_event.metadata' must have a 'property'" + "error": { + "message": "string" + }, + "applicable_to": { + "excluded": [ + { + "object": "product", + "id": "string", + "source_id": "string", + "strict": true, + "effect": "APPLY_TO_EVERY" } - } - } + ], + "included": [ + { + "object": "product", + "id": "string", + "source_id": "string", + "strict": true, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 0 + } + ], + "included_all": true + }, + "created_at": "2022-03-23T07:44:00.444Z", + "updated_at": "2022-04-26T08:35:54.960Z", + "type": "basic", + "context_type": "earning_rule.order.paid", + "object": "validation_rules" } } } } } }, - "/v1/validation-rules/{validationRuleId}": { - "parameters": [ - { + "400": { + "description": "Returns an error if the request parameters were not specified correctly.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "val_TU4de3EP4dlL" + "$ref": "#/components/schemas/e_400_invalid_validation_rules" }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "A unique validation rule ID." + "examples": { + "Invalid Validation Rules": { + "value": { + "code": 400, + "key": "invalid_validation_rules", + "message": "Invalid Validation Rule Definition", + "details": "Rule 'custom_event.metadata' must have a 'property'" + } + } + } } - ], - "get": { - "operationId": "get-validation-rule", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Get Validation Rule", - "description": "Retrieve the details of a validation rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/validation-rules/{validationRuleId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "val_TU4de3EP4dlL" + }, + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "A unique validation rule ID." + } + ], + "get": { + "operationId": "get-validation-rule", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Get Validation Rule", + "description": "Retrieve the details of a validation rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the validation rule object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "val_TU4de3EP4dlL", + "name": "Order is less than $40", + "rules": { + "1": { + "name": "order.amount", + "property": null, + "conditions": { + "$less_than": [ + 4000 + ] + }, + "rules": {} + }, + "logic": "1" + }, + "applicable_to": { + "excluded": [], + "included": [], + "included_all": false + }, + "created_at": "2022-08-11T16:42:13.630Z", + "type": "advanced", + "context_type": "reward_assignment.pay_with_points", + "object": "validation_rules" + } + } } - ], - "responses": { - "200": { - "description": "Returns the validation rule object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" - }, - "examples": { - "Example": { - "value": { - "id": "val_TU4de3EP4dlL", - "name": "Order is less than $40", - "rules": { - "1": { - "name": "order.amount", - "property": null, - "conditions": { - "$less_than": [ - 4000 - ] - }, - "rules": {} - }, - "logic": "1" - }, - "applicable_to": { - "excluded": [], - "included": [], - "included_all": false - }, - "created_at": "2022-08-11T16:42:13.630Z", - "type": "advanced", - "context_type": "reward_assignment.pay_with_points", - "object": "validation_rules" + } + } + } + } + }, + "put": { + "operationId": "update-validation-rule", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Update Validation Rule", + "description": "Update validation rule parameters.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the parameters to be updated.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule" + }, + "examples": { + "Example": { + "value": { + "name": "Set of Validation Rules Updated", + "error": { + "message": "Your orders do not meet at least one of the required criteria." + }, + "applicable_to": { + "included_all": false, + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffccc", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" + } + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e333", + "source_id": null, + "effect": "APPLY_TO_CHEAPEST", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 + } + ] + }, + "rules": { + "1": { + "name": "order.metadata", + "property": "place", + "rules": {}, + "conditions": { + "$is": [ + "Santorini" + ] + }, + "error": { + "message": "Your order must be placed at one of our Santorini shops on the beach." + } + }, + "2": { + "name": "custom_event.metadata", + "property": "lining", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } + }, + "3": { + "name": "order.items.every", + "rules": { + "1": { + "name": "order.items.metadata", + "property": "test", + "rules": {}, + "conditions": { + "$greater_than_or_equal": [ + 1 + ] + } } + }, + "conditions": { + "$is": [ + { + "id": "", + "effect": "APPLY_TO_EVERY", + "object": "product", + "source_id": "" + } + ] } - } + }, + "logic": "1 and 2" } } } } - }, - "put": { - "operationId": "update-validation-rule", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Update Validation Rule", - "description": "Update validation rule parameters.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule" - }, - "examples": { - "Example": { - "value": { - "name": "Set of Validation Rules Updated", + } + } + }, + "responses": { + "200": { + "description": "Returns the validation rule object with the updated parameters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "examples": { + "Example": { + "value": { + "id": "val_VZ91fqqtoVmw", + "name": "Set of Validation Rules Updated", + "rules": { + "1": { + "name": "order.metadata", + "property": "place", + "conditions": { + "$is": [ + "Santorini" + ] + }, + "rules": {}, "error": { - "message": "Your orders do not meet at least one of the required criteria." + "message": "Your order must be placed at one of our Santorini shops on the beach." + } + }, + "2": { + "name": "custom_event.metadata", + "property": "lining", + "conditions": { + "$greater_than_or_equal": [ + 1 + ] }, - "applicable_to": { - "included_all": false, - "excluded": [ - { - "object": "product", - "id": "prod_0bae45ffc7003ffccc", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e333", - "source_id": null, - "effect": "APPLY_TO_CHEAPEST", - "quantity_limit": 1 - }, + "rules": {} + }, + "3": { + "name": "order.items.every", + "conditions": { + "$is": [ { - "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "source_id": null, + "id": "", "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 + "object": "product", + "source_id": "" } ] }, "rules": { "1": { - "name": "order.metadata", - "property": "place", - "rules": {}, - "conditions": { - "$is": [ - "Santorini" - ] - }, - "error": { - "message": "Your order must be placed at one of our Santorini shops on the beach." - } - }, - "2": { - "name": "custom_event.metadata", - "property": "lining", - "rules": {}, + "name": "order.items.metadata", + "property": "test", "conditions": { "$greater_than_or_equal": [ 1 ] - } - }, - "3": { - "name": "order.items.every", - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "rules": {}, - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - } - } }, - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] - } - }, - "logic": "1 and 2" + "rules": {} + } } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the validation rule object with the updated parameters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_object" + }, + "logic": "1 and 2" }, - "examples": { - "Example": { - "value": { - "id": "val_VZ91fqqtoVmw", - "name": "Set of Validation Rules Updated", - "rules": { - "1": { - "name": "order.metadata", - "property": "place", - "conditions": { - "$is": [ - "Santorini" - ] - }, - "rules": {}, - "error": { - "message": "Your order must be placed at one of our Santorini shops on the beach." - } - }, - "2": { - "name": "custom_event.metadata", - "property": "lining", - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - }, - "rules": {} - }, - "3": { - "name": "order.items.every", - "conditions": { - "$is": [ - { - "id": "", - "effect": "APPLY_TO_EVERY", - "object": "product", - "source_id": "" - } - ] - }, - "rules": { - "1": { - "name": "order.items.metadata", - "property": "test", - "conditions": { - "$greater_than_or_equal": [ - 1 - ] - }, - "rules": {} - } - } - }, - "logic": "1 and 2" - }, - "error": { - "message": "Your orders do not meet at least one of the required criteria." - }, - "applicable_to": { - "excluded": [ - { - "object": "product", - "id": "prod_0bae45ffc7003ffccc", - "source_id": "second_product", - "strict": false, - "effect": "APPLY_TO_EVERY" - } - ], - "included": [ - { - "object": "product", - "id": "prod_0b72b00ffed198e333", - "source_id": null, - "strict": false, - "effect": "APPLY_TO_CHEAPEST", - "quantity_limit": 1 - }, - { - "object": "products_collection", - "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", - "source_id": null, - "strict": false, - "effect": "APPLY_TO_EVERY", - "quantity_limit": 5 - } - ], - "included_all": false - }, - "created_at": "2022-09-14T05:54:51.099Z", - "updated_at": "2022-09-14T06:06:32.855Z", - "type": "complex", - "context_type": "global", - "object": "validation_rules" + "error": { + "message": "Your orders do not meet at least one of the required criteria." + }, + "applicable_to": { + "excluded": [ + { + "object": "product", + "id": "prod_0bae45ffc7003ffccc", + "source_id": "second_product", + "strict": false, + "effect": "APPLY_TO_EVERY" } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-validation-rules", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Delete Validation Rule", - "description": "This method deletes a validation rule.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the validation rule with the given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Validation Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules with id val_TGN3rqZ8vEm", - "request_id": "v-0ae3b3436346b778be", - "resource_id": "val_TGN3rqZ8vEm", - "resource_type": "validation_rules" + ], + "included": [ + { + "object": "product", + "id": "prod_0b72b00ffed198e333", + "source_id": null, + "strict": false, + "effect": "APPLY_TO_CHEAPEST", + "quantity_limit": 1 + }, + { + "object": "products_collection", + "id": "pc_4ndRXAsTOzwSdHcQcxf489uU", + "source_id": null, + "strict": false, + "effect": "APPLY_TO_EVERY", + "quantity_limit": 5 } - } - } + ], + "included_all": false + }, + "created_at": "2022-09-14T05:54:51.099Z", + "updated_at": "2022-09-14T06:06:32.855Z", + "type": "complex", + "context_type": "global", + "object": "validation_rules" } } } } } + } + } + }, + "delete": { + "operationId": "delete-validation-rules", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Delete Validation Rule", + "description": "This method deletes a validation rule.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/validation-rules-assignments": { - "get": { - "operationId": "list-validation-rules-assignments", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rules' Assignment(s)", - "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "related_object_id", - "description": "The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution." - }, - { - "schema": { - "type": "string", - "example": "val_30Qo2rclFi4T" - }, - "in": "query", - "name": "rule", - "description": "Validation rule ID." - }, - { - "$ref": "#/components/parameters/page" - }, - { - "$ref": "#/components/parameters/limit" + "404": { + "description": "Returns an error indicating that the validation rule with the given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - { - "schema": { - "type": "string" - }, - "in": "query", - "description": "Sorts the results using one of the filtering options: `-created_at`, `created_at`, where the dash `-` preceding a sorting option means sorting in a descending order.", - "name": "order" - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary with a data property that contains an array of validation rule assignments. Each entry in the array is a separate object. If no more validation rule assignments are available, the resulting array will be empty. The result can be narrowed down according to default filters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_2S7Xm4dab4UvYAgm", - "rule_id": "val_5ix74ru7e", - "related_object_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", - "related_object_type": "campaign", - "created_at": "2022-02-08T10:49:30.534Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_sFV4wEFvldwIvgfb", - "rule_id": "val_ZEZmA9oit8aU", - "related_object_id": "distr_9QKI02wqgjWyvZXeQkFEPmkkYe", - "related_object_type": "distribution", - "created_at": "2022-06-29T11:41:07.680Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_8xelF5R4zB8ue168", - "rule_id": "val_ggDODO6fakMs", - "related_object_id": "ern_xrRuGEV7EW0X8wtMaze3HOfw", - "related_object_type": "earning_rule", - "created_at": "2022-02-28T12:25:56.783Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_tZaqxeO8gP4q91jG", - "rule_id": "val_WB6ETAiFztw5", - "related_object_id": "promo_kJliy076IuJYtuYWSHE9fSuT", - "related_object_type": "promotion_tier", - "created_at": "2022-08-10T10:30:39.986Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_xTMHiyPGSz3rp5m2", - "rule_id": "val_2AxnWmW2ra6X", - "related_object_id": "rewa_m9hEAu10KsPcLhGXiHG85aY0", - "related_object_type": "reward_assignment", - "created_at": "2021-12-10T11:38:35.922Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_DhlDn54JwqVFJzR6", - "rule_id": "val_eR1c41hu0vUU", - "related_object_id": "v_XuF7icVlUcVpHsSY9nG7n7yJa5wx27Va", - "related_object_type": "voucher", - "created_at": "2022-03-23T07:50:31.068Z", - "object": "validation_rules_assignment" - } - ], - "total": 6 - } - }, - "No Assignments": { - "value": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - } - } - } + "examples": { + "Validation Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules with id val_TGN3rqZ8vEm", + "request_id": "v-0ae3b3436346b778be", + "resource_id": "val_TGN3rqZ8vEm", + "resource_type": "validation_rules" } } } } } + } + } + } + }, + "/v1/validation-rules-assignments": { + "get": { + "operationId": "list-validation-rules-assignments", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rules' Assignment(s)", + "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "related_object_id", + "description": "The resource ID to which the validation rule was assigned; this could be, for example, a resource ID of a voucher, campaign, earning rule, reward assignment, promotion tier, or distribution." }, - "/v1/validation-rules/{validationRuleId}/assignments": { - "parameters": [ - { + { + "schema": { + "type": "string", + "example": "val_30Qo2rclFi4T" + }, + "in": "query", + "name": "rule", + "description": "Validation rule ID." + }, + { + "$ref": "#/components/parameters/page" + }, + { + "$ref": "#/components/parameters/limit" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "description": "Sorts the results using one of the filtering options: `-created_at`, `created_at`, where the dash `-` preceding a sorting option means sorting in a descending order.", + "name": "order" + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary with a data property that contains an array of validation rule assignments. Each entry in the array is a separate object. If no more validation rule assignments are available, the resulting array will be empty. The result can be narrowed down according to default filters.", + "content": { + "application/json": { "schema": { - "type": "string" - }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "Unique validation rule ID." - } - ], - "get": { - "operationId": "list-validation-rule-assignments", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "List Validation Rule Assignments", - "description": "Retrieve validation rule assignments for a specific validation rule.", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at" - ] - }, - "in": "query", - "name": "order", - "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary of validation rule assignments. If the validation rule ID provided in the path parameter cannot be found, the endpoint will return an empty `data` array and a total of `0`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_74F7QZoYbUoljwQO", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "related_object_type": "voucher", - "created_at": "2022-02-17T09:05:34.642Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_zzLBm8mIzGQStXl9", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", - "related_object_type": "voucher", - "created_at": "2022-02-17T08:18:15.085Z", - "object": "validation_rules_assignment" - }, - { - "id": "asgm_JztMAws0e0Qx2Xy6", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "camp_kjja4moiVB7hQKPGOT61026Z", - "related_object_type": "campaign", - "created_at": "2022-02-15T13:26:34.807Z", - "object": "validation_rules_assignment" - } - ], - "total": 3 - } + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_2S7Xm4dab4UvYAgm", + "rule_id": "val_5ix74ru7e", + "related_object_id": "camp_YDsFdX8TgFtT0RUuKEFyhqs3", + "related_object_type": "campaign", + "created_at": "2022-02-08T10:49:30.534Z", + "object": "validation_rules_assignment" }, - "No Assignments": { - "value": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - } + { + "id": "asgm_sFV4wEFvldwIvgfb", + "rule_id": "val_ZEZmA9oit8aU", + "related_object_id": "distr_9QKI02wqgjWyvZXeQkFEPmkkYe", + "related_object_type": "distribution", + "created_at": "2022-06-29T11:41:07.680Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_8xelF5R4zB8ue168", + "rule_id": "val_ggDODO6fakMs", + "related_object_id": "ern_xrRuGEV7EW0X8wtMaze3HOfw", + "related_object_type": "earning_rule", + "created_at": "2022-02-28T12:25:56.783Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_tZaqxeO8gP4q91jG", + "rule_id": "val_WB6ETAiFztw5", + "related_object_id": "promo_kJliy076IuJYtuYWSHE9fSuT", + "related_object_type": "promotion_tier", + "created_at": "2022-08-10T10:30:39.986Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_xTMHiyPGSz3rp5m2", + "rule_id": "val_2AxnWmW2ra6X", + "related_object_id": "rewa_m9hEAu10KsPcLhGXiHG85aY0", + "related_object_type": "reward_assignment", + "created_at": "2021-12-10T11:38:35.922Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_DhlDn54JwqVFJzR6", + "rule_id": "val_eR1c41hu0vUU", + "related_object_id": "v_XuF7icVlUcVpHsSY9nG7n7yJa5wx27Va", + "related_object_type": "voucher", + "created_at": "2022-03-23T07:50:31.068Z", + "object": "validation_rules_assignment" } - } + ], + "total": 6 + } + }, + "No Assignments": { + "value": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 } } } } + } + } + } + } + }, + "/v1/validation-rules/{validationRuleId}/assignments": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "Unique validation rule ID." + } + ], + "get": { + "operationId": "list-validation-rule-assignments", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "List Validation Rule Assignments", + "description": "Retrieve validation rule assignments for a specific validation rule.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at" + ] }, - "post": { - "operationId": "create-validation-rule-assignment", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Create Validation Rules Assignments", - "description": "Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the resource that you would like to assign the validation rule to.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_req_create_validation_rule_assignments" - }, - "examples": { - "Voucher": { - "value": { - "voucher": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" - } - }, - "Campaign": { - "value": { - "campaign": "camp_Rv9EuIrkT08YEORb2pUMGSUo" - } - }, - "Distribution": { - "value": { - "distribution": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" + "in": "query", + "name": "order", + "description": "This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of validation rule assignments. If the validation rule ID provided in the path parameter cannot be found, the endpoint will return an empty `data` array and a total of `0`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_74F7QZoYbUoljwQO", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "related_object_type": "voucher", + "created_at": "2022-02-17T09:05:34.642Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_zzLBm8mIzGQStXl9", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT", + "related_object_type": "voucher", + "created_at": "2022-02-17T08:18:15.085Z", + "object": "validation_rules_assignment" + }, + { + "id": "asgm_JztMAws0e0Qx2Xy6", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "camp_kjja4moiVB7hQKPGOT61026Z", + "related_object_type": "campaign", + "created_at": "2022-02-15T13:26:34.807Z", + "object": "validation_rules_assignment" } - } + ], + "total": 3 + } + }, + "No Assignments": { + "value": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 } } } + } + } + } + } + }, + "post": { + "operationId": "create-validation-rule-assignment", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Create Validation Rules Assignments", + "description": "Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the resource that you would like to assign the validation rule to.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/13_req_create_validation_rule_assignments" }, - "responses": { - "200": { - "description": "Returns a validation rules assignment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" - }, - "examples": { - "Example": { - "value": { - "id": "asgm_kPPiNW3smQLRMWiF", - "rule_id": "val_ZEZmA9oit8aU", - "related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo", - "related_object_type": "campaign", - "created_at": "2022-09-14T07:06:49.557Z", - "object": "validation_rules_assignment" - } - } - } - } + "examples": { + "Voucher": { + "value": { + "voucher": "v_ssR6vhswwh5odSloN2Vc3O60w7aea018" } }, - "409": { - "description": "Returns an error if an duplicate assignment is found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" - }, - "examples": { - "Duplicate": { - "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated validation_rules_assignment exists with id asgm_ixJEwQbUv8hfPlhO", - "request_id": "v-0bb06fd1c3478dcb47", - "resource_id": "asgm_ixJEwQbUv8hfPlhO", - "resource_type": "validation_rules_assignment" - } - } - } - } + "Campaign": { + "value": { + "campaign": "camp_Rv9EuIrkT08YEORb2pUMGSUo" + } + }, + "Distribution": { + "value": { + "distribution": "distr_2nUIekYnS9L1Vm1I55vmC7kSvd" } } } } - }, - "/v1/validation-rules/{validationRuleId}/assignments/{assignmentId}": { - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "validationRuleId", - "in": "path", - "required": true, - "description": "A unique validation rule ID." - }, - { + } + }, + "responses": { + "200": { + "description": "Returns a validation rules assignment object.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" }, - "name": "assignmentId", - "in": "path", - "required": true, - "description": "A unique validation rule assignment ID." - } - ], - "delete": { - "operationId": "delete-validation-rule-assignment", - "tags": [ - "VALIDATION RULES API" - ], - "summary": "Delete Validation Rule Assignment", - "description": "This method deletes a validation rule assignment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the validation rule or validation rule assignment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Validation Rule Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules with id val_4j7DCRm2IS5", - "request_id": "v-0ae3b84bac0683f697", - "resource_id": "val_4j7DCRm2IS5", - "resource_type": "validation_rules" - } - }, - "Validation Rule Assignment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find validation_rules_assignment with id asgm_tDN7MJNayjrf1wy", - "request_id": "v-0ae3b87eeb9027c916", - "resource_id": "asgm_tDN7MJNayjrf1wy", - "resource_type": "validation_rules_assignment" - } - } - } + "examples": { + "Example": { + "value": { + "id": "asgm_kPPiNW3smQLRMWiF", + "rule_id": "val_ZEZmA9oit8aU", + "related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo", + "related_object_type": "campaign", + "created_at": "2022-09-14T07:06:49.557Z", + "object": "validation_rules_assignment" } } } } } }, - "/v1/segments/{segmentId}": { - "parameters": [ - { + "409": { + "description": "Returns an error if an duplicate assignment is found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" - }, - "name": "segmentId", - "in": "path", - "required": true, - "description": "A unique customer segment ID." - } - ], - "get": { - "operationId": "get-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Get Segment", - "description": "Retrieves the segment with given segment ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns segment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" - }, - "examples": { - "Tier Segment": { - "value": { - "id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI2", - "name": "Tiers 2 - Senior", - "created_at": "2022-06-09T13:21:26.656Z", - "type": "auto-update", - "filter": { - "junction": "and", - "loyalty_points.campaigns.Tiers 2.points": { - "conditions": { - "$more_than_equal": [ - 41 - ] - } - } - }, - "initial_sync_status": "DONE", - "object": "segment" - } - } - } - } - } + "$ref": "#/components/schemas/e_409_duplicate_found" }, - "404": { - "description": "Returns an error when requesting a segment that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find segment with id seg_Mv5w1b2FIEbiCCO5ioT8TfI", - "request_id": "v-0b4d7a37a105797650", - "resource_id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI", - "resource_type": "segment" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Delete Segment", - "description": "This method deletes a customer segment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the customer segment with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Customer Segment Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find segment with id seg_DNAOhUtJffvX0f57ajLMFBY", - "request_id": "v-0ae3bb40409027cb63", - "resource_id": "seg_DNAOhUtJffvX0f57ajLMFBY", - "resource_type": "segment" - } - } - } + "examples": { + "Duplicate": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated validation_rules_assignment exists with id asgm_ixJEwQbUv8hfPlhO", + "request_id": "v-0bb06fd1c3478dcb47", + "resource_id": "asgm_ixJEwQbUv8hfPlhO", + "resource_type": "validation_rules_assignment" } } } } } + } + } + } + }, + "/v1/validation-rules/{validationRuleId}/assignments/{assignmentId}": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/customer-segment-object": { - "get": { - "operationId": "customer-segment-object", - "tags": [ - "SEGMENTS API" - ], - "summary": "Customer Segment Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Customer Segment Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" - } + "name": "validationRuleId", + "in": "path", + "required": true, + "description": "A unique validation rule ID." + }, + { + "schema": { + "type": "string" + }, + "name": "assignmentId", + "in": "path", + "required": true, + "description": "A unique validation rule assignment ID." + } + ], + "delete": { + "operationId": "delete-validation-rule-assignment", + "tags": [ + "VALIDATION RULES API" + ], + "summary": "Delete Validation Rule Assignment", + "description": "This method deletes a validation rule assignment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the validation rule or validation rule assignment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Validation Rule Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules with id val_4j7DCRm2IS5", + "request_id": "v-0ae3b84bac0683f697", + "resource_id": "val_4j7DCRm2IS5", + "resource_type": "validation_rules" + } + }, + "Validation Rule Assignment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find validation_rules_assignment with id asgm_tDN7MJNayjrf1wy", + "request_id": "v-0ae3b87eeb9027c916", + "resource_id": "asgm_tDN7MJNayjrf1wy", + "resource_type": "validation_rules_assignment" } } } } } + } + } + } + }, + "/v1/segments/{segmentId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "seg_DNAOhUtJffvX0f57ajLMFBYR" }, - "/v1/segments": { - "post": { - "operationId": "create-segment", - "tags": [ - "SEGMENTS API" - ], - "summary": "Create Segment", - "description": "Create a customer segment.\n\n> 🚧 Limit on Static Segments\n>\n> There is a cap on the number of customers that you can assign to a static segment: **20,000**. If you would like to create a bigger segment, then you can use the unlimited auto-update segment instead and use some customer metadata to build this segment.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the boundary conditions for the customer segment.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_req_create_segment" - }, - "examples": { - "Static Segment": { - "value": { - "name": "Customers in a new Segment", - "type": "static", - "customers": [ - "cust_iajsExT2QB4sGWzABY85WRqV", - "cust_sehkNIi8Uq2qQuRqSr7xn4Zi" - ] - } - }, - "Dynamic": { - "value": { - "name": "Customers in a new Dynamic Segment", - "type": "auto-update", - "filter": { - "junction": "and", - "created_at": { - "conditions": { - "$after": [ - "2021-12-01T00:00:00.000Z" - ] - } - } + "name": "segmentId", + "in": "path", + "required": true, + "description": "A unique customer segment ID." + } + ], + "get": { + "operationId": "get-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Get Segment", + "description": "Retrieves the segment with given segment ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns segment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + }, + "examples": { + "Tier Segment": { + "value": { + "id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI2", + "name": "Tiers 2 - Senior", + "created_at": "2022-06-09T13:21:26.656Z", + "type": "auto-update", + "filter": { + "junction": "and", + "loyalty_points.campaigns.Tiers 2.points": { + "conditions": { + "$more_than_equal": [ + 41 + ] } } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns a customer segment object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/14_obj_segment_object" }, - "examples": { - "Static": { - "value": { - "id": "seg_vC8iOSCqUG02EsPzsHynLv8i", - "name": "Customers in a new Segment", - "created_at": "2022-09-13T08:57:15.801Z", - "type": "static", - "filter": null, - "initial_sync_status": "DONE", - "object": "segment" - } - }, - "Dynamic": { - "value": { - "id": "seg_nZULMFHhVWIFm9vQ0dytg83Q", - "name": "Customers in a new Dynamic Segment", - "created_at": "2022-09-13T09:03:32.764Z", - "type": "auto-update", - "filter": { - "junction": "and", - "created_at": { - "conditions": { - "$after": [ - "2021-12-01T00:00:00.000Z" - ] - } - } - }, - "initial_sync_status": "IN_PROGRESS", - "object": "segment" - } - } - } + "initial_sync_status": "DONE", + "object": "segment" } } } } } }, - "/v1/custom-event-object": { - "get": { - "operationId": "custom-event-object", - "tags": [ - "EVENTS API" - ], - "summary": "Custom Event Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Custom Event Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - } + "404": { + "description": "Returns an error when requesting a segment that has been deleted or does not exist.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find segment with id seg_Mv5w1b2FIEbiCCO5ioT8TfI", + "request_id": "v-0b4d7a37a105797650", + "resource_id": "seg_Mv5w1b2FIEbiCCO5ioT8TfI", + "resource_type": "segment" } } } } } + } + } + }, + "delete": { + "operationId": "delete-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Delete Segment", + "description": "This method deletes a customer segment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/events": { - "post": { - "operationId": "track-custom-event", - "tags": [ - "EVENTS API" - ], - "summary": "Track Custom Event", - "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the custom event.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - }, - "examples": { - "Example": { - "value": { - "event": "event-name", - "customer": { - "source_id": "referee-source_id" - }, - "referral": { - "code": "voucher-code", - "referrer_id": "referrer-source_id" - } - } - }, - "Referral triggered by custom event": { - "value": { - "event": "user_subscribed", - "customer": { - "source_id": "source_customer_event" - }, - "referral": { - "code": "46jL0kYI", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "metadata": { - "login": "bob", - "pricing_plan": "PP1", - "volume_number": 4 - } - } - }, - "Earning rule triggered by custom event": { - "value": { - "event": "cart_abandoned", - "customer": { - "source_id": "source_customer_event" - }, - "loyalty": { - "code": "6CB4KDAu" - }, - "metadata": { - "date": "2022-12-01", - "flag": true, - "text": "Cart abandoned event", - "date_time": "2022-12-01T09:24:33.061Z", - "number": 1 - } - } - } + "404": { + "description": "Returns an error indicating that the customer segment with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Customer Segment Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find segment with id seg_DNAOhUtJffvX0f57ajLMFBY", + "request_id": "v-0ae3bb40409027cb63", + "resource_id": "seg_DNAOhUtJffvX0f57ajLMFBY", + "resource_type": "segment" } } } + } + } + } + } + } + }, + "/v1/customer-segment-object": { + "get": { + "operationId": "customer-segment-object", + "tags": [ + "SEGMENTS API" + ], + "summary": "Customer Segment Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Customer Segment Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + } + } + } + } + } + } + }, + "/v1/segments": { + "post": { + "operationId": "create-segment", + "tags": [ + "SEGMENTS API" + ], + "summary": "Create Segment", + "description": "Create a customer segment.\n\n> 🚧 Limit on Static Segments\n>\n> There is a cap on the number of customers that you can assign to a static segment: **20,000**. If you would like to create a bigger segment, then you can use the unlimited auto-update segment instead and use some customer metadata to build this segment.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the boundary conditions for the customer segment.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_req_create_segment" }, - "responses": { - "200": { - "description": "Returns the event type if the event was received by the application.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_res_track_custom_event" - }, - "examples": { - "Example": { - "value": { - "object": "event", - "type": "cart_abandoned", - "customer": {}, - "referral": null, - "loyalty": null - } - } - } - } + "examples": { + "Static Segment": { + "value": { + "name": "Customers in a new Segment", + "type": "static", + "customers": [ + "cust_iajsExT2QB4sGWzABY85WRqV", + "cust_sehkNIi8Uq2qQuRqSr7xn4Zi" + ] } }, - "400": { - "description": "Returns an error if the request payload is incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .referral should have required property 'code'", - "request_id": "v-0c15694e0e022146dd" - } + "Dynamic": { + "value": { + "name": "Customers in a new Dynamic Segment", + "type": "auto-update", + "filter": { + "junction": "and", + "created_at": { + "conditions": { + "$after": [ + "2021-12-01T00:00:00.000Z" + ] } } } @@ -82498,3321 +82381,3508 @@ } } } - }, - "/client/v1/events": { - "post": { - "operationId": "track-custom-event-client-side", - "tags": [ - "EVENTS API" - ], - "summary": "Track Custom Event (client-side)", - "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the custom event.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_req_track_custom_event" - }, - "examples": { - "Referral triggered by custom event": { - "value": { - "event": "user_subscribed", - "customer": { - "source_id": "source_customer_event" - }, - "referral": { - "code": "46jL0kYI", - "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, - "metadata": { - "login": "bob", - "pricing_plan": "PP1", - "volume_number": 4 + } + }, + "responses": { + "200": { + "description": "Returns a customer segment object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/14_obj_segment_object" + }, + "examples": { + "Static": { + "value": { + "id": "seg_vC8iOSCqUG02EsPzsHynLv8i", + "name": "Customers in a new Segment", + "created_at": "2022-09-13T08:57:15.801Z", + "type": "static", + "filter": null, + "initial_sync_status": "DONE", + "object": "segment" + } + }, + "Dynamic": { + "value": { + "id": "seg_nZULMFHhVWIFm9vQ0dytg83Q", + "name": "Customers in a new Dynamic Segment", + "created_at": "2022-09-13T09:03:32.764Z", + "type": "auto-update", + "filter": { + "junction": "and", + "created_at": { + "conditions": { + "$after": [ + "2021-12-01T00:00:00.000Z" + ] } } }, - "Earning rule triggered by custom event": { - "value": { - "event": "cart_abandoned", - "customer": { - "source_id": "source_customer_event" - }, - "loyalty": { - "code": "6CB4KDAu" - }, - "metadata": { - "date": "2022-12-01", - "flag": true, - "text": "Cart abandoned event", - "date_time": "2022-12-01T09:24:33.061Z", - "number": 1 - } - } - } + "initial_sync_status": "IN_PROGRESS", + "object": "segment" } } } + } + } + } + } + } + }, + "/v1/custom-event-object": { + "get": { + "operationId": "custom-event-object", + "tags": [ + "EVENTS API" + ], + "summary": "Custom Event Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Custom Event Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" + } + } + } + } + } + } + }, + "/v1/events": { + "post": { + "operationId": "track-custom-event", + "tags": [ + "EVENTS API" + ], + "summary": "Track Custom Event", + "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the custom event.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" }, - "responses": { - "200": { - "description": "Returns the event type if the event was received by the application.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/15_res_track_custom_event" - }, - "examples": { - "Example": { - "value": { - "object": "event", - "type": "cart_abandoned", - "customer": {}, - "referral": null, - "loyalty": null - } - } - } + "examples": { + "Example": { + "value": { + "event": "event-name", + "customer": { + "source_id": "referee-source_id" + }, + "referral": { + "code": "voucher-code", + "referrer_id": "referrer-source_id" } } }, - "400": { - "description": "Returns an error if the request payload is incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .referral should have required property 'code'", - "request_id": "v-0c15694e0e022146dd" - } - } - } + "Referral triggered by custom event": { + "value": { + "event": "user_subscribed", + "customer": { + "source_id": "source_customer_event" + }, + "referral": { + "code": "46jL0kYI", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "metadata": { + "login": "bob", + "pricing_plan": "PP1", + "volume_number": 4 + } + } + }, + "Earning rule triggered by custom event": { + "value": { + "event": "cart_abandoned", + "customer": { + "source_id": "source_customer_event" + }, + "loyalty": { + "code": "6CB4KDAu" + }, + "metadata": { + "date": "2022-12-01", + "flag": true, + "text": "Cart abandoned event", + "date_time": "2022-12-01T09:24:33.061Z", + "number": 1 } } } } } - }, - "/v1/consents-object": { - "get": { - "operationId": "consents-object", - "tags": [ - "CONSENTS API" - ], - "summary": "Consents Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Consents Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" - } + } + }, + "responses": { + "200": { + "description": "Returns the event type if the event was received by the application.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_res_track_custom_event" + }, + "examples": { + "Example": { + "value": { + "object": "event", + "type": "cart_abandoned", + "customer": {}, + "referral": null, + "loyalty": null } } } } } }, - "/v1/consents": { - "get": { - "operationId": "list-consents", - "tags": [ - "CONSENTS API" - ], - "summary": "List Consents", - "description": "List the Marketing Permission definitions within the project along with opt-in consents.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns marketing permission groups and opt-in consents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" - }, - "examples": { - "Marketing Permissions Groups and Consents": { - "value": { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" - }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" - } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" - }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" - } - ], - "total": 2 - } - } - } - } + "400": { + "description": "Returns an error if the request payload is incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .referral should have required property 'code'", + "request_id": "v-0c15694e0e022146dd" } } } } } - }, - "/client/v1/consents#": { - "get": { - "operationId": "list-consents-client-side", - "tags": [ - "CONSENTS API" - ], - "summary": "List Consents (client-side)", - "description": "List the Marketing Permission definitions within the project along with opt-in consents.", - "parameters": [ - { - "$ref": "#/components/parameters/origin" - } - ], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns marketing permission groups and opt-in consents.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/18_res_list_consents_GET" - }, - "examples": { - "Marketing Permissions Groups and Consents": { - "value": { - "groups": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", - "name": "Consent group", - "description": "Consent group", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T09:12:47.743Z", - "updated_at": "2022-04-13T09:45:46.616Z", - "object": "consent_group" - }, - { - "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", - "name": "Consent group 2", - "description": "Consent group 2", - "consents": [ - "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "cnst_VCmucIvAsmDYw2PPAok6bcYy" - ], - "created_at": "2022-04-13T10:03:46.564Z", - "updated_at": null, - "object": "consent_group" - } - ], - "total": 2 - }, - "consents": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", - "name": "Consent", - "description": "Consent for marketing", - "category": "New", - "created_at": "2022-04-13T09:11:27.037Z", - "updated_at": null, - "object": "consent" - }, - { - "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", - "name": "Consent 2", - "description": "Consent 2", - "category": "Trial", - "created_at": "2022-04-13T09:45:37.597Z", - "updated_at": null, - "object": "consent" - } - ], - "total": 2 - } - } - } - } + } + } + } + }, + "/client/v1/events": { + "post": { + "operationId": "track-custom-event-client-side", + "tags": [ + "EVENTS API" + ], + "summary": "Track Custom Event (client-side)", + "description": "To track a custom event, you create an event object. \n\nThe event object must be linked to the customer who performs the action. If a customer doesn't exist in Voucherify, the customer will be created.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the custom event.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_req_track_custom_event" + }, + "examples": { + "Referral triggered by custom event": { + "value": { + "event": "user_subscribed", + "customer": { + "source_id": "source_customer_event" + }, + "referral": { + "code": "46jL0kYI", + "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" + }, + "metadata": { + "login": "bob", + "pricing_plan": "PP1", + "volume_number": 4 + } + } + }, + "Earning rule triggered by custom event": { + "value": { + "event": "cart_abandoned", + "customer": { + "source_id": "source_customer_event" + }, + "loyalty": { + "code": "6CB4KDAu" + }, + "metadata": { + "date": "2022-12-01", + "flag": true, + "text": "Cart abandoned event", + "date_time": "2022-12-01T09:24:33.061Z", + "number": 1 } } } } } - }, - "/v1/async-action-object": { - "get": { - "operationId": "async-action-object", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "Async Action Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Async Action Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_obj_async_action_object" - } + } + }, + "responses": { + "200": { + "description": "Returns the event type if the event was received by the application.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/15_res_track_custom_event" + }, + "examples": { + "Example": { + "value": { + "object": "event", + "type": "cart_abandoned", + "customer": {}, + "referral": null, + "loyalty": null } } } } } }, - "/v1/async-actions": { - "get": { - "operationId": "list-async-actions", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "List Async Actions", - "description": "Track asynchronous operations scheduled in your project. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
                  • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
                  • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
                    • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
                      |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
                      |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
                      CUSTOMERS.METADATA_KEY_PURGE
                      PRODUCTS.METADATA_KEY_PURGE
                      VOUCHERS.METADATA_KEY_PURGE
                      ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", - "parameters": [ - { - "schema": { - "type": "integer" - }, - "in": "query", - "name": "limit", - "description": "Limit the number of asynchronous actions that the API returns in the response." + "400": { + "description": "Returns an error if the request payload is incomplete.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" }, - { - "schema": { - "type": "string", - "example": "2021-09-08T13:52:18.227Z", - "format": "date-time" - }, - "in": "query", - "name": "end_date", - "description": "Limits results to actions scheduled before the `end_date`. The date format needs to be consistent with ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). " + "examples": { + "Invalid payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .referral should have required property 'code'", + "request_id": "v-0c15694e0e022146dd" + } + } } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + } + }, + "/v1/consents-object": { + "get": { + "operationId": "consents-object", + "tags": [ + "CONSENTS API" + ], + "summary": "Consents Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Consents Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/18_res_list_consents_GET" } - ], - "responses": { - "200": { - "description": "Returns a list of all scheduled asynchronous actions and detailed information for each scheduled action. Note that a status `DONE`doesn't include the result of the completed action. If you need more information about the result, use the ID of the respective async action to call the [Get Async Action](ref:get-async-action) endpoint.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_res_list_async_actions_GET" - }, - "examples": { - "List Async Actions": { - "value": { - "object": "list", - "data_ref": "async_actions", - "async_actions": [ - { - "id": "aa_0ba518c55290c6fd62", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "created_at": "2022-09-05T11:40:17.098Z", - "updated_at": "2022-09-05T11:40:17.887Z", - "request_id": "v-0ba518c52bc99858f0", - "progress": 100, - "object": "async_action" - }, - { - "id": "aa_0ba50a7ff4d3574568", - "type": "CUSTOMERS.METADATA_UPDATE", - "status": "DONE", - "created_at": "2022-09-05T10:37:56.051Z", - "updated_at": "2022-09-05T10:37:56.862Z", - "request_id": "v-0ba50a7feb49984902", - "progress": 100, - "object": "async_action" - } - ] + } + } + } + } + } + }, + "/v1/consents": { + "get": { + "operationId": "list-consents", + "tags": [ + "CONSENTS API" + ], + "summary": "List Consents", + "description": "List the Marketing Permission definitions within the project along with opt-in consents.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns marketing permission groups and opt-in consents.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/18_res_list_consents_GET" + }, + "examples": { + "Marketing Permissions Groups and Consents": { + "value": { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" + }, + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" } - } - } - } - } - }, - "400": { - "description": "Returns an error if incorrect query parameters were provided.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" + ], + "total": 2 }, - "examples": { - "Invalid Query Parameters": { - "value": { - "code": 400, - "key": "invalid_query_params", - "message": "Invalid query params", - "details": "Property .end_date cannot be recognized as a ISO-8601 compliant date", - "request_id": "v-0c54493e444b0f61a6" + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" + }, + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" } - } + ], + "total": 2 } } } } } } - }, - "/v1/async-actions/{asyncActionId}": { - "parameters": [ - { + } + } + } + }, + "/client/v1/consents#": { + "get": { + "operationId": "list-consents-client-side", + "tags": [ + "CONSENTS API" + ], + "summary": "List Consents (client-side)", + "description": "List the Marketing Permission definitions within the project along with opt-in consents.", + "parameters": [ + { + "$ref": "#/components/parameters/origin" + } + ], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns marketing permission groups and opt-in consents.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "aa_0afb3d009a55814a48" - }, - "name": "asyncActionId", - "in": "path", - "required": true, - "description": "Unique ID of the asynchronous operation." - } - ], - "get": { - "operationId": "get-async-action", - "tags": [ - "ASYNC ACTIONS API" - ], - "summary": "Get Async Action", - "description": "Check the result of a scheduled asynchronous operation. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
                      • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
                      • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
                        • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
                          |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
                          |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
                          CUSTOMERS.METADATA_KEY_PURGE
                          PRODUCTS.METADATA_KEY_PURGE
                          VOUCHERS.METADATA_KEY_PURGE
                          ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns detailed information about the async action result.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/17_obj_async_action_object" - }, - "examples": { - "CAMPAIGN.VOUCHERS_IMPORT": { - "value": { - "id": "aa_0af9b22296cf473a10", - "type": "CAMPAIGN.VOUCHERS_IMPORT", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 3 failed.", - "failed": [ - { - "code": "CODE9", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - }, - { - "code": "CODE8", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - }, - { - "code": "CODE7", - "reason": "unit: must be a number, property is required (actual value is 'EUR')" - } - ], - "done_count": 0, - "failed_count": 3 - }, - "created_at": "2023-01-20T07:23:43.289Z", - "updated_at": "2023-01-20T07:23:44.044Z", - "request_id": "v-0c553fdb325688d510", - "progress": 100, - "processing_time": 755, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_IMPORT_CSV": { - "value": { - "id": "aa_0c5543f00797b6113f", - "type": "CUSTOMERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 customer(s) imported successfully, 2 failed.", - "failed": [ - { - "source_id": "test-user@voucherify.io", - "row": 1, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" - }, - { - "source_id": "", - "row": 2, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" - } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T07:41:33.086Z", - "updated_at": "2023-01-20T07:41:33.216Z", - "request_id": "v-0c5543eff2cb0f547f", - "progress": 100, - "processing_time": 130, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_DELETE": { - "value": { - "id": "aa_0c553853d957b67bd4", - "type": "CAMPAIGN.VOUCHERS_DELETE", - "status": "DONE", - "result": { - "message": "Deleted 2 vouchers.", - "done_count": 2 - }, - "created_at": "2023-01-20T06:50:49.573Z", - "updated_at": "2023-01-20T06:50:50.053Z", - "request_id": "v-0c553853b5c418c826", - "progress": 100, - "processing_time": 480, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_UPDATE": { - "value": { - "id": "aa_0c5440c25c0e5728d0", - "type": "CAMPAIGN.VOUCHERS_UPDATE", - "status": "DONE", - "result": { - "message": "Updated 1 vouchers.", - "done_count": 1 - }, - "created_at": "2023-01-19T12:49:11.024Z", - "updated_at": "2023-01-19T12:49:11.852Z", - "request_id": "v-0c5440c24304189e44", - "progress": 100, - "processing_time": 828, - "object": "async_action" - } - }, - "CAMPAIGN.VOUCHERS_GENERATE": { - "value": { - "id": "aa_0c54441d14d7b60014", - "type": "CAMPAIGN.VOUCHERS_GENERATE", - "status": "DONE", - "result": { - "message": "Generated 2 vouchers.", - "done_count": 2 - }, - "created_at": "2023-01-19T13:03:50.355Z", - "updated_at": "2023-01-19T13:03:51.030Z", - "request_id": "v-0c54441d0e4418b647", - "progress": 100, - "processing_time": 675, - "object": "async_action" - } - }, - "CAMPAIGNS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c554b22664a0eb5fc", - "type": "CAMPAIGNS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 0 campaigns.", - "done_count": 0 - }, - "created_at": "2023-01-20T08:12:59.673Z", - "updated_at": "2023-01-20T08:13:00.638Z", - "request_id": "w-0c554b225f8a0eb5fb", - "progress": 100, - "processing_time": 965, - "object": "async_action" - } - }, - "CUSTOMERS.IMPORT_CSV": { - "value": { - "id": "aa_0c5543f00797b6113f", - "type": "CUSTOMERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 customer(s) imported successfully, 2 failed.", - "failed": [ - { - "source_id": "test-user@voucherify.io", - "row": 1, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" - }, - { - "source_id": "", - "row": 2, - "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" - } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T07:41:33.086Z", - "updated_at": "2023-01-20T07:41:33.216Z", - "request_id": "v-0c5543eff2cb0f547f", - "progress": 100, - "processing_time": 130, - "object": "async_action" - } - }, - "CUSTOMERS.BULK_UPDATE": { - "value": { - "id": "aa_0c5547cc5e17b617b6", - "type": "CUSTOMERS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "source_id_1", - "updated": true, - "found": true - }, - { - "source_id": "source_id_2", - "updated": true, - "found": true - }, - { - "source_id": "source_id_3", - "updated": true, - "found": true - } - ], - "done_count": 3 - }, - "created_at": "2023-01-20T07:58:25.144Z", - "updated_at": "2023-01-20T07:58:25.869Z", - "request_id": "v-0c5547cc4d8b0f5be4", - "progress": 100, - "processing_time": 725, - "object": "async_action" - } - }, - "CUSTOMERS.METADATA_UPDATE": { - "value": { - "id": "aa_0c554a92030e576181", - "type": "CUSTOMERS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "source_1", - "updated": true, - "found": true - }, - { - "source_id": "source_2", - "updated": true, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:10:31.821Z", - "updated_at": "2023-01-20T08:10:32.564Z", - "request_id": "v-0c554a91fb4b0f61a2", - "progress": 100, - "processing_time": 743, - "object": "async_action" - } - }, - "CUSTOMERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c5551f2ab0a0ebf0e", - "type": "CUSTOMERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 0 customers.", - "done_count": 0 - }, - "created_at": "2023-01-20T08:42:45.804Z", - "updated_at": "2023-01-20T08:42:46.079Z", - "request_id": "w-0c5551f2a38a0ebf0d", - "progress": 100, - "processing_time": 275, - "object": "async_action" - } - }, - "PRODUCTS.BULK_UPDATE": { - "value": { - "id": "aa_0c5553f0f457b6328e", - "type": "PRODUCTS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "first_product", - "updated": false, - "found": true - }, - { - "source_id": "second_product", - "updated": false, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:51:28.337Z", - "updated_at": "2023-01-20T08:51:28.439Z", - "request_id": "v-0c5553f0e94b0f7502", - "progress": 100, - "processing_time": 102, - "object": "async_action" - } - }, - "PRODUCTS.METADATA_UPDATE": { - "value": { - "id": "aa_0c5554869b97b633b4", - "type": "PRODUCTS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "source_id": "123-567-3433", - "updated": false, - "found": true - }, - { - "source_id": "test_volleyball", - "updated": false, - "found": true - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T08:54:01.582Z", - "updated_at": "2023-01-20T08:54:02.436Z", - "request_id": "v-0c55548694c418f9dd", - "progress": 100, - "processing_time": 854, - "object": "async_action" - } - }, - "PRODUCTS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c5552d997ca0ec03a", - "type": "PRODUCTS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 2 products.", - "done_count": 2 - }, - "created_at": "2023-01-20T08:46:42.271Z", - "updated_at": "2023-01-20T08:46:43.240Z", - "request_id": "w-0c5552d98e8a0ec039", - "progress": 100, - "processing_time": 969, - "object": "async_action" - } - }, - "VOUCHERS.IMPORT": { - "value": { - "id": "aa_0c5559be44d7b63c06", - "type": "VOUCHERS.IMPORT", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 3 failed.", - "failed": [ - { - "code": "PROMO-CODE31", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - }, - { - "code": "PROMO-CODE21", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - }, - { - "code": "GIFT-CARD-100-1", - "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" - } - ], - "done_count": 0, - "failed_count": 3 - }, - "created_at": "2023-01-20T09:16:49.299Z", - "updated_at": "2023-01-20T09:16:50.238Z", - "request_id": "v-0c5559be25c418824a", - "progress": 100, - "processing_time": 939, - "object": "async_action" - } - }, - "VOUCHERS.IMPORT_CSV": { - "value": { - "id": "aa_0c555db3d697b643e1", - "type": "VOUCHERS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "0 voucher(s) imported successfully, 2 failed.", - "failed": [ - { - "code": "FALL2023", - "row": 1, - "reason": "Voucher Type is required" - }, - { - "code": "FALL2024", - "row": 2, - "reason": "Voucher Type is required" - } - ], - "done_count": 0, - "failed_count": 2 - }, - "created_at": "2023-01-20T09:34:07.194Z", - "updated_at": "2023-01-20T09:34:07.367Z", - "request_id": "v-0c555db3ba8b0f0767", - "progress": 100, - "processing_time": 173, - "object": "async_action" - } - }, - "VOUCHERS.BULK_UPDATE": { - "value": { - "id": "aa_0c555e8115d7b64504", - "type": "VOUCHERS.BULK_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "code": "PROMO-CODE81019", - "updated": false, - "found": false - }, - { - "code": "PROMO-CODE7264786", - "updated": false, - "found": false - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T09:37:37.367Z", - "updated_at": "2023-01-20T09:37:37.520Z", - "request_id": "v-0c555e810904188aa4", - "progress": 100, - "processing_time": 153, - "object": "async_action" - } - }, - "VOUCHERS.METADATA_UPDATE": { - "value": { - "id": "aa_0c555ed40857b6463a", - "type": "VOUCHERS.METADATA_UPDATE", - "status": "DONE", - "result": { - "results": [ - { - "code": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", - "updated": false, - "found": false - }, - { - "code": "LOYALTY-CARD-xLPbpbXR", - "updated": false, - "found": false - } - ], - "done_count": 2 - }, - "created_at": "2023-01-20T09:39:02.305Z", - "updated_at": "2023-01-20T09:39:02.640Z", - "request_id": "v-0c555ed40084188b55", - "progress": 100, - "processing_time": 335, - "object": "async_action" - } - }, - "VOUCHERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c55534bd64a0ec0e0", - "type": "VOUCHERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 9 vouchers.", - "done_count": 9 - }, - "created_at": "2023-01-20T08:48:39.257Z", - "updated_at": "2023-01-20T08:48:40.503Z", - "request_id": "w-0c55534bcfca0ec0df", - "progress": 100, - "processing_time": 1246, - "object": "async_action" - } - }, - "SKUS.IMPORT_CSV": { - "value": { - "id": "aa_0c5558728d0e577e67", - "type": "SKUS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "4 sku(s) imported successfully, 0 failed.", - "failed": [], - "done_count": 4, - "failed_count": 0 - }, - "created_at": "2023-01-20T09:11:09.620Z", - "updated_at": "2023-01-20T09:11:10.270Z", - "request_id": "v-0c5558726f0b0f7d82", - "progress": 100, - "processing_time": 650, - "object": "async_action" - } - }, - "PRODUCTS.IMPORT_CSV": { - "value": { - "id": "aa_0c55578e914e577cf1", - "type": "PRODUCTS.IMPORT_CSV", - "status": "DONE", - "result": { - "message": "1 product(s) imported successfully, 1 failed.", - "failed": [ - { - "row": 1, - "reason": "vendor: must be a string, property is required, must be equal to one of Vendor 1,Vendor 2 (actual value is 'Vendor 3')" - } - ], - "done_count": 1, - "failed_count": 1 - }, - "created_at": "2023-01-20T09:07:16.165Z", - "updated_at": "2023-01-20T09:07:17.025Z", - "request_id": "v-0c55578e7a0418fef5", - "progress": 100, - "processing_time": 860, - "object": "async_action" - } - }, - "ORDERS.METADATA_KEY_PURGE": { - "value": { - "id": "aa_0c555fda50472c83a8", - "type": "ORDERS.METADATA_KEY_PURGE", - "status": "DONE", - "result": { - "message": "Updated 1 orders.", - "done_count": 1 - }, - "created_at": "2023-01-20T09:43:30.881Z", - "updated_at": "2023-01-20T09:43:31.217Z", - "request_id": "w-0c555fda45c72c83a7", - "progress": 100, - "processing_time": 336, - "object": "async_action" - } - }, - "ORDERS.IMPORT": { - "value": { - "id": "aa_0c5564b67d0e571534", - "type": "ORDERS.IMPORT", - "status": "DONE", - "result": { - "message": "1 order(s) imported successfully, 1 failed.", - "failed": [ - { - "source_id": null, - "reason": "Internal error" - } - ], - "done_count": 1, - "failed_count": 1 - }, - "created_at": "2023-01-20T10:04:44.916Z", - "updated_at": "2023-01-20T10:04:46.102Z", - "request_id": "v-0c5564b6688b0f155d", - "progress": 100, - "processing_time": 1186, - "object": "async_action" + "$ref": "#/components/schemas/18_res_list_consents_GET" + }, + "examples": { + "Marketing Permissions Groups and Consents": { + "value": { + "groups": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnstgr_3c7Z3rcOLv51bsXlRtTZPYj8", + "name": "Consent group", + "description": "Consent group", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T09:12:47.743Z", + "updated_at": "2022-04-13T09:45:46.616Z", + "object": "consent_group" + }, + { + "id": "cnstgr_EAIakTj5lNG2ZpiQEauGqBlY", + "name": "Consent group 2", + "description": "Consent group 2", + "consents": [ + "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "cnst_VCmucIvAsmDYw2PPAok6bcYy" + ], + "created_at": "2022-04-13T10:03:46.564Z", + "updated_at": null, + "object": "consent_group" } - } - } - } - } - }, - "404": { - "description": "Returns an error indicating that the async action with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Async-Action-Not-Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find async_action with id aa_0aeb82bd55d5beffb", - "request_id": "v-0aeb88df54c82af560", - "resource_id": "aa_0aeb82bd55d5beffb", - "resource_type": "async_action" + ], + "total": 2 + }, + "consents": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cnst_6jQ5XcUOLnj5L7ImQAdBsJ1I", + "name": "Consent", + "description": "Consent for marketing", + "category": "New", + "created_at": "2022-04-13T09:11:27.037Z", + "updated_at": null, + "object": "consent" + }, + { + "id": "cnst_VCmucIvAsmDYw2PPAok6bcYy", + "name": "Consent 2", + "description": "Consent 2", + "category": "Trial", + "created_at": "2022-04-13T09:45:37.597Z", + "updated_at": null, + "object": "consent" } - } + ], + "total": 2 } } } } } } + } + } + } + }, + "/v1/async-action-object": { + "get": { + "operationId": "async-action-object", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "Async Action Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Async Action Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_obj_async_action_object" + } + } + } + } + } + } + }, + "/v1/async-actions": { + "get": { + "operationId": "list-async-actions", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "List Async Actions", + "description": "Track asynchronous operations scheduled in your project. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
                          • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
                          • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
                            • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
                              |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
                              |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
                              CUSTOMERS.METADATA_KEY_PURGE
                              PRODUCTS.METADATA_KEY_PURGE
                              VOUCHERS.METADATA_KEY_PURGE
                              ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", + "parameters": [ + { + "schema": { + "type": "integer" + }, + "in": "query", + "name": "limit", + "description": "Limit the number of asynchronous actions that the API returns in the response." }, - "/v1/export-object": { - "get": { - "operationId": "export-object", - "tags": [ - "EXPORTS API" - ], - "summary": "Export Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Export Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - } + { + "schema": { + "type": "string", + "example": "2021-09-08T13:52:18.227Z", + "format": "date-time" + }, + "in": "query", + "name": "end_date", + "description": "Limits results to actions scheduled before the `end_date`. The date format needs to be consistent with ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`). " + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a list of all scheduled asynchronous actions and detailed information for each scheduled action. Note that a status `DONE`doesn't include the result of the completed action. If you need more information about the result, use the ID of the respective async action to call the [Get Async Action](ref:get-async-action) endpoint.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_res_list_async_actions_GET" + }, + "examples": { + "List Async Actions": { + "value": { + "object": "list", + "data_ref": "async_actions", + "async_actions": [ + { + "id": "aa_0ba518c55290c6fd62", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "created_at": "2022-09-05T11:40:17.098Z", + "updated_at": "2022-09-05T11:40:17.887Z", + "request_id": "v-0ba518c52bc99858f0", + "progress": 100, + "object": "async_action" + }, + { + "id": "aa_0ba50a7ff4d3574568", + "type": "CUSTOMERS.METADATA_UPDATE", + "status": "DONE", + "created_at": "2022-09-05T10:37:56.051Z", + "updated_at": "2022-09-05T10:37:56.862Z", + "request_id": "v-0ba50a7feb49984902", + "progress": 100, + "object": "async_action" + } + ] } } } } } }, - "/v1/exports": { - "post": { - "operationId": "create-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Create Export", - "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                              `GIFT_VOUCHER`: amount left to spend
                              `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                              - `CREDITS_ADDITION`
                              - `CREDITS_REFUND`
                              - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                              - `POINTS_ADDITION`
                              - `POINTS_REMOVAL`
                              - `POINTS_TRANSFER_OUT`
                              - `POINTS_ACCRUAL`
                              - `POINTS_REFUND`
                              - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                              - `voucherify-web-ui`
                              - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the export that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_req_create_export_POST" + "400": { + "description": "Returns an error if incorrect query parameters were provided.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_error_no_translation" + }, + "examples": { + "Invalid Query Parameters": { + "value": { + "code": 400, + "key": "invalid_query_params", + "message": "Invalid query params", + "details": "Property .end_date cannot be recognized as a ISO-8601 compliant date", + "request_id": "v-0c54493e444b0f61a6" } } } - }, - "responses": { - "200": { - "description": "Returns export object and URL of CSV file.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - } - } - } + } + } + } + } + } + }, + "/v1/async-actions/{asyncActionId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "aa_0afb3d009a55814a48" + }, + "name": "asyncActionId", + "in": "path", + "required": true, + "description": "Unique ID of the asynchronous operation." + } + ], + "get": { + "operationId": "get-async-action", + "tags": [ + "ASYNC ACTIONS API" + ], + "summary": "Get Async Action", + "description": "Check the result of a scheduled asynchronous operation. \n\nThe table below lists the possible types of async actions. The types are different for each endpoint generating the async action. If you would like to learn more about importing data into Voucherify, read more [here](https://support.voucherify.io/article/574-data-import).\n\n| **Types by Context** | **Endpoint** |\n|:---|:---|\n| **CAMPAIGN** | |\n| CAMPAIGN.VOUCHERS_IMPORT | **POST** [/campaigns/{campaignId}/import](ref:import-vouchers-to-campaign) |\n| CAMPAIGN.VOUCHERS_IMPORT_CSV | **POST** [/campaigns/{campaignId}/importCSV](ref:import-vouchers-to-campaign-using-csv) |\n| CAMPAIGN.VOUCHERS_UPDATE | **PUT** [/campaigns/{campaignId}](ref:update-campaign) |\n| CAMPAIGN.VOUCHERS_DELETE | **DELETE** [/campaigns/{campaignId}](ref:delete-campaign) |\n| CAMPAIGN.VOUCHERS_GENERATE |
                              • **POST** [/campaigns](ref:create-campaign): asynchronous for campaigns with more than 1 voucher, synchronous for campaign with 1 voucher
                              • **POST** [/campaigns/{campaignId}/vouchers](ref:add-vouchers-to-campaign)
                                • |\n| **CUSTOMERS** | |\n| CUSTOMERS.IMPORT_CSV | **POST** [/customers/importCSV](ref:import-customers-using-csv) |\n| CUSTOMERS.BULK_UPDATE | **POST** [/customers/bulk/async](ref:update-customers-in-bulk) |\n| CUSTOMERS.METADATA_UPDATE | **POST** [/customers/metadata/async](ref:update-customers-metadata-in-bulk) |\n| **PRODUCTS** | |\n| PRODUCTS.BULK_UPDATE | **POST** [/products/bulk/async](ref:update-products-in-bulk)
                                  |\n| PRODUCTS.METADATA_UPDATE | **POST** [/products/metadata/async](ref:update-products-metadata-in-bulk) |\n| PRODUCTS.IMPORT_CSV | **POST** [/products/importCSV](ref:import-products-using-csv) |\n| SKUS.IMPORT_CSV | **POST** [/skus/importCSV](ref:import-skus-using-csv) |\n| **VOUCHERS** | |\n| VOUCHERS.IMPORT | **POST** [/vouchers/import](ref:import-vouchers) |\n| VOUCHERS.IMPORT_CSV | **POST** [/vouchers/importCSV](ref:import-vouchers-using-csv) |\n| VOUCHERS.BULK_UPDATE | **POST** [/vouchers/bulk/async](ref:update-vouchers-in-bulk)
                                  |\n| VOUCHERS.METADATA_UPDATE | **POST** [/vouchers/metadata/async](ref:update-vouchers-metadata-in-bulk) | \n| **ORDERS** | |\n| ORDERS.IMPORT | **POST** [/orders/import](ref:import-orders) |\n| **METADATA KEY PURGE** | |\n| CAMPAIGNS.METADATA_KEY_PURGE
                                  CUSTOMERS.METADATA_KEY_PURGE
                                  PRODUCTS.METADATA_KEY_PURGE
                                  VOUCHERS.METADATA_KEY_PURGE
                                  ORDERS.METADATA_KEY_PURGE | No API endpoint equivalent. You can perform this action through the Dashboard. See Dashboard documentation: Dashboard > [Project Settings](https://support.voucherify.io/article/99-schema-validation-metadata#maintenance) |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns detailed information about the async action result.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/17_obj_async_action_object" }, - "400": { - "description": "Returns an error if an invalid payload is provided.", - "content": { - "application/json": { - "schema": { - "anyOf": [ + "examples": { + "CAMPAIGN.VOUCHERS_IMPORT": { + "value": { + "id": "aa_0af9b22296cf473a10", + "type": "CAMPAIGN.VOUCHERS_IMPORT", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 3 failed.", + "failed": [ + { + "code": "CODE9", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" + }, { - "$ref": "#/components/schemas/e_400_invalid_payload" + "code": "CODE8", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" }, { - "$ref": "#/components/schemas/e_400_invalid_export_fields" + "code": "CODE7", + "reason": "unit: must be a number, property is required (actual value is 'EUR')" } - ] + ], + "done_count": 0, + "failed_count": 3 + }, + "created_at": "2023-01-20T07:23:43.289Z", + "updated_at": "2023-01-20T07:23:44.044Z", + "request_id": "v-0c553fdb325688d510", + "progress": 100, + "processing_time": 755, + "object": "async_action" + } + }, + "CAMPAIGN.VOUCHERS_IMPORT_CSV": { + "value": { + "id": "aa_0c5543f00797b6113f", + "type": "CUSTOMERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 customer(s) imported successfully, 2 failed.", + "failed": [ + { + "source_id": "test-user@voucherify.io", + "row": 1, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" + }, + { + "source_id": "", + "row": 2, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" + } + ], + "done_count": 0, + "failed_count": 2 + }, + "created_at": "2023-01-20T07:41:33.086Z", + "updated_at": "2023-01-20T07:41:33.216Z", + "request_id": "v-0c5543eff2cb0f547f", + "progress": 100, + "processing_time": 130, + "object": "async_action" + } + }, + "CAMPAIGN.VOUCHERS_DELETE": { + "value": { + "id": "aa_0c553853d957b67bd4", + "type": "CAMPAIGN.VOUCHERS_DELETE", + "status": "DONE", + "result": { + "message": "Deleted 2 vouchers.", + "done_count": 2 + }, + "created_at": "2023-01-20T06:50:49.573Z", + "updated_at": "2023-01-20T06:50:50.053Z", + "request_id": "v-0c553853b5c418c826", + "progress": 100, + "processing_time": 480, + "object": "async_action" + } + }, + "CAMPAIGN.VOUCHERS_UPDATE": { + "value": { + "id": "aa_0c5440c25c0e5728d0", + "type": "CAMPAIGN.VOUCHERS_UPDATE", + "status": "DONE", + "result": { + "message": "Updated 1 vouchers.", + "done_count": 1 + }, + "created_at": "2023-01-19T12:49:11.024Z", + "updated_at": "2023-01-19T12:49:11.852Z", + "request_id": "v-0c5440c24304189e44", + "progress": 100, + "processing_time": 828, + "object": "async_action" + } + }, + "CAMPAIGN.VOUCHERS_GENERATE": { + "value": { + "id": "aa_0c54441d14d7b60014", + "type": "CAMPAIGN.VOUCHERS_GENERATE", + "status": "DONE", + "result": { + "message": "Generated 2 vouchers.", + "done_count": 2 + }, + "created_at": "2023-01-19T13:03:50.355Z", + "updated_at": "2023-01-19T13:03:51.030Z", + "request_id": "v-0c54441d0e4418b647", + "progress": 100, + "processing_time": 675, + "object": "async_action" + } + }, + "CAMPAIGNS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c554b22664a0eb5fc", + "type": "CAMPAIGNS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 0 campaigns.", + "done_count": 0 + }, + "created_at": "2023-01-20T08:12:59.673Z", + "updated_at": "2023-01-20T08:13:00.638Z", + "request_id": "w-0c554b225f8a0eb5fb", + "progress": 100, + "processing_time": 965, + "object": "async_action" + } + }, + "CUSTOMERS.IMPORT_CSV": { + "value": { + "id": "aa_0c5543f00797b6113f", + "type": "CUSTOMERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 customer(s) imported successfully, 2 failed.", + "failed": [ + { + "source_id": "test-user@voucherify.io", + "row": 1, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'snap')" + }, + { + "source_id": "", + "row": 2, + "reason": "acquisition_channel: must be a string, property is required, must be equal to one of Facebook,Twitter,Website (actual value is 'insta')" + } + ], + "done_count": 0, + "failed_count": 2 + }, + "created_at": "2023-01-20T07:41:33.086Z", + "updated_at": "2023-01-20T07:41:33.216Z", + "request_id": "v-0c5543eff2cb0f547f", + "progress": 100, + "processing_time": 130, + "object": "async_action" + } + }, + "CUSTOMERS.BULK_UPDATE": { + "value": { + "id": "aa_0c5547cc5e17b617b6", + "type": "CUSTOMERS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "source_id_1", + "updated": true, + "found": true + }, + { + "source_id": "source_id_2", + "updated": true, + "found": true + }, + { + "source_id": "source_id_3", + "updated": true, + "found": true + } + ], + "done_count": 3 + }, + "created_at": "2023-01-20T07:58:25.144Z", + "updated_at": "2023-01-20T07:58:25.869Z", + "request_id": "v-0c5547cc4d8b0f5be4", + "progress": 100, + "processing_time": 725, + "object": "async_action" + } + }, + "CUSTOMERS.METADATA_UPDATE": { + "value": { + "id": "aa_0c554a92030e576181", + "type": "CUSTOMERS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "source_1", + "updated": true, + "found": true + }, + { + "source_id": "source_2", + "updated": true, + "found": true + } + ], + "done_count": 2 }, - "examples": { - "Invalid Export Fields": { - "value": { - "code": 400, - "key": "invalid_export_fields", - "message": "Invalid Export", - "details": "Unsupported field used. Allowed fields: 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", - "request_id": "v-0afdb603910a1a14e0" + "created_at": "2023-01-20T08:10:31.821Z", + "updated_at": "2023-01-20T08:10:32.564Z", + "request_id": "v-0c554a91fb4b0f61a2", + "progress": 100, + "processing_time": 743, + "object": "async_action" + } + }, + "CUSTOMERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c5551f2ab0a0ebf0e", + "type": "CUSTOMERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 0 customers.", + "done_count": 0 + }, + "created_at": "2023-01-20T08:42:45.804Z", + "updated_at": "2023-01-20T08:42:46.079Z", + "request_id": "w-0c5551f2a38a0ebf0d", + "progress": 100, + "processing_time": 275, + "object": "async_action" + } + }, + "PRODUCTS.BULK_UPDATE": { + "value": { + "id": "aa_0c5553f0f457b6328e", + "type": "PRODUCTS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "first_product", + "updated": false, + "found": true + }, + { + "source_id": "second_product", + "updated": false, + "found": true } - }, - "Invalid Payload": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]", - "request_id": "v-0afdb5bd68d20bdb81" + ], + "done_count": 2 + }, + "created_at": "2023-01-20T08:51:28.337Z", + "updated_at": "2023-01-20T08:51:28.439Z", + "request_id": "v-0c5553f0e94b0f7502", + "progress": 100, + "processing_time": 102, + "object": "async_action" + } + }, + "PRODUCTS.METADATA_UPDATE": { + "value": { + "id": "aa_0c5554869b97b633b4", + "type": "PRODUCTS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "source_id": "123-567-3433", + "updated": false, + "found": true + }, + { + "source_id": "test_volleyball", + "updated": false, + "found": true } - } - } + ], + "done_count": 2 + }, + "created_at": "2023-01-20T08:54:01.582Z", + "updated_at": "2023-01-20T08:54:02.436Z", + "request_id": "v-0c55548694c418f9dd", + "progress": 100, + "processing_time": 854, + "object": "async_action" } - } - } - } - }, - "get": { - "operationId": "list-exports", - "tags": [ - "EXPORTS API" - ], - "summary": "List Exports", - "description": "List all exports. ", - "parameters": [ - { - "$ref": "#/components/parameters/limit" - }, - { - "$ref": "#/components/parameters/page" - }, - { - "schema": { - "type": "string", - "enum": [ - "created_at", - "-created_at", - "status", - "-status" - ] }, - "in": "query", - "name": "order", - "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_res_list_exports" - }, - "examples": { - "List Exports": { - "value": { - "object": "list", - "data_ref": "exports", - "exports": [ - { - "id": "exp_323UOPsH42twhJVaDZXf4UNo", - "object": "export", - "created_at": "2022-08-04T09:11:25.208Z", - "status": "DONE", - "channel": "API", - "exported_object": "order", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "source_id", - "status" - ], - "filters": { - "junction": "and" - } - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o" - }, - "user_id": null - }, - { - "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9", - "object": "export", - "created_at": "2022-05-02T06:44:03.186Z", - "status": "DONE", - "channel": "API", - "exported_object": "voucher", - "parameters": { - "order": "-created_at", - "fields": [ - "id", - "code", - "voucher_type", - "value" - ], - "filters": { - "junction": "and" - } - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ" - }, - "user_id": null - }, - { - "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", - "object": "export", - "created_at": "2022-01-13T09:03:18.293Z", - "status": "DONE", - "channel": "API", - "exported_object": "customer", - "parameters": { - "order": "", - "fields": [ - "name", - "id", - "email", - "source_id", - "created_at" - ], - "filters": { - "junction": "and" - }, - "response_format": "CSV" - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" - }, - "user_id": null - } - ], - "total": 3 + "PRODUCTS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c5552d997ca0ec03a", + "type": "PRODUCTS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 2 products.", + "done_count": 2 + }, + "created_at": "2023-01-20T08:46:42.271Z", + "updated_at": "2023-01-20T08:46:43.240Z", + "request_id": "w-0c5552d98e8a0ec039", + "progress": 100, + "processing_time": 969, + "object": "async_action" + } + }, + "VOUCHERS.IMPORT": { + "value": { + "id": "aa_0c5559be44d7b63c06", + "type": "VOUCHERS.IMPORT", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 3 failed.", + "failed": [ + { + "code": "PROMO-CODE31", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" + }, + { + "code": "PROMO-CODE21", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" + }, + { + "code": "GIFT-CARD-100-1", + "reason": "unit: must be a number, must be equal to one of 1,2 (actual value is 'EUR')" } - } - } + ], + "done_count": 0, + "failed_count": 3 + }, + "created_at": "2023-01-20T09:16:49.299Z", + "updated_at": "2023-01-20T09:16:50.238Z", + "request_id": "v-0c5559be25c418824a", + "progress": 100, + "processing_time": 939, + "object": "async_action" + } + }, + "VOUCHERS.IMPORT_CSV": { + "value": { + "id": "aa_0c555db3d697b643e1", + "type": "VOUCHERS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "0 voucher(s) imported successfully, 2 failed.", + "failed": [ + { + "code": "FALL2023", + "row": 1, + "reason": "Voucher Type is required" + }, + { + "code": "FALL2024", + "row": 2, + "reason": "Voucher Type is required" + } + ], + "done_count": 0, + "failed_count": 2 + }, + "created_at": "2023-01-20T09:34:07.194Z", + "updated_at": "2023-01-20T09:34:07.367Z", + "request_id": "v-0c555db3ba8b0f0767", + "progress": 100, + "processing_time": 173, + "object": "async_action" + } + }, + "VOUCHERS.BULK_UPDATE": { + "value": { + "id": "aa_0c555e8115d7b64504", + "type": "VOUCHERS.BULK_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "code": "PROMO-CODE81019", + "updated": false, + "found": false + }, + { + "code": "PROMO-CODE7264786", + "updated": false, + "found": false + } + ], + "done_count": 2 + }, + "created_at": "2023-01-20T09:37:37.367Z", + "updated_at": "2023-01-20T09:37:37.520Z", + "request_id": "v-0c555e810904188aa4", + "progress": 100, + "processing_time": 153, + "object": "async_action" + } + }, + "VOUCHERS.METADATA_UPDATE": { + "value": { + "id": "aa_0c555ed40857b6463a", + "type": "VOUCHERS.METADATA_UPDATE", + "status": "DONE", + "result": { + "results": [ + { + "code": "v_TzD19aeNiqGc9LWciMWknyEZT8IW7u4u", + "updated": false, + "found": false + }, + { + "code": "LOYALTY-CARD-xLPbpbXR", + "updated": false, + "found": false + } + ], + "done_count": 2 + }, + "created_at": "2023-01-20T09:39:02.305Z", + "updated_at": "2023-01-20T09:39:02.640Z", + "request_id": "v-0c555ed40084188b55", + "progress": 100, + "processing_time": 335, + "object": "async_action" + } + }, + "VOUCHERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c55534bd64a0ec0e0", + "type": "VOUCHERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 9 vouchers.", + "done_count": 9 + }, + "created_at": "2023-01-20T08:48:39.257Z", + "updated_at": "2023-01-20T08:48:40.503Z", + "request_id": "w-0c55534bcfca0ec0df", + "progress": 100, + "processing_time": 1246, + "object": "async_action" + } + }, + "SKUS.IMPORT_CSV": { + "value": { + "id": "aa_0c5558728d0e577e67", + "type": "SKUS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "4 sku(s) imported successfully, 0 failed.", + "failed": [], + "done_count": 4, + "failed_count": 0 + }, + "created_at": "2023-01-20T09:11:09.620Z", + "updated_at": "2023-01-20T09:11:10.270Z", + "request_id": "v-0c5558726f0b0f7d82", + "progress": 100, + "processing_time": 650, + "object": "async_action" + } + }, + "PRODUCTS.IMPORT_CSV": { + "value": { + "id": "aa_0c55578e914e577cf1", + "type": "PRODUCTS.IMPORT_CSV", + "status": "DONE", + "result": { + "message": "1 product(s) imported successfully, 1 failed.", + "failed": [ + { + "row": 1, + "reason": "vendor: must be a string, property is required, must be equal to one of Vendor 1,Vendor 2 (actual value is 'Vendor 3')" + } + ], + "done_count": 1, + "failed_count": 1 + }, + "created_at": "2023-01-20T09:07:16.165Z", + "updated_at": "2023-01-20T09:07:17.025Z", + "request_id": "v-0c55578e7a0418fef5", + "progress": 100, + "processing_time": 860, + "object": "async_action" + } + }, + "ORDERS.METADATA_KEY_PURGE": { + "value": { + "id": "aa_0c555fda50472c83a8", + "type": "ORDERS.METADATA_KEY_PURGE", + "status": "DONE", + "result": { + "message": "Updated 1 orders.", + "done_count": 1 + }, + "created_at": "2023-01-20T09:43:30.881Z", + "updated_at": "2023-01-20T09:43:31.217Z", + "request_id": "w-0c555fda45c72c83a7", + "progress": 100, + "processing_time": 336, + "object": "async_action" + } + }, + "ORDERS.IMPORT": { + "value": { + "id": "aa_0c5564b67d0e571534", + "type": "ORDERS.IMPORT", + "status": "DONE", + "result": { + "message": "1 order(s) imported successfully, 1 failed.", + "failed": [ + { + "source_id": null, + "reason": "Internal error" + } + ], + "done_count": 1, + "failed_count": 1 + }, + "created_at": "2023-01-20T10:04:44.916Z", + "updated_at": "2023-01-20T10:04:46.102Z", + "request_id": "v-0c5564b6688b0f155d", + "progress": 100, + "processing_time": 1186, + "object": "async_action" } } } } } }, - "/v1/exports/{exportId}": { - "parameters": [ - { + "404": { + "description": "Returns an error indicating that the async action with given ID was not found.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ" + "$ref": "#/components/schemas/e_404_not_found" }, - "name": "exportId", - "in": "path", - "required": true, - "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`." + "examples": { + "Async-Action-Not-Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find async_action with id aa_0aeb82bd55d5beffb", + "request_id": "v-0aeb88df54c82af560", + "resource_id": "aa_0aeb82bd55d5beffb", + "resource_type": "async_action" + } + } + } } - ], - "get": { - "operationId": "get-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Get Export", - "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/export-object": { + "get": { + "operationId": "export-object", + "tags": [ + "EXPORTS API" + ], + "summary": "Export Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Export Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" } - ], - "responses": { - "200": { - "description": "Returns the export object if a valid identifier was provided in the path.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/16_obj_export_object" - }, - "examples": { - "Get Export": { - "value": { - "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", - "object": "export", - "created_at": "2022-01-13T09:03:18.293Z", - "status": "DONE", - "channel": "API", - "exported_object": "customer", - "parameters": { - "order": "", - "fields": [ - "name", - "id", - "email", - "source_id", - "created_at" - ], - "filters": { - "junction": "and" - }, - "response_format": "CSV" - }, - "result": { - "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" - }, - "user_id": null - } - } - } + } + } + } + } + } + }, + "/v1/exports": { + "post": { + "operationId": "create-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Create Export", + "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                                  `GIFT_VOUCHER`: amount left to spend
                                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_TRANSFER_OUT`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_REFUND`
                                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                                  - `voucherify-web-ui`
                                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the export that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_req_create_export_POST" + } + } + } + }, + "responses": { + "200": { + "description": "Returns export object and URL of CSV file.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_obj_export_object" + } + } + } + }, + "400": { + "description": "Returns an error if an invalid payload is provided.", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + { + "$ref": "#/components/schemas/e_400_invalid_export_fields" } - } + ] }, - "404": { - "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0", - "request_id": "v-0b029305af4524cf42", - "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0", - "resource_type": "export" - } - } - } + "examples": { + "Invalid Export Fields": { + "value": { + "code": 400, + "key": "invalid_export_fields", + "message": "Invalid Export", + "details": "Unsupported field used. Allowed fields: 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", + "request_id": "v-0afdb603910a1a14e0" + } + }, + "Invalid Payload": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Property .exported_object should be equal to one of the allowed values [ voucher, redemption, customer, publication, order, points_expiration ]", + "request_id": "v-0afdb5bd68d20bdb81" } } } } + } + } + } + }, + "get": { + "operationId": "list-exports", + "tags": [ + "EXPORTS API" + ], + "summary": "List Exports", + "description": "List all exports. ", + "parameters": [ + { + "$ref": "#/components/parameters/limit" + }, + { + "$ref": "#/components/parameters/page" + }, + { + "schema": { + "type": "string", + "enum": [ + "created_at", + "-created_at", + "status", + "-status" + ] }, - "delete": { - "operationId": "delete-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Delete Export", - "description": "This method deletes a previously created export object.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, - "404": { - "description": "Returns an error indicating that the export with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Export Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ", - "request_id": "v-0ae2a97a399027d719", - "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ", - "resource_type": "export" - } + "in": "query", + "name": "order", + "description": "Sorts the results using one of the filtering options, where the dash `-` preceding a sorting option means sorting in a descending order." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "A dictionary with an exports property that contains an array of exports. Each entry in the array is a separate export object. The list will return the following types of exported objects: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\nThe `channel` parameter in the response body returns the channel that was used to generate the particular export. The `user_id` identifies the specific user who initiated the export through the Voucherify Dashboard; this `user_id` is returned when the channel value is `WEBSITE`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/16_res_list_exports" + }, + "examples": { + "List Exports": { + "value": { + "object": "list", + "data_ref": "exports", + "exports": [ + { + "id": "exp_323UOPsH42twhJVaDZXf4UNo", + "object": "export", + "created_at": "2022-08-04T09:11:25.208Z", + "status": "DONE", + "channel": "API", + "exported_object": "order", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "source_id", + "status" + ], + "filters": { + "junction": "and" + } + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_323UOPsH42twhJVaDZXf4UNo?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwXzMyM1VPUHNINDJ0d2hKVmFEWlhmNFVObyIsImlhdCI6MTY1OTYwNDI4NiwiZXhwIjoxNjU5NjA1MTg2fQ.IgFnKagyoQ7_O2tGswZxpegUMtllSbzMfPMX-_89W7o" + }, + "user_id": null + }, + { + "id": "exp_sPQR0na2gU0pIVUKIz4wdQI9", + "object": "export", + "created_at": "2022-05-02T06:44:03.186Z", + "status": "DONE", + "channel": "API", + "exported_object": "voucher", + "parameters": { + "order": "-created_at", + "fields": [ + "id", + "code", + "voucher_type", + "value" + ], + "filters": { + "junction": "and" + } + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_sPQR0na2gU0pIVUKIz4wdQI9?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZW5hbnQiOiJzYW11ZWwuamFuaWtAdm91Y2hlcmlmeS5pbyIsImV4cG9ydElkIjoiZXhwX3NQUVIwbmEyZ1UwcElWVUtJejR3ZFFJOSIsImlhdCI6MTY1MTQ3Mzg0NCwiZXhwIjoxNjUxNDc0NzQ0fQ.yNIQHcHMO-HSKYejtgNjRVh3cRa_JqnmhBXdnAX2vHQ" + }, + "user_id": null + }, + { + "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", + "object": "export", + "created_at": "2022-01-13T09:03:18.293Z", + "status": "DONE", + "channel": "API", + "exported_object": "customer", + "parameters": { + "order": "", + "fields": [ + "name", + "id", + "email", + "source_id", + "created_at" + ], + "filters": { + "junction": "and" + }, + "response_format": "CSV" + }, + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" + }, + "user_id": null } - } + ], + "total": 3 } } } } } + } + } + } + }, + "/v1/exports/{exportId}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "exp_2bYLdY2lQ2886wmYIHyeBWUZ" }, - "/v1/exports/{export_Id}": { - "parameters": [ - { + "name": "exportId", + "in": "path", + "required": true, + "description": "Unique export object ID of previously created export. This object can be a: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`." + } + ], + "get": { + "operationId": "get-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Get Export", + "description": "Retrieves the URL of the downloadable file, which was generated via the [Create Export](ref:create-export) method.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns the export object if a valid identifier was provided in the path.", + "content": { + "application/json": { "schema": { - "type": "string", - "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ" - }, - "name": "export_Id", - "in": "path", - "required": true, - "description": "Unique export object ID." - } - ], - "get": { - "operationId": "download-export", - "tags": [ - "EXPORTS API" - ], - "summary": "Download Export", - "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [], - "Download-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns contents of CSV file.", - "content": { - "text/plain": { - "schema": { - "type": "string" + "$ref": "#/components/schemas/16_obj_export_object" + }, + "examples": { + "Get Export": { + "value": { + "id": "exp_CGnCVltmWjI9V1pGlnunw2Nf", + "object": "export", + "created_at": "2022-01-13T09:03:18.293Z", + "status": "DONE", + "channel": "API", + "exported_object": "customer", + "parameters": { + "order": "", + "fields": [ + "name", + "id", + "email", + "source_id", + "created_at" + ], + "filters": { + "junction": "and" + }, + "response_format": "CSV" }, - "examples": { - "CSV file contents": { - "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0" - } - } + "result": { + "url": "https://download.voucherify.io/v1/exports/exp_CGnCVltmWjI9V1pGlnunw2Nf?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ" + }, + "user_id": null } } + } + } + } + }, + "404": { + "description": "Returns an error indicating that the export with given ID was not found if an incorrect ID is provided in the path.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" }, - "401": { - "description": "Returns an error if an invalid token was provided.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "type": "string", - "default": 401, - "description": "Error's HTTP status code." - }, - "message": { - "type": "string", - "default": "Unauthorized", - "description": "A human-readable message providing a short description about the error." - }, - "key": { - "type": "string", - "default": "unauthorized", - "description": "Short string describing the kind of error which occurred." - } - } - }, - "examples": { - "Unauthorized": { - "value": { - "code": 401, - "message": "Unauthorized", - "key": "unauthorized" - } - } - } + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find export with id exp_8fNoLwgVPuhoxNzVsr50kq0", + "request_id": "v-0b029305af4524cf42", + "resource_id": "exp_8fNoLwgVPuhoxNzVsr50kq0", + "resource_type": "export" } } } } } + } + } + }, + "delete": { + "operationId": "delete-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Delete Export", + "description": "This method deletes a previously created export object.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." }, - "/v1/category-object": { - "get": { - "operationId": "category-object", - "tags": [ - "CATEGORIES API" - ], - "summary": "Category Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Category Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" - } + "404": { + "description": "Returns an error indicating that the export with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Export Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find export with id exp_2bYLdY2lQ2886wmYIHyeBWUZ", + "request_id": "v-0ae2a97a399027d719", + "resource_id": "exp_2bYLdY2lQ2886wmYIHyeBWUZ", + "resource_type": "export" } } } } } + } + } + } + }, + "/v1/exports/{export_Id}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "exp_ex6zq0x0EEa9S0N68QcqhxcQ" }, - "/v1/categories": { - "get": { - "operationId": "list-categories", - "tags": [ - "CATEGORIES API" - ], - "summary": "List Categories", - "description": "List all categories.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + "name": "export_Id", + "in": "path", + "required": true, + "description": "Unique export object ID." + } + ], + "get": { + "operationId": "download-export", + "tags": [ + "EXPORTS API" + ], + "summary": "Download Export", + "description": "Download the contents of the exported CSV file. \n\n\n\n> 📘 Important notes\n>\n> **Base URL:** \n> - `https://download.voucherify.io` (Europe) \n> - `https://us1.download.voucherify.io` (US) \n> - `https://as1.download.voucherify.io` (Asia) \n>\n> **Token:** Can be found within the `result` parameter of the [Get Export](ref:get-export) method response.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [], + "Download-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns contents of CSV file.", + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "examples": { + "CSV file contents": { + "value": "ID,Code,Voucher Type,Value v_mKNYXWf5168jyW3EvwnAf73d7vnTiXaa,iuCvt3BT,GIFT_VOUCHER,2000.00 v_xb5KuIw90ViUY7NrNbDZzf1JwFmyTUi0,M3X8IwW8,GIFT_VOUCHER,2000.00 v_flCSHFGOfjxuM582jhriJTWQuetb2xHX,6vpzmKaC,GIFT_VOUCHER,2050.00 v_YtzZG4UJaWm9DNCY3AvIqVbc7Dt5WToU,lRvBOUPl,LOYALTY_CARD,0" + } } - ], - "responses": { - "200": { - "description": "Returns a dictionary of category objects.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_res_list_categories" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "cat_0b5f49fb31c3bf6ab0", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T06:21:36.852Z", - "object": "category" - }, - { - "id": "cat_0b5f49e6e1ce5bd2ba", - "name": "Fifth", - "hierarchy": 5, - "created_at": "2022-07-13T06:21:16.039Z", - "object": "category" - }, - { - "id": "cat_0b5f49deafce5bd2b5", - "name": "Fourth", - "hierarchy": 4, - "created_at": "2022-07-13T06:21:07.662Z", - "object": "category" - }, - { - "id": "cat_0b5f49d45c43bf6a99", - "name": "Third", - "hierarchy": 3, - "created_at": "2022-07-13T06:20:57.094Z", - "object": "category" - }, - { - "id": "cat_0b5f3f9881ce5bccb6", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-07-13T05:36:14.355Z", - "object": "category" - }, - { - "id": "cat_0b53bc388dc2f108ba", - "name": "First", - "hierarchy": 1, - "created_at": "2022-07-04T06:58:57.734Z", - "object": "category" - } - ], - "total": 6 - } - } - } + } + } + }, + "401": { + "description": "Returns an error if an invalid token was provided.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "string", + "default": 401, + "description": "Error's HTTP status code." + }, + "message": { + "type": "string", + "default": "Unauthorized", + "description": "A human-readable message providing a short description about the error." + }, + "key": { + "type": "string", + "default": "unauthorized", + "description": "Short string describing the kind of error which occurred." + } + } + }, + "examples": { + "Unauthorized": { + "value": { + "code": 401, + "message": "Unauthorized", + "key": "unauthorized" } } } } - }, - "post": { - "operationId": "create-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Create Category", - "description": "Create category with a specific name and hierarchy.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + } + }, + "/v1/category-object": { + "get": { + "operationId": "category-object", + "tags": [ + "CATEGORIES API" + ], + "summary": "Category Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Category Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" } - ], - "requestBody": { - "description": "Specify the details of the category that you would like to create.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_req_create_category" - }, - "examples": { - "Example": { - "value": { - "name": "Eighth", - "hierarchy": 8 + } + } + } + } + } + }, + "/v1/categories": { + "get": { + "operationId": "list-categories", + "tags": [ + "CATEGORIES API" + ], + "summary": "List Categories", + "description": "List all categories.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary of category objects.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_res_list_categories" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "cat_0b5f49fb31c3bf6ab0", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T06:21:36.852Z", + "object": "category" + }, + { + "id": "cat_0b5f49e6e1ce5bd2ba", + "name": "Fifth", + "hierarchy": 5, + "created_at": "2022-07-13T06:21:16.039Z", + "object": "category" + }, + { + "id": "cat_0b5f49deafce5bd2b5", + "name": "Fourth", + "hierarchy": 4, + "created_at": "2022-07-13T06:21:07.662Z", + "object": "category" + }, + { + "id": "cat_0b5f49d45c43bf6a99", + "name": "Third", + "hierarchy": 3, + "created_at": "2022-07-13T06:20:57.094Z", + "object": "category" + }, + { + "id": "cat_0b5f3f9881ce5bccb6", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-07-13T05:36:14.355Z", + "object": "category" + }, + { + "id": "cat_0b53bc388dc2f108ba", + "name": "First", + "hierarchy": 1, + "created_at": "2022-07-04T06:58:57.734Z", + "object": "category" } - } + ], + "total": 6 } } } + } + } + } + } + }, + "post": { + "operationId": "create-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Create Category", + "description": "Create category with a specific name and hierarchy.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the category that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_req_create_category" }, - "responses": { - "200": { - "description": "Returns a newly created category object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_res_create_category" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b8b5a427a0283c854", - "name": "Eighth", - "hierarchy": 8, - "created_at": "2022-08-16T11:45:54.171Z", - "object": "category" - } - } - } - } + "examples": { + "Example": { + "value": { + "name": "Eighth", + "hierarchy": 8 } - }, - "400": { - "description": "Returns an error if the payload is incomplete.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - "examples": { - "Missing name": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'name'", - "request_id": "v-0b8b5b960990210b25" - } - }, - "Missing hierarchy": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'hierarchy'", - "request_id": "v-0b8b5bf9d9c6824a2f" - } - } - } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a newly created category object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_res_create_category" + }, + "examples": { + "Example": { + "value": { + "id": "cat_0b8b5a427a0283c854", + "name": "Eighth", + "hierarchy": 8, + "created_at": "2022-08-16T11:45:54.171Z", + "object": "category" } } } } } }, - "/v1/categories/{categoryId}": { - "parameters": [ - { + "400": { + "description": "Returns an error if the payload is incomplete.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/e_400_invalid_payload" }, - "name": "categoryId", - "in": "path", - "required": true, - "description": "Unique category ID assigned by Voucherify." - } - ], - "get": { - "operationId": "get-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Get Category", - "description": "Retrieve a category by the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a category object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b5f49fb31c3bf6ab0", - "name": "Sixth", - "hierarchy": 6, - "created_at": "2022-07-13T06:21:36.852Z", - "object": "category" - } - } - } + "examples": { + "Missing name": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'name'", + "request_id": "v-0b8b5b960990210b25" + } + }, + "Missing hierarchy": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'hierarchy'", + "request_id": "v-0b8b5bf9d9c6824a2f" } } } } - }, - "delete": { - "operationId": "delete-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Delete Category", - "description": "Delete a category by the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "No content is returned." - }, - "404": { - "description": "Returns an error indicating that the category with given ID was not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find category with id example_category", - "request_id": "v-0b8b49205f902176c9", - "resource_id": "example_category", - "resource_type": "category" - } - } - } + } + } + } + } + }, + "/v1/categories/{categoryId}": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "categoryId", + "in": "path", + "required": true, + "description": "Unique category ID assigned by Voucherify." + } + ], + "get": { + "operationId": "get-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Get Category", + "description": "Retrieve a category by the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a category object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" + }, + "examples": { + "Example": { + "value": { + "id": "cat_0b5f49fb31c3bf6ab0", + "name": "Sixth", + "hierarchy": 6, + "created_at": "2022-07-13T06:21:36.852Z", + "object": "category" } } } } - }, - "put": { - "operationId": "update-category", - "tags": [ - "CATEGORIES API" - ], - "summary": "Update Category", - "description": "Update category using the category ID.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Specify the details of the category that you would like to update.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_req_update_categories_categoryId" - }, - "examples": { - "Example": { - "value": { - "name": "Summer", - "hierarchy": 1 - } - } + } + } + } + }, + "delete": { + "operationId": "delete-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Delete Category", + "description": "Delete a category by the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "No content is returned." + }, + "404": { + "description": "Returns an error indicating that the category with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find category with id example_category", + "request_id": "v-0b8b49205f902176c9", + "resource_id": "example_category", + "resource_type": "category" } } } + } + } + } + } + }, + "put": { + "operationId": "update-category", + "tags": [ + "CATEGORIES API" + ], + "summary": "Update Category", + "description": "Update category using the category ID.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Specify the details of the category that you would like to update.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_req_update_categories_categoryId" }, - "responses": { - "200": { - "description": "Returns a category object with a refreshed `updated_at` property.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/20_obj_category_object" - }, - "examples": { - "Example": { - "value": { - "id": "cat_0b60cfe7d0d7ddbb55", - "name": "Update", - "hierarchy": 1, - "created_at": "2022-07-14T10:45:13.156Z", - "updated_at": "2022-08-16T11:03:54.727Z", - "object": "category" - } - } - } - } + "examples": { + "Example": { + "value": { + "name": "Summer", + "hierarchy": 1 } + } + } + } + } + }, + "responses": { + "200": { + "description": "Returns a category object with a refreshed `updated_at` property.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/20_obj_category_object" }, - "400": { - "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_400_invalid_payload" - }, - "examples": { - "Missing hierarchy": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'hierarchy'", - "request_id": "v-0b8b4e6b6210217c93" - } - }, - "Missing name": { - "value": { - "code": 400, - "key": "invalid_payload", - "message": "Invalid payload", - "details": "Payload should have required property 'name'", - "request_id": "v-0b8b4f418390217d82" - } - } - } + "examples": { + "Example": { + "value": { + "id": "cat_0b60cfe7d0d7ddbb55", + "name": "Update", + "hierarchy": 1, + "created_at": "2022-07-14T10:45:13.156Z", + "updated_at": "2022-08-16T11:03:54.727Z", + "object": "category" } } } } } }, - "/v1/metadata-schema-object": { - "get": { - "operationId": "metadata-schema-object", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "Metadata Schema Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Metadata Schema Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" - } + "400": { + "description": "Returns an error indicating an invalid payload if the required request body parameters were not included in the request.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_400_invalid_payload" + }, + "examples": { + "Missing hierarchy": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'hierarchy'", + "request_id": "v-0b8b4e6b6210217c93" + } + }, + "Missing name": { + "value": { + "code": 400, + "key": "invalid_payload", + "message": "Invalid payload", + "details": "Payload should have required property 'name'", + "request_id": "v-0b8b4f418390217d82" } } } } } - }, - "/v1/metadata-schemas": { - "get": { - "operationId": "list-metadata-schemas", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "List Metadata Schemas", - "description": "Retrieve metadata schema definitions.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] + } + } + } + }, + "/v1/metadata-schema-object": { + "get": { + "operationId": "metadata-schema-object", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "Metadata Schema Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Metadata Schema Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/21_obj_metadata_schema_object" } - ], - "responses": { - "200": { - "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/21_res_list_metadata_shemas" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "schemas", - "schemas": [ - { - "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", - "related_object": "Payment", - "properties": { - "payment_tax": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "payment_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": true, - "created_at": "2022-03-07T11:01:01.747Z", - "updated_at": "2022-03-07T11:01:44.785Z", - "object": "metadata_schema" - }, - { - "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", - "related_object": "campaign", - "properties": { - "Store": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - }, - "locale": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_tag": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "date_time_tag": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "deleted": true, - "optional": true, - "objectType": null - }, - "height_customer_number": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_country_string": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T13:33:44.556Z", - "updated_at": "2022-07-26T13:57:42.288Z", - "object": "metadata_schema" - }, - { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "birth_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "CRM_created_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "customer_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.894Z", - "updated_at": "2022-07-14T15:15:34.928Z", - "object": "metadata_schema" - }, - { - "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", - "related_object": "earning_rule", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "minLength": 6, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:54:07.980Z", - "updated_at": null, - "object": "metadata_schema" - }, - { - "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", - "related_object": "loyalty_tier", - "properties": { - "has_funds": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:22:16.685Z", - "updated_at": "2022-07-27T08:55:01.628Z", - "object": "metadata_schema" - }, - { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "Payment": { - "type": "object", - "array": false, - "deleted": true, - "optional": true, - "objectType": "Payment" - }, - "day_of_week": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "number_of_store_visits": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.798Z", - "updated_at": "2022-04-20T06:47:10.350Z", - "object": "metadata_schema" - }, - { - "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", - "related_object": "order_item", - "properties": { - "Size": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "Color": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Thickness": { - "eq": [ - "Thin", - "Medium", - "Thick" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-11T13:32:55.029Z", - "updated_at": "2022-05-23T13:46:01.463Z", - "object": "metadata_schema" - }, - { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "color": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "origin": { - "type": "string", - "array": false, - "optional": true, - "minLength": 1, - "objectType": null - }, - "product_location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_date_property": { - "type": "date", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_number_property": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_boolean_property": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - }, - "metadata_attribute_name_with_datetime_property": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.880Z", - "updated_at": "2022-07-14T15:46:47.994Z", - "object": "metadata_schema" - }, - { - "id": "ms_th8YHt9yFYY1yAA99XOasT5W", - "related_object": "promotion_tier", - "properties": { - "has_budget": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:21.523Z", - "updated_at": "2022-07-27T08:54:42.909Z", - "object": "metadata_schema" - }, - { - "id": "ms_Z7niydc0OpGjDRL4yB40niXn", - "related_object": "publication", - "properties": { - "year": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-03-30T06:23:49.715Z", - "updated_at": "2022-04-19T10:28:24.568Z", - "object": "metadata_schema" - }, - { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "store_names": { - "eq": [ - "Store 1 - New York - Broadway", - "Store 2 - Florida - Miami", - "Store 3 - London - Heathrow", - "Store 4 - Berlin - Alexanderplatz" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-03T06:33:45.890Z", - "updated_at": "2022-07-26T14:58:24.546Z", - "object": "metadata_schema" - }, - { - "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", - "related_object": "reward", - "properties": { - "Type": { - "type": "string", - "array": false, - "optional": true, - "objectType": null, - "exactLength": 4 - } - }, - "allow_defined_only": false, - "created_at": "2022-07-27T08:53:32.257Z", - "updated_at": "2022-07-27T08:53:48.542Z", - "object": "metadata_schema" - }, - { - "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", - "related_object": "voucher", - "properties": { - "unit": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "Region": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "CATEGORY": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "active_on_calendar_month": { - "eq": [ - 1, - 2, - 3, - 5, - 7, - 9, - 10, - 11, - 12 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T07:22:01.281Z", - "updated_at": "2022-06-22T07:22:09.577Z", - "object": "metadata_schema" - } - ], - "total": 13 - } + } + } + } + } + } + }, + "/v1/metadata-schemas": { + "get": { + "operationId": "list-metadata-schemas", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "List Metadata Schemas", + "description": "Retrieve metadata schema definitions.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns an array of metadata schema definitions. The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager while creating a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/21_res_list_metadata_shemas" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "schemas", + "schemas": [ + { + "id": "ms_yqMHRHH6S1KYIHPmQHealNf4", + "related_object": "Payment", + "properties": { + "payment_tax": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "payment_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": true, + "created_at": "2022-03-07T11:01:01.747Z", + "updated_at": "2022-03-07T11:01:44.785Z", + "object": "metadata_schema" + }, + { + "id": "ms_DwUjpX32sY3fJEoQELpS7bN3", + "related_object": "campaign", + "properties": { + "Store": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + }, + "locale": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_tag": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "date_time_tag": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "favorite_brands": { + "type": "string", + "array": true, + "deleted": true, + "optional": true, + "objectType": null + }, + "height_customer_number": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_country_string": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T13:33:44.556Z", + "updated_at": "2022-07-26T13:57:42.288Z", + "object": "metadata_schema" + }, + { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "birth_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "CRM_created_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "customer_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.894Z", + "updated_at": "2022-07-14T15:15:34.928Z", + "object": "metadata_schema" + }, + { + "id": "ms_7X7krsG84H6MeNuIaKkb4LXN", + "related_object": "earning_rule", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "minLength": 6, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-07-27T08:54:07.980Z", + "updated_at": null, + "object": "metadata_schema" + }, + { + "id": "ms_OF36L2rk4EqhdxvZs56IW9iE", + "related_object": "loyalty_tier", + "properties": { + "has_funds": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-30T06:22:16.685Z", + "updated_at": "2022-07-27T08:55:01.628Z", + "object": "metadata_schema" + }, + { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "Payment": { + "type": "object", + "array": false, + "deleted": true, + "optional": true, + "objectType": "Payment" + }, + "day_of_week": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + }, + "number_of_store_visits": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.798Z", + "updated_at": "2022-04-20T06:47:10.350Z", + "object": "metadata_schema" + }, + { + "id": "ms_0qgIlxP7bYb8H59DqpnWBCUN", + "related_object": "order_item", + "properties": { + "Size": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Color": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Thickness": { + "eq": [ + "Thin", + "Medium", + "Thick" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-11T13:32:55.029Z", + "updated_at": "2022-05-23T13:46:01.463Z", + "object": "metadata_schema" + }, + { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "color": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "origin": { + "type": "string", + "array": false, + "optional": true, + "minLength": 1, + "objectType": null + }, + "product_location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_date_property": { + "type": "date", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_number_property": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_boolean_property": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + }, + "metadata_attribute_name_with_datetime_property": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.880Z", + "updated_at": "2022-07-14T15:46:47.994Z", + "object": "metadata_schema" + }, + { + "id": "ms_th8YHt9yFYY1yAA99XOasT5W", + "related_object": "promotion_tier", + "properties": { + "has_budget": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:21.523Z", + "updated_at": "2022-07-27T08:54:42.909Z", + "object": "metadata_schema" + }, + { + "id": "ms_Z7niydc0OpGjDRL4yB40niXn", + "related_object": "publication", + "properties": { + "year": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-03-30T06:23:49.715Z", + "updated_at": "2022-04-19T10:28:24.568Z", + "object": "metadata_schema" + }, + { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "store_names": { + "eq": [ + "Store 1 - New York - Broadway", + "Store 2 - Florida - Miami", + "Store 3 - London - Heathrow", + "Store 4 - Berlin - Alexanderplatz" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-03T06:33:45.890Z", + "updated_at": "2022-07-26T14:58:24.546Z", + "object": "metadata_schema" + }, + { + "id": "ms_EnSASZVEIDsZAYa8Z0nG8Rlg", + "related_object": "reward", + "properties": { + "Type": { + "type": "string", + "array": false, + "optional": true, + "objectType": null, + "exactLength": 4 + } + }, + "allow_defined_only": false, + "created_at": "2022-07-27T08:53:32.257Z", + "updated_at": "2022-07-27T08:53:48.542Z", + "object": "metadata_schema" + }, + { + "id": "ms_xUHvkRBPvVJAlWcTkVzufKx4", + "related_object": "voucher", + "properties": { + "unit": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "Region": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "CATEGORY": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "active_on_calendar_month": { + "eq": [ + 1, + 2, + 3, + 5, + 7, + 9, + 10, + 11, + 12 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T07:22:01.281Z", + "updated_at": "2022-06-22T07:22:09.577Z", + "object": "metadata_schema" } - } + ], + "total": 13 } } } } } + } + } + } + }, + "/v1/metadata-schemas/{resource}": { + "parameters": [ + { + "schema": { + "type": "string" }, - "/v1/metadata-schemas/{resource}": { - "parameters": [ - { + "name": "resource", + "in": "path", + "required": true, + "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas." + } + ], + "get": { + "operationId": "get-metadata-schema", + "tags": [ + "METADATA SCHEMAS API" + ], + "summary": "Get Metadata Schema", + "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.", + "content": { + "application/json": { "schema": { - "type": "string" + "$ref": "#/components/schemas/21_obj_metadata_schema_object" }, - "name": "resource", - "in": "path", - "required": true, - "description": "There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas." - } - ], - "get": { - "operationId": "get-metadata-schema", - "tags": [ - "METADATA SCHEMAS API" - ], - "summary": "Get Metadata Schema", - "description": "Retrieve metadata schema per resource type.\n\n## Resource types\n\n### Standard\n\nYou can retrieve metadata schemas for the standard metadata schema definitions listed below. Add one of these types as the resource path parameter.\n\n- `campaign`\n- `customer`\n- `earning_rule`\n- `loyalty_tier`\n- `order`\n- `order_item`\n- `product`\n- `promotion_tier`\n- `publication`\n- `redemption`\n- `reward`\n- `voucher`\n\n### Custom\n\nThere is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas. Provide one of the resource types that you have defined as a resource type. [Read more](https://support.voucherify.io/article/99-schema-validation-metadata#add-metadata).", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the **Project Settings** > **Metadata Schema** definitions. For example, an unknown metadata property can be defined in the campaign manager.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/21_obj_metadata_schema_object" - }, - "examples": { - "earning_rule": { - "value": { - "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", - "related_object": "earning_rule", - "properties": { - "channel_id": { - "type": "string", - "array": true, - "optional": true, - "objectType": null, - "exactLength": 5 - }, - "channel_name": { - "eq": [ - "instagram", - "facebook", - "google", - "twitter", - "linkedin", - "website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:09:59.970Z", - "updated_at": "2022-08-25T13:11:15.704Z", - "object": "metadata_schema" - } + "examples": { + "earning_rule": { + "value": { + "id": "ms_27vMXZqBAkkqBoOuw8EYTRLn", + "related_object": "earning_rule", + "properties": { + "channel_id": { + "type": "string", + "array": true, + "optional": true, + "objectType": null, + "exactLength": 5 }, - "campaign": { - "value": { - "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", - "related_object": "campaign", - "properties": { - "region": { - "eq": [ - "EMEA", - "AMER", - "APAC" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:12:58.447Z", - "updated_at": null, - "object": "metadata_schema" - } + "channel_name": { + "eq": [ + "instagram", + "facebook", + "google", + "twitter", + "linkedin", + "website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:09:59.970Z", + "updated_at": "2022-08-25T13:11:15.704Z", + "object": "metadata_schema" + } + }, + "campaign": { + "value": { + "id": "ms_psGSDpVl6JcPilPA7toZ83Kj", + "related_object": "campaign", + "properties": { + "region": { + "eq": [ + "EMEA", + "AMER", + "APAC" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:12:58.447Z", + "updated_at": null, + "object": "metadata_schema" + } + }, + "customer": { + "value": { + "id": "ms_f0r4hm3ta6a4a5ch3ma", + "related_object": "customer", + "properties": { + "age": { + "type": "number", + "array": false, + "optional": true, + "objectType": null }, - "customer": { - "value": { - "id": "ms_f0r4hm3ta6a4a5ch3ma", - "related_object": "customer", - "properties": { - "age": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "city_id": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "favorite_brands": { - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "acquisition_channel": { - "eq": [ - "Facebook", - "Twitter", - "Website" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "customer_life_time_value": { - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.889Z", - "updated_at": "2022-09-12T07:34:49.163Z", - "object": "metadata_schema" - } + "city_id": { + "type": "number", + "array": false, + "optional": true, + "objectType": null }, - "loyalty_tier": { - "value": { - "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", - "related_object": "loyalty_tier", - "properties": { - "level_name": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "audience_restricted": { - "type": "boolean", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:14:54.954Z", - "updated_at": "2022-08-25T13:15:24.436Z", - "object": "metadata_schema" - } + "location": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "order": { - "value": { - "id": "ms_f1r5Tm3ta6a4a5ch3ma", - "related_object": "order", - "properties": { - "card": { - "eq": [ - "Visa", - "MasterCard", - "Other" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "currency": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "ne": [ - 1, - 2, - 18, - 22 - ], - "type": "number", - "array": false, - "optional": true, - "objectType": null - }, - "store_city": { - "eq": [ - "Hampden", - "San Francisco", - "Warsaw" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "payment_mean": { - "eq": [ - "credit-card", - "wire-transfer", - "paypal" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "booking_end_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - }, - "booking_start_date": { - "type": "datetime", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:47.575Z", - "updated_at": "2022-10-25T10:05:18.978Z", - "object": "metadata_schema" - } + "favorite_brands": { + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "acquisition_channel": { + "eq": [ + "Facebook", + "Twitter", + "Website" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "customer_life_time_value": { + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.889Z", + "updated_at": "2022-09-12T07:34:49.163Z", + "object": "metadata_schema" + } + }, + "loyalty_tier": { + "value": { + "id": "ms_jHUoFlgepKVEftxK1pKPGZlO", + "related_object": "loyalty_tier", + "properties": { + "level_name": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "audience_restricted": { + "type": "boolean", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:14:54.954Z", + "updated_at": "2022-08-25T13:15:24.436Z", + "object": "metadata_schema" + } + }, + "order": { + "value": { + "id": "ms_f1r5Tm3ta6a4a5ch3ma", + "related_object": "order", + "properties": { + "card": { + "eq": [ + "Visa", + "MasterCard", + "Other" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "currency": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "location": { + "ne": [ + 1, + 2, + 18, + 22 + ], + "type": "number", + "array": false, + "optional": true, + "objectType": null + }, + "store_city": { + "eq": [ + "Hampden", + "San Francisco", + "Warsaw" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "order_item": { - "value": { - "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", - "related_object": "order_item", - "properties": { - "manufacturer_id": { - "gte": 15, - "type": "number", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:03.167Z", - "updated_at": null, - "object": "metadata_schema" - } + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "product": { - "value": { - "id": "ms_s3c0N6m3ta6a4a5ch3ma", - "related_object": "product", - "properties": { - "vendor": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "category": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "location": { - "type": "geopoint", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.298Z", - "updated_at": "2022-07-14T15:53:29.226Z", - "object": "metadata_schema" - } + "payment_mean": { + "eq": [ + "credit-card", + "wire-transfer", + "paypal" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null }, - "promotion_tier": { - "value": { - "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", - "related_object": "promotion_tier", - "properties": { - "level": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:04.937Z", - "updated_at": "2022-09-23T08:51:46.266Z", - "object": "metadata_schema" - } + "booking_end_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null }, - "publication": { - "value": { - "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", - "related_object": "publication", - "properties": { - "file_uploaded": { - "type": "image_url", - "array": false, - "optional": true, - "objectType": null - }, - "publication_method": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-08-25T13:16:35.534Z", - "updated_at": "2022-09-12T10:26:31.135Z", - "object": "metadata_schema" - } + "booking_start_date": { + "type": "datetime", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:47.575Z", + "updated_at": "2022-10-25T10:05:18.978Z", + "object": "metadata_schema" + } + }, + "order_item": { + "value": { + "id": "ms_7ux44AEnt82bqo8ww5V1SXzV", + "related_object": "order_item", + "properties": { + "manufacturer_id": { + "gte": 15, + "type": "number", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:03.167Z", + "updated_at": null, + "object": "metadata_schema" + } + }, + "product": { + "value": { + "id": "ms_s3c0N6m3ta6a4a5ch3ma", + "related_object": "product", + "properties": { + "vendor": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "redemption": { - "value": { - "id": "ms_t4ir0Dm3ta6a4a5ch3ma", - "related_object": "redemption", - "properties": { - "location_id": { - "eq": [ - "L1", - "L2", - "L3" - ], - "type": "string", - "array": true, - "optional": true, - "objectType": null - }, - "redemption_location": { - "type": "object", - "array": false, - "optional": true, - "objectType": "Location" - } - }, - "allow_defined_only": false, - "created_at": "2021-12-01T08:00:48.794Z", - "updated_at": "2022-08-25T13:19:50.497Z", - "object": "metadata_schema" - } + "category": { + "type": "string", + "array": false, + "optional": true, + "objectType": null }, - "reward": { - "value": { - "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", - "related_object": "reward", - "properties": { - "reward_type": { - "eq": [ - "MATERIAL", - "PAY-WITH-POINTS", - "DISCOUNT-COUPON", - "GIFT-CARD-CREDITS", - "LOYALTY POINTS" - ], - "type": "string", - "array": false, - "optional": false, - "objectType": null - } - }, - "allow_defined_only": true, - "created_at": "2022-08-25T13:07:13.689Z", - "updated_at": "2022-08-25T13:08:26.696Z", - "object": "metadata_schema" - } + "location": { + "type": "geopoint", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.298Z", + "updated_at": "2022-07-14T15:53:29.226Z", + "object": "metadata_schema" + } + }, + "promotion_tier": { + "value": { + "id": "ms_dNb5aLMzU0VBCiRuxLOeMNwn", + "related_object": "promotion_tier", + "properties": { + "level": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:04.937Z", + "updated_at": "2022-09-23T08:51:46.266Z", + "object": "metadata_schema" + } + }, + "publication": { + "value": { + "id": "ms_fzvWNh7sU4LeykEQ2Abpg6jG", + "related_object": "publication", + "properties": { + "file_uploaded": { + "type": "image_url", + "array": false, + "optional": true, + "objectType": null }, - "voucher": { - "value": { - "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", - "related_object": "voucher", - "properties": { - "lang": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "Season": { - "eq": [ - "Spring", - "Summer", - "Fall", - "Winter" - ], - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "marketing_text": { - "type": "string", - "array": false, - "optional": true, - "objectType": null - }, - "ProductionVoucherCodeMetaData": { - "type": "string", - "array": false, - "deleted": true, - "optional": true, - "objectType": null - } - }, - "allow_defined_only": false, - "created_at": "2022-01-24T10:42:23.994Z", - "updated_at": "2022-09-19T14:13:30.590Z", - "object": "metadata_schema" - } + "publication_method": { + "type": "string", + "array": false, + "optional": true, + "objectType": null } - } + }, + "allow_defined_only": false, + "created_at": "2022-08-25T13:16:35.534Z", + "updated_at": "2022-09-12T10:26:31.135Z", + "object": "metadata_schema" } - } - }, - "404": { - "description": "Returns an error if the resource provided in the path is not found.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find metadata schema with id earning_rules", - "request_id": "v-0c1b9ce0098a391421", - "resource_id": "earning_rules", - "resource_type": "metadata schema" - } + }, + "redemption": { + "value": { + "id": "ms_t4ir0Dm3ta6a4a5ch3ma", + "related_object": "redemption", + "properties": { + "location_id": { + "eq": [ + "L1", + "L2", + "L3" + ], + "type": "string", + "array": true, + "optional": true, + "objectType": null + }, + "redemption_location": { + "type": "object", + "array": false, + "optional": true, + "objectType": "Location" } - } + }, + "allow_defined_only": false, + "created_at": "2021-12-01T08:00:48.794Z", + "updated_at": "2022-08-25T13:19:50.497Z", + "object": "metadata_schema" + } + }, + "reward": { + "value": { + "id": "ms_PwrAtwqCFXeH4Qix22gEkqhl", + "related_object": "reward", + "properties": { + "reward_type": { + "eq": [ + "MATERIAL", + "PAY-WITH-POINTS", + "DISCOUNT-COUPON", + "GIFT-CARD-CREDITS", + "LOYALTY POINTS" + ], + "type": "string", + "array": false, + "optional": false, + "objectType": null + } + }, + "allow_defined_only": true, + "created_at": "2022-08-25T13:07:13.689Z", + "updated_at": "2022-08-25T13:08:26.696Z", + "object": "metadata_schema" + } + }, + "voucher": { + "value": { + "id": "ms_9uE6eP17Jvoxl46mCqL6Q3Ut", + "related_object": "voucher", + "properties": { + "lang": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "Season": { + "eq": [ + "Spring", + "Summer", + "Fall", + "Winter" + ], + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "marketing_text": { + "type": "string", + "array": false, + "optional": true, + "objectType": null + }, + "ProductionVoucherCodeMetaData": { + "type": "string", + "array": false, + "deleted": true, + "optional": true, + "objectType": null + } + }, + "allow_defined_only": false, + "created_at": "2022-01-24T10:42:23.994Z", + "updated_at": "2022-09-19T14:13:30.590Z", + "object": "metadata_schema" } } } } } }, - "/v1/location-object": { - "get": { - "operationId": "location-object", - "tags": [ - "LOCATIONS API" - ], - "summary": "Location Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Location Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/22_obj_location_object" - } + "404": { + "description": "Returns an error if the resource provided in the path is not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find metadata schema with id earning_rules", + "request_id": "v-0c1b9ce0098a391421", + "resource_id": "earning_rules", + "resource_type": "metadata schema" } } } } } + } + } + } + }, + "/v1/location-object": { + "get": { + "operationId": "location-object", + "tags": [ + "LOCATIONS API" + ], + "summary": "Location Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Location Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_obj_location_object" + } + } + } + } + } + } + }, + "/v1/locations": { + "get": { + "operationId": "list-locations", + "tags": [ + "LOCATIONS API" + ], + "summary": "List Locations", + "description": "Returns a list of your locations.", + "parameters": [ + { + "$ref": "#/components/parameters/limit" }, - "/v1/locations": { - "get": { - "operationId": "list-locations", - "tags": [ - "LOCATIONS API" - ], - "summary": "List Locations", - "description": "Returns a list of your locations.", - "parameters": [ + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "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." + }, + { + "name": "filters", + "in": "query", + "required": false, + "schema": { + "anyOf": [ { - "$ref": "#/components/parameters/limit" + "$ref": "#/components/schemas/22_filter_updated_at" }, { - "name": "order", - "in": "query", - "required": false, - "schema": { - "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." + "$ref": "#/components/schemas/22_filter_created_at" }, { - "name": "filters", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/22_filter_updated_at" - }, - { - "$ref": "#/components/schemas/22_filter_created_at" - }, - { - "$ref": "#/components/schemas/22_filter_name" - }, - { - "$ref": "#/components/schemas/22_filter_id" - } - ] - }, - "description": "Filter the locations using one of the available filters.", - "style": "deepObject", - "explode": true + "$ref": "#/components/schemas/22_filter_name" }, { - "name": "end_date", - "in": "query", - "required": false, - "schema": { - "type": "string", - "format": "date-time" - }, - "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/22_res_list_locations" - }, - "examples": { - "Example": { - "value": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } - }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - }, - { - "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", - "object": "location", - "name": "New York", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - -74.016167, - 40.703186 - ], - [ - -74.008687, - 40.750656 - ], - [ - -73.943597, - 40.851838 - ], - [ - -73.928559, - 40.845285 - ], - [ - -73.936152, - 40.8356 - ], - [ - -73.934298, - 40.810015 - ], - [ - -73.92711, - 40.795145 - ], - [ - -73.978623, - 40.710432 - ], - [ - -74.013201, - 40.701619 - ], - [ - -74.016167, - 40.703186 - ] - ] - ] - } - }, - "created_at": "2022-07-15T05:37:45.299Z", - "updated_at": null - }, - { - "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", - "object": "location", - "name": "Germany", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:51.303908897065064,10.222253628401518", - "radius": "192.37 km" - } - }, - "created_at": "2022-07-14T15:51:39.265Z", - "updated_at": null - }, - { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ - [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], - [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 - ] - ] - ] - } - }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null - } - ], - "total": 4, - "has_more": false - } - } - } - } - } + "$ref": "#/components/schemas/22_filter_id" } - } - } + ] + }, + "description": "Filter the locations using one of the available filters.", + "style": "deepObject", + "explode": true }, - "/v1/locations/{locationId}": { - "get": { - "operationId": "get-location", - "tags": [ - "LOCATIONS API" - ], - "summary": "Get Location", - "description": "Returns a location object.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "name": "locationId", - "in": "path", - "required": true, - "description": "The unique location ID." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "200": { - "description": "Returns a location object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/22_obj_location_object" - }, - "examples": { - "Circle Example": { - "value": { - "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", - "object": "location", - "name": "Belleville", - "shape": { - "type": "circle", - "format": "distance", - "distance": { - "center": "geo:40.79372699823857,-74.15092132694554", - "radius": "1.54 km" - } - }, - "created_at": "2022-07-15T06:04:36.924Z", - "updated_at": null - } + { + "name": "end_date", + "in": "query", + "required": false, + "schema": { + "type": "string", + "format": "date-time" + }, + "description": "A filter on the list based on the end date. This will filter out all locations who's end date falls before the specified date and time. A date value must be presented in ISO 8601 format (`2016-11-16T14:14:31Z` or `2016-11-16`)." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_res_list_locations" + }, + "examples": { + "Example": { + "value": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" + } + }, + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null + }, + { + "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF", + "object": "location", + "name": "New York", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + -74.016167, + 40.703186 + ], + [ + -74.008687, + 40.750656 + ], + [ + -73.943597, + 40.851838 + ], + [ + -73.928559, + 40.845285 + ], + [ + -73.936152, + 40.8356 + ], + [ + -73.934298, + 40.810015 + ], + [ + -73.92711, + 40.795145 + ], + [ + -73.978623, + 40.710432 + ], + [ + -74.013201, + 40.701619 + ], + [ + -74.016167, + 40.703186 + ] + ] + ] + } + }, + "created_at": "2022-07-15T05:37:45.299Z", + "updated_at": null + }, + { + "id": "loc_f5HqjVaiq7g9ISlmivpytxSf", + "object": "location", + "name": "Germany", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:51.303908897065064,10.222253628401518", + "radius": "192.37 km" + } + }, + "created_at": "2022-07-14T15:51:39.265Z", + "updated_at": null }, - "Polygon Example": { - "value": { - "id": "loc_RcYz537sV07e1t5aG5tIH9FD", - "object": "location", - "name": "Poland", - "shape": { - "type": "polygon", - "format": "geojson", - "geojson": { - "type": "Polygon", - "coordinates": [ + { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], [ - [ - 18.553923, - 50.559107 - ], - [ - 18.528805, - 51.087437 - ], - [ - 19.591667, - 50.832424 - ], - [ - 19.425109, - 50.497984 - ], - [ - 19.375814, - 50.330652 - ], - [ - 19.398107, - 50.111652 - ], - [ - 18.73906, - 49.981498 - ], - [ - 18.272477, - 50.088707 - ], - [ - 18.553923, - 50.559107 - ] + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 ] ] - } - }, - "created_at": "2022-07-14T15:21:55.085Z", - "updated_at": null - } + ] + } + }, + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null } - } + ], + "total": 4, + "has_more": false } } } } } - }, - "/v1/qualification-object": { - "get": { - "operationId": "qualification-object", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Qualification Object", - "description": "Data model description", - "responses": { - "200": { - "description": "Qualification Object", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" - } + } + } + } + }, + "/v1/locations/{locationId}": { + "get": { + "operationId": "get-location", + "tags": [ + "LOCATIONS API" + ], + "summary": "Get Location", + "description": "Returns a location object.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "locationId", + "in": "path", + "required": true, + "description": "The unique location ID." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a location object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/22_obj_location_object" + }, + "examples": { + "Circle Example": { + "value": { + "id": "loc_NoMGXmHO9OUs7iz9mGWpamma", + "object": "location", + "name": "Belleville", + "shape": { + "type": "circle", + "format": "distance", + "distance": { + "center": "geo:40.79372699823857,-74.15092132694554", + "radius": "1.54 km" + } + }, + "created_at": "2022-07-15T06:04:36.924Z", + "updated_at": null + } + }, + "Polygon Example": { + "value": { + "id": "loc_RcYz537sV07e1t5aG5tIH9FD", + "object": "location", + "name": "Poland", + "shape": { + "type": "polygon", + "format": "geojson", + "geojson": { + "type": "Polygon", + "coordinates": [ + [ + [ + 18.553923, + 50.559107 + ], + [ + 18.528805, + 51.087437 + ], + [ + 19.591667, + 50.832424 + ], + [ + 19.425109, + 50.497984 + ], + [ + 19.375814, + 50.330652 + ], + [ + 19.398107, + 50.111652 + ], + [ + 18.73906, + 49.981498 + ], + [ + 18.272477, + 50.088707 + ], + [ + 18.553923, + 50.559107 + ] + ] + ] + } + }, + "created_at": "2022-07-14T15:21:55.085Z", + "updated_at": null } } } } } - }, - "/v1/qualifications": { - "post": { - "operationId": "check-eligibility", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Check Eligibility", - "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "description": "Define order and customer context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_req_create_qualification" - } - } - } - }, - "responses": { - "200": { - "description": "Returns a qualifications object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" - } - } - } + } + } + } + }, + "/v1/qualification-object": { + "get": { + "operationId": "qualification-object", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Qualification Object", + "description": "Data model description", + "responses": { + "200": { + "description": "Qualification Object", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" } } } - }, - "/client/v1/qualifications": { - "post": { - "operationId": "check-eligibility-client-side", - "tags": [ - "QUALIFICATIONS API" - ], - "summary": "Check Eligibility (client-side)", - "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", - "parameters": [], - "security": [ - { - "X-Client-Application-Id-1": [], - "X-Client-Token-1": [] - } - ], - "requestBody": { - "description": "Define order and customer context.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_req_create_qualification" - } - } + } + } + } + }, + "/v1/qualifications": { + "post": { + "operationId": "check-eligibility", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Check Eligibility", + "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "requestBody": { + "description": "Define order and customer context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_req_create_qualification" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a qualifications object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" } - }, - "responses": { - "200": { - "description": "Returns a qualifications object.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/23_obj_qualification_object" - } - } - } + } + } + } + } + } + }, + "/client/v1/qualifications": { + "post": { + "operationId": "check-eligibility-client-side", + "tags": [ + "QUALIFICATIONS API" + ], + "summary": "Check Eligibility (client-side)", + "description": "Generate a list of redeemables that are applicable in the context of the customer and order.\n\nThe new qualifications method is an improved version of [Campaign Qualifications](ref:examine-campaigns-qualification), [Voucher Qualifications](ref:examine-vouchers-qualification), and [Promotions Validation](ref:validate-promotions) API requests. The new qualification method introduces the following improvements:\n\n- Qualification results are returned faster\n- No limit on the number of returned redeemables\n- Introduces new qualification scenarios, not available in the previous version\n\n> 👍 Scenario Guide\n>\n> Read our dedicated guide to learn about some use cases this endpoint can cover [here](doc:checking-eligibility).\n\n## Paging \n\nThe Voucherify Qualifications API request will return to you all of the redeemables available for the customer in batches of up to 50 redeemables. To get the next batch of redeemables, you need to use the `starting_after` cursor.\n\nTo process of paging the redeemables works in the following manner:\n\n- You send the first API request for Qualifications without the `starting_after` parameter.\n- The response will contain a parameter named `has_more`. If the parameter's value is set to `true`, then more redeemables are available.\n- Get the value of the `created_at` parameter of the last returned redeemable. The value of this parameter will be used as a cursor to retrieve the next page of redeemables.\n- Send another API request for Qualification with the `starting_after` parameter set to the value taken from the `created_at` parameter from the last returned redeemable.\n- Voucherify will return the next page of redeemables.\n- If the `has_more` parameter is set to `true`, apply steps 3-5 to get the next page of redeemables.", + "parameters": [], + "security": [ + { + "X-Client-Application-Id-1": [], + "X-Client-Token-1": [] + } + ], + "requestBody": { + "description": "Define order and customer context.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_req_create_qualification" + } + } + } + }, + "responses": { + "200": { + "description": "Returns a qualifications object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/23_obj_qualification_object" } } } From 1b142142905c8daebec4b234c64daba422284f74 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:28:58 +0200 Subject: [PATCH 046/108] list voucher transactions --- Changelog.md | 3 + ...VOUCHERS-API-List-Voucher-Transactions.md} | 4 +- reference/OpenAPI.json | 117 +++++------------- 3 files changed, 37 insertions(+), 87 deletions(-) rename docs/reference-docs/{VOUCHERS-API-List-Gift-Card-Transactions.md => VOUCHERS-API-List-Voucher-Transactions.md} (85%) diff --git a/Changelog.md b/Changelog.md index da4deaaf3..0bb8efb1f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,8 @@ # Changelog +# 20231017 + +- Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions ## 20231012 - Product Collections diff --git a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md similarity index 85% rename from docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md rename to docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md index 0c0946408..d9c3268fd 100644 --- a/docs/reference-docs/VOUCHERS-API-List-Gift-Card-Transactions.md +++ b/docs/reference-docs/VOUCHERS-API-List-Voucher-Transactions.md @@ -1,8 +1,8 @@ --- -title: List Gift Card Transactions +title: List Voucher Transactions type: endpoint categorySlug: voucherify-api -slug: list-gift-card-transactions +slug: list-voucher-transactions parentDocSlug: vouchers-api hidden: false order: 11 diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index dae42e817..68439c889 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3890,8 +3890,8 @@ } } }, - "1_res_vouchers_code_transactions": { - "title": "Get Gift Card Transactions Response Body", + "vouchers_list_vouchers_transactions_response_body": { + "title": "List Voucher Transactions Response Body", "type": "object", "description": "List of voucher transactions", "properties": { @@ -3909,7 +3909,7 @@ "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/1_obj_gift_card_transaction_object" + "$ref": "#/components/schemas/gift_card_transaction" } }, "has_more": { @@ -3918,25 +3918,37 @@ } } }, - "1_obj_gift_card_transaction_object": { + "voucher_transaction": { + "title": "Voucher Transaction Object", + "description": "List of voucher transactions", + "anyOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction" + }, + { + "$ref": "#/components/schemas/LoyaltyCardTransaction" + } + ] + }, + "gift_card_transaction": { "title": "Gift Card Transaction Object", - "description": "Gift card transaction object", + "description": "List of gift card transactions", "anyOf": [ { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_redemption" + "$ref": "#/components/schemas/gift_card_transaction_redemption_details" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_refund" + "$ref": "#/components/schemas/gift_card_transaction_refund_details" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_addition" + "$ref": "#/components/schemas/gift_card_transaction_addition_details" }, { - "$ref": "#/components/schemas/1_obj_gift_card_transaction_object_removal" + "$ref": "#/components/schemas/gift_card_transaction_removal_details" } ] }, - "1_obj_gift_card_transaction_object_redemption": { + "gift_card_transaction_redemption_details": { "title": "Redemption", "description": "When credits are used to pay for an order.", "type": "object", @@ -4068,7 +4080,7 @@ } } }, - "1_obj_gift_card_transaction_object_refund": { + "gift_card_transaction_refund_details": { "title": "Refund", "description": "When funds are credited back to a card through a redemption rollback.", "type": "object", @@ -4211,7 +4223,7 @@ } } }, - "1_obj_gift_card_transaction_object_addition": { + "gift_card_transaction_addition_details": { "title": "Addition", "description": "When funds are deposited to a gift card.", "type": "object", @@ -4317,7 +4329,7 @@ } } }, - "1_obj_gift_card_transaction_object_removal": { + "gift_card_transaction_removal_details": { "title": "Removal", "description": "When funds are removed from a gift card.", "type": "object", @@ -39540,9 +39552,6 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, "type": "object", "properties": { "id": { @@ -39680,9 +39689,6 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, "type": "string", "enum": [ "order.paid", @@ -39697,9 +39703,6 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, "type": "object", "properties": { "type": { @@ -39731,9 +39734,6 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, "type": "object", "properties": { "type": { @@ -39785,9 +39785,6 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, "type": "object", "properties": { "type": { @@ -39839,9 +39836,6 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, "type": "object", "properties": { "type": { @@ -39899,9 +39893,6 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, "type": "object", "properties": { "type": { @@ -39968,9 +39959,6 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, "type": "object", "properties": { "type": { @@ -40037,9 +40025,6 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, "type": "object", "properties": { "type": { @@ -43373,9 +43358,6 @@ }, "LoyaltiesCreateTiersRequestBody": { "title": "Loyalties Create Tiers Request Body", - "x-stoplight": { - "id": "i1emmwlaqp7lt" - }, "type": "array", "items": { "allOf": [ @@ -43396,31 +43378,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 +43417,6 @@ }, "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", - "x-stoplight": { - "id": "zs0z1cyyzac9u" - }, "type": "object", "properties": { "limit": { @@ -43465,16 +43432,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 +43473,6 @@ }, "LoyaltiesListMemberLoyaltyTiersResponseBody": { "title": "Loyalties List Member Loyalty Tiers Response Body", - "x-stoplight": { - "id": "s3zpgud510xl6" - }, "type": "object", "properties": { "object": { @@ -43587,9 +43545,6 @@ }, "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", - "x-stoplight": { - "id": "i180zbh3ffwaa" - }, "type": "object", "properties": { "object": { @@ -43627,9 +43582,6 @@ }, "LoyaltyTierBase": { "title": "Loyalty Tier Base", - "x-stoplight": { - "id": "3af9422223696" - }, "type": "object", "properties": { "name": { @@ -43787,9 +43739,6 @@ }, "MappingMultiply": { "title": "MappingMultiply", - "x-stoplight": { - "id": "7zrwgr2oqh4tj" - }, "type": "object", "properties": { "type": { @@ -43807,9 +43756,6 @@ }, "MappingFixed": { "title": "MappingFixed", - "x-stoplight": { - "id": "86eksegayxcxa" - }, "type": "object", "properties": { "type": { @@ -44846,7 +44792,8 @@ "name", "filter" ] - } + }, + "v": {} }, "examples": { "req_vouchers_metadata_1": { @@ -47716,8 +47663,8 @@ "X-App-Token-1": [] } ], - "summary": "List Gift Card Transactions", - "description": "List transactions that are associated with credit movements on a gift card.", + "summary": "List Voucher Transactions", + "description": "List transactions that are associated with credit movements on a gift card or loyalty card.", "responses": { "200": { "description": "Returns a dictionary of transaction objects", From 41e78a5b3cde50a900f7683f469e996873ea93f8 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:33:10 +0200 Subject: [PATCH 047/108] done --- scripts/manage-project.ts | 125 +++++++++++++++++++++++++++++++------- 1 file changed, 103 insertions(+), 22 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 9726d38b8..8dcee5825 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -9,8 +9,7 @@ dotenv.config(); const options = minimist(process.argv.slice(2)); const versionTag = options.versionTag || options.vt; const versionOption = options.version || options.v; - -const createNew = options.create || options.c; +const { create, update } = options; const help = options.help || options.h; const mainVersion = "v2018-08-01"; @@ -34,11 +33,17 @@ const main = async () => { console.log( colors.green( `options:` + - `\n"versionTag" or "vt" for versionTag, for example "npm run manage-project -- --vt=piotr-1234"` + - `\n"version" or "v" for version, for example "npm run manage-project -- --v=v2018-08-01-piotr-1234"` + - `\n"create" or "c" for version, for example "npm run manage-project -- --vt=piotr-1234" --c` + - `\n\nuse "versionTag" or "version" for version, not both!` + - `\n\nby default, cleans up version (not creates one)` + `\n"versionTag" or "vt" for versionTag` + + `\n"version" or "v" for version` + + `\n"create" if you want to create such version` + + `\n"update" if you want to update such version` + + `\n\nversionTag or version is required!` + + `\ncreate or update option is required!` + + `\n\nexamples:` + + `\nnpm run manage-project -- --vt=piotr-123 --create` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --create` + + `\nnpm run manage-project -- --vt=piotr-123 --update` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --update` ) ); return; @@ -46,12 +51,28 @@ const main = async () => { if (!version) { console.log( colors.red( - "invalid arguments, check `help` for more information\nrun 'npm run manage-project -- --help'" + "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return; + } + if (!create && !update) { + console.log( + colors.red( + "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return; + } + if (create && update) { + console.log( + colors.red( + "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" ) ); return; } - if (createNew) { + if (create) { await createNewVersion(version); } await cleanProject(version); @@ -70,7 +91,7 @@ const main = async () => { ?.includes?.( `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.` ) || - stderr + stdout ) { console.log(colors.green("OPEN API FILE WAS UPLOADED")); return resolve(true); @@ -84,7 +105,7 @@ const main = async () => { console.log(colors.green("BUILDING MD TABLES FROM OPEN API...")); await new Promise((resolve) => { exec(`npm run build-md-tables-from-openapi`, (error, stdout, stderr) => { - if (stderr) { + if (stdout) { console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); return resolve(true); } @@ -95,7 +116,7 @@ const main = async () => { console.log(colors.green("UPDATING MD TABLES IN DOCS...")); await new Promise((resolve) => { exec(`npm run update-md-tables-in-doc`, (error, stdout, stderr) => { - if (stderr) { + if (stdout) { console.log( colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!") ); @@ -108,23 +129,80 @@ const main = async () => { console.log(colors.green("UPLOADING GUIDES DOC FILES...")); await new Promise((resolve) => { exec( - `rdme docs ./docs/guides --version=${version} --create`, + `rdme docs ./docs/guides --version=${version}`, (error, stdout, stderr) => { - if (stderr) { - console.log(colors.green("GUIDES FILES WERE UPLOADED!")); + if (stdout?.includes("successfully created")) { + console.log(colors.green("GUIDES DOC FILES WERE UPLOADED!")); return resolve(true); } console.log(colors.red(error?.toString?.())); - throw new Error("GUIDES WERE NOT UPLOADED!"); + throw new Error("GUIDES DOC WERE NOT UPLOADED!"); } ); }); - + console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); + const maxNumberOfUploadingAttempts = 3; + for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { + const success = await updateReferenceDocs(version); + if (success) { + console.log(colors.green("REFERENCE DOC FILES WERE UPLOADED!")); + break; + } + if (i === maxNumberOfUploadingAttempts) { + throw new Error("REFERENCE DOC WERE NOT UPLOADED!"); + } + await new Promise((r) => setTimeout(r, 10000)); + } + // console.log( + // colors.green( + // "FIXING TYPES AND ORDER OF OPEN API REFERENCES IN README.IO..." + // ) + // ); + // await new Promise((resolve) => { + // exec( + // `npm run readme-fix-reference-docs -- --version=${version}`, + // (error, stdout, stderr) => { + // if (stdout) { + // console.log( + // colors.green( + // "TYPES AND ORDER OF OPEN API REFERENCES IN README.IO WERE FIXED!" + // ) + // ); + // return resolve(true); + // } + // console.log(colors.red(error?.toString?.())); + // throw new Error( + // "TYPES AND ORDER OF OPEN API REFERENCES IN README.IO WERE NOT FIXED!" + // ); + // } + // ); + // }); console.log( colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) ); }; +const updateReferenceDocs = async (version) => { + return await new Promise((resolve, reject) => { + exec( + `rdme docs ./docs/reference-docs --version=${version}`, + (error, stdout, stderr) => { + if ( + stderr?.includes( + `We couldn't save this doc (Unable to find a category with the slug 'voucherify-api')` + ) + ) { + return resolve(false); + } + if (stdout?.includes("successfully created")) { + return resolve(true); + } + return resolve(false); + } + ); + }); +}; + const createNewVersion = async (version) => { //create fork try { @@ -169,11 +247,13 @@ const cleanProject = async (version) => { async (category) => await deleteCategory(version, category.slug) ); console.log(colors.green(`OLD CATEGORIES DELETED!`)); - //create categories - await asyncMap( - [...listOfGuideCategories, ...listOfReferenceCategories], - async (title) => await createCategory(version, title) - ); + //create categories one by one (creation order is important) + for (const categoryTitle of [ + ...listOfGuideCategories, + ...listOfReferenceCategories, + ]) { + await createCategory(version, categoryTitle); + } console.log(colors.green(`NEW CATEGORIES CREATED!`)); const allCategories = await getAllCategories(version); //update reference categories types @@ -191,6 +271,7 @@ const cleanProject = async (version) => { await asyncMap(allApiSpecifications, deleteSpecification); console.log(colors.green(`API SPECIFICATIONS DELETED!`)); console.log(colors.green(`VERSION "${version}" IS CLEANED UP!`)); + return; }; const updateCategory = async (version, slug, data = {}) => { From 17d84433fba73c77595b0ced58ca28bd57e0c92e Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:38:52 +0200 Subject: [PATCH 048/108] list gift card transactions --- reference/OpenAPI.json | 196 ++++++++++++++--------------------------- 1 file changed, 66 insertions(+), 130 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 68439c889..d5385b05e 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3906,17 +3906,20 @@ "description": "Identifies the name of the attribute that contains the array of transaction objects." }, "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/gift_card_transaction" - } + "$ref": "#/components/schemas/voucher_transaction", + "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object." }, "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" + ] }, "voucher_transaction": { "title": "Voucher Transaction Object", @@ -3931,26 +3934,24 @@ ] }, "gift_card_transaction": { - "title": "Gift Card Transaction Object", + "title": "Gift Card Transaction", "description": "List of gift card transactions", - "anyOf": [ + "allOf": [ { - "$ref": "#/components/schemas/gift_card_transaction_redemption_details" + "$ref": "#/components/schemas/gift_card_transaction_identity" }, { - "$ref": "#/components/schemas/gift_card_transaction_refund_details" + "$ref": "#/components/schemas/gift_card_transaction_base" }, { - "$ref": "#/components/schemas/gift_card_transaction_addition_details" + "$ref": "#/components/schemas/gift_card_transaction_response_data" }, { - "$ref": "#/components/schemas/gift_card_transaction_removal_details" + "$ref": "#/components/schemas/gift_card_transaction_details" } ] }, - "gift_card_transaction_redemption_details": { - "title": "Redemption", - "description": "When credits are used to pay for an order.", + "gift_card_transaction_identity": { "type": "object", "properties": { "id": { @@ -3961,7 +3962,12 @@ "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. In case of a redemption, this value is `null`." - }, + } + } + }, + "gift_card_transaction_base": { + "type": "object", + "properties": { "voucher_id": { "type": "string", "description": "Unique voucher ID.", @@ -3972,6 +3978,49 @@ "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" }, + "reason": { + "type": "string", + "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." + }, + "related_transaction_id": { + "type": "string", + "description": "This field is `null` in the case of gift voucher transactions." + } + } + }, + "gift_card_transaction_response_data": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-02-25T13:32:08.734Z", + "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." + } + } + }, + "gift_card_transaction_details": { + "type": "object", + "anyOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_redemption_details" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_refund_details" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_addition_details" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_removal_details" + } + ] + }, + "gift_card_transaction_redemption_details": { + "title": "Redemption", + "description": "When credits are used to pay for an order.", + "type": "object", + "properties": { "source": { "type": "string", "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`.", @@ -3980,10 +4029,6 @@ "API" ] }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - }, "type": { "type": "string", "description": "Type of transaction.", @@ -4067,16 +4112,6 @@ } } } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, @@ -4085,25 +4120,6 @@ "description": "When funds are credited back to a card through a redemption rollback.", "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a redemption rollback, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, "source": { "type": "string", "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", @@ -4112,10 +4128,6 @@ "API" ] }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption rollback, this value is `null`." - }, "type": { "type": "string", "description": "Type of transaction.", @@ -4210,16 +4222,6 @@ } } } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, @@ -4228,25 +4230,6 @@ "description": "When funds are deposited to a gift card.", "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, "source": { "type": "string", "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", @@ -4255,10 +4238,6 @@ "API" ] }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, "type": { "type": "string", "description": "Type of transaction.", @@ -4316,16 +4295,6 @@ } } } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, @@ -4334,25 +4303,6 @@ "description": "When funds are removed from a gift card.", "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, "source": { "type": "string", "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", @@ -4361,10 +4311,6 @@ "API" ] }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, "type": { "type": "string", "description": "Type of transaction.", @@ -4422,16 +4368,6 @@ } } } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of gift voucher transactions." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } } }, @@ -47671,7 +47607,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/1_res_vouchers_code_transactions" + "$ref": "#/components/schemas/vouchers_list_vouchers_transactions_response_body" }, "examples": { "Example": { From 76bdbcd4e66d964e18e11b47c67669b43df66f0b Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:40:38 +0200 Subject: [PATCH 049/108] Update manage-project.ts --- scripts/manage-project.ts | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 8dcee5825..f83b96f8c 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -153,30 +153,6 @@ const main = async () => { } await new Promise((r) => setTimeout(r, 10000)); } - // console.log( - // colors.green( - // "FIXING TYPES AND ORDER OF OPEN API REFERENCES IN README.IO..." - // ) - // ); - // await new Promise((resolve) => { - // exec( - // `npm run readme-fix-reference-docs -- --version=${version}`, - // (error, stdout, stderr) => { - // if (stdout) { - // console.log( - // colors.green( - // "TYPES AND ORDER OF OPEN API REFERENCES IN README.IO WERE FIXED!" - // ) - // ); - // return resolve(true); - // } - // console.log(colors.red(error?.toString?.())); - // throw new Error( - // "TYPES AND ORDER OF OPEN API REFERENCES IN README.IO WERE NOT FIXED!" - // ); - // } - // ); - // }); console.log( colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) ); @@ -228,7 +204,7 @@ https://dash.readme.com/api/v1/version`, ); if (response.status !== 200) { throw new Error( - `Response status: ${response.status}, maybe this versionTag is already used?` + `Response status: ${response.status}, maybe this versionTag is already created?` ); } console.log(colors.green(`FORK CREATED! VERSION "${version}"`)); From 3aaa83e4f9df83649419d2c54b6da65d2329bd7f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Tue, 17 Oct 2023 13:55:03 +0200 Subject: [PATCH 050/108] update gift card --- reference/OpenAPI.json | 269 +++++++++++++++++++++++++++++++++-------- 1 file changed, 221 insertions(+), 48 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index d5385b05e..79939955c 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3960,13 +3960,22 @@ "example": "vtx_0c9dccc4d5813e71bd" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "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`." } - } + }, + "required": [ + "id", + "source_id" + ], + "title": "Gift Card Transaction Identity" }, "gift_card_transaction_base": { "type": "object", + "title": "Gift Card Transaction Base", "properties": { "voucher_id": { "type": "string", @@ -3974,22 +3983,38 @@ "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" }, "campaign_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaing that generates bulk codes.", "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" }, "reason": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." }, "related_transaction_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "This field is `null` in the case of gift voucher transactions." } - } + }, + "required": [ + "voucher_id", + "campaign_id", + "reason", + "related_transaction_id" + ] }, "gift_card_transaction_response_data": { "type": "object", + "title": "Gift Card Transaction Response Data", "properties": { "created_at": { "type": "string", @@ -3997,7 +4022,10 @@ "example": "2022-02-25T13:32:08.734Z", "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." } - } + }, + "required": [ + "created_at" + ] }, "gift_card_transaction_details": { "type": "object", @@ -4014,7 +4042,8 @@ { "$ref": "#/components/schemas/gift_card_transaction_removal_details" } - ] + ], + "title": "Gift Card Transaction Details" }, "gift_card_transaction_redemption_details": { "title": "Redemption", @@ -4022,11 +4051,10 @@ "type": "object", "properties": { "source": { - "type": "string", "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`.", - "enum": [ - "voucherify-web-ui", - "API" + "type": [ + "string", + "null" ] }, "type": { @@ -4040,15 +4068,30 @@ "details": { "type": "object", "description": "Contains the detailed information about the transaction.", + "required": [ + "balance", + "order", + "redemption" + ], "properties": { "balance": { "type": "object", "description": "Contains information on how the balance was affected by the transaction.", + "required": [ + "type", + "total", + "amount", + "object", + "balance", + "related_object" + ], "properties": { "type": { - "type": "string", "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" + "default": "gift_voucher", + "enum": [ + "gift_voucher" + ] }, "total": { "type": "integer", @@ -4059,9 +4102,11 @@ "description": "The amount being used up by the redemption. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "object": { - "type": "string", "description": "The type of object represented by the JSON.", - "default": "balance" + "default": "balance", + "enum": [ + "balance" + ] }, "balance": { "type": "integer", @@ -4070,6 +4115,10 @@ "related_object": { "type": "object", "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "required": [ + "id", + "type" + ], "properties": { "id": { "type": "string", @@ -4077,9 +4126,11 @@ "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, "type": { - "type": "string", "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "default": "voucher", + "enum": [ + "voucher" + ] } } } @@ -4088,6 +4139,10 @@ "order": { "type": "object", "description": "Contains information about the original order.", + "required": [ + "id", + "source_id" + ], "properties": { "id": { "type": "string", @@ -4095,7 +4150,10 @@ "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "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." } } @@ -4103,6 +4161,9 @@ "redemption": { "type": "object", "description": "Contains information about the original redemption.", + "required": [ + "id" + ], "properties": { "id": { "type": "string", @@ -4113,7 +4174,12 @@ } } } - } + }, + "required": [ + "source", + "type", + "details" + ] }, "gift_card_transaction_refund_details": { "title": "Refund", @@ -4121,12 +4187,11 @@ "type": "object", "properties": { "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`.", - "enum": [ - "voucherify-web-ui", - "API" - ] + "type": [ + "string", + "null" + ], + "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a redemption rollback, this value is `null`." }, "type": { "type": "string", @@ -4139,15 +4204,31 @@ "details": { "type": "object", "description": "Contains the detailed information about the transaction.", + "required": [ + "balance", + "order", + "redemption", + "rollback" + ], "properties": { "balance": { "type": "object", "description": "Contains information on how the balance was affected by the transaction.", + "required": [ + "type", + "total", + "amount", + "object", + "balance", + "related_object" + ], "properties": { "type": { - "type": "string", "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" + "default": "gift_voucher", + "enum": [ + "gift_voucher" + ] }, "total": { "type": "integer", @@ -4158,9 +4239,11 @@ "description": "The amount being returned. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "object": { - "type": "string", "description": "The type of object represented by the JSON.", - "default": "balance" + "default": "balance", + "enum": [ + "balance" + ] }, "balance": { "type": "integer", @@ -4169,6 +4252,10 @@ "related_object": { "type": "object", "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "required": [ + "id", + "type" + ], "properties": { "id": { "type": "string", @@ -4176,9 +4263,11 @@ "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, "type": { - "type": "string", "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "default": "voucher", + "enum": [ + "voucher" + ] } } } @@ -4187,6 +4276,10 @@ "order": { "type": "object", "description": "Contains information about the original order.", + "required": [ + "id", + "source_id" + ], "properties": { "id": { "type": "string", @@ -4194,7 +4287,10 @@ "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "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." } } @@ -4202,6 +4298,9 @@ "redemption": { "type": "object", "description": "Contains information about the original redemption.", + "required": [ + "id" + ], "properties": { "id": { "type": "string", @@ -4213,6 +4312,9 @@ "rollback": { "type": "object", "description": "Contains information about the redemption rollback.", + "required": [ + "id" + ], "properties": { "id": { "type": "string", @@ -4223,7 +4325,12 @@ } } } - } + }, + "required": [ + "source", + "type", + "details" + ] }, "gift_card_transaction_addition_details": { "title": "Addition", @@ -4249,15 +4356,29 @@ "details": { "type": "object", "description": "Contains the detailed information about the transaction.", + "required": [ + "balance" + ], "properties": { "balance": { "type": "object", "description": "Contains information on how the balance was affected by the transaction.", + "required": [ + "type", + "total", + "amount", + "object", + "balance", + "related_object", + "operation_type" + ], "properties": { "type": { - "type": "string", "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" + "default": "gift_voucher", + "enum": [ + "gift_voucher" + ] }, "total": { "type": "integer", @@ -4268,9 +4389,11 @@ "description": "The amount being added. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "object": { - "type": "string", "description": "The type of object represented by the JSON.", - "default": "balance" + "default": "balance", + "enum": [ + "balance" + ] }, "balance": { "type": "integer", @@ -4279,6 +4402,10 @@ "related_object": { "type": "object", "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "required": [ + "id", + "type" + ], "properties": { "id": { "type": "string", @@ -4286,17 +4413,30 @@ "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, "type": { - "type": "string", "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "default": "voucher", + "enum": [ + "voucher" + ] } } + }, + "operation_type": { + "enum": [ + "MANUAL", + "AUTOMATIC" + ] } } } } } - } + }, + "required": [ + "source", + "type", + "details" + ] }, "gift_card_transaction_removal_details": { "title": "Removal", @@ -4322,15 +4462,29 @@ "details": { "type": "object", "description": "Contains the detailed information about the transaction.", + "required": [ + "balance" + ], "properties": { "balance": { "type": "object", "description": "Contains information on how the balance was affected by the transaction.", + "required": [ + "type", + "total", + "amount", + "object", + "balance", + "related_object", + "operation_type" + ], "properties": { "type": { - "type": "string", "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "gift_voucher" + "default": "gift_voucher", + "enum": [ + "gift_voucher" + ] }, "total": { "type": "integer", @@ -4341,9 +4495,11 @@ "description": "The amount being subtracted. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 amount is written as 10000." }, "object": { - "type": "string", "description": "The type of object represented by the JSON.", - "default": "balance" + "default": "balance", + "enum": [ + "balance" + ] }, "balance": { "type": "integer", @@ -4352,6 +4508,10 @@ "related_object": { "type": "object", "description": "Defines the resource that is being modified with the values that are returned in the balance object.", + "required": [ + "id", + "type" + ], "properties": { "id": { "type": "string", @@ -4359,17 +4519,30 @@ "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" }, "type": { - "type": "string", "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" + "default": "voucher", + "enum": [ + "voucher" + ] } } + }, + "operation_type": { + "enum": [ + "MANUAL", + "AUTOMATIC" + ] } } } } } - } + }, + "required": [ + "source", + "type", + "details" + ] }, "1_req_create_gift_card_transactions_export": { "type": "object", From a4f071876f64656a56ff870f12193e29b3acf196 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:14:56 +0200 Subject: [PATCH 051/108] Update manage-project.ts --- scripts/manage-project.ts | 243 ++++++++++++++++++++++++-------------- 1 file changed, 152 insertions(+), 91 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index f83b96f8c..ebb556816 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -4,14 +4,16 @@ import colors from "colors"; import { exec } from "child_process"; import { buildMdTablesFromOpenApi } from "./build-md-tables-from-openapi"; import { updateMdTablesInDoc } from "./update-md-tables-in-doc"; +import { boolean } from "yup"; dotenv.config(); const options = minimist(process.argv.slice(2)); const versionTag = options.versionTag || options.vt; const versionOption = options.version || options.v; + +//globals const { create, update } = options; const help = options.help || options.h; - const mainVersion = "v2018-08-01"; const version = versionOption || versionTag ? `${mainVersion}-${versionTag}` : undefined; @@ -28,134 +30,169 @@ const listOfGuideCategories = [ const listOfReferenceCategories = ["Introduction"]; -const main = async () => { - if (help) { - console.log( - colors.green( - `options:` + - `\n"versionTag" or "vt" for versionTag` + - `\n"version" or "v" for version` + - `\n"create" if you want to create such version` + - `\n"update" if you want to update such version` + - `\n\nversionTag or version is required!` + - `\ncreate or update option is required!` + - `\n\nexamples:` + - `\nnpm run manage-project -- --vt=piotr-123 --create` + - `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --create` + - `\nnpm run manage-project -- --vt=piotr-123 --update` + - `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --update` - ) - ); - return; - } - if (!version) { - console.log( - colors.red( - "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); - return; - } - if (!create && !update) { - console.log( - colors.red( - "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); - return; - } - if (create && update) { - console.log( - colors.red( - "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); +const main = async ({ + help, + version, + create, + update, +}: { + help?: boolean; + version?: string; + create?: boolean; + update?: boolean; +}) => { + const valid = validateOptions({ help, version, create, update }); + if (!valid) { return; } if (create) { await createNewVersion(version); } await cleanProject(version); + await uploadOpenApiFile(version); + await buildMdTables(); + await updateMdTablesInDocs(); + await uploadGuideFiles(version); + await uploadReferenceDocsWithMaxNumberOfAttempts(version); console.log( - colors.green( - "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" - ) + colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) ); +}; + +const uploadReferenceDocsWithMaxNumberOfAttempts = async ( + version, + maxNumberOfUploadingAttempts = 6, + timeoutAfterEachFail = 5000 +) => { + console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); + for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { + const success = await updateReferenceDocs(version); + if (success) { + console.log(colors.green("REFERENCE DOC FILES WERE UPLOADED!")); + break; + } + if (i === maxNumberOfUploadingAttempts) { + throw new Error("REFERENCE DOC WERE NOT UPLOADED!"); + } + await new Promise((r) => setTimeout(r, timeoutAfterEachFail)); + } +}; + +const uploadGuideFiles = async (version) => { + console.log(colors.green("UPLOADING GUIDES DOC FILES...")); await new Promise((resolve) => { exec( - `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, + `rdme docs ./docs/guides --version=${version}`, (error, stdout, stderr) => { - if ( - error - ?.toString?.() - ?.includes?.( - `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.` - ) || - stdout - ) { - console.log(colors.green("OPEN API FILE WAS UPLOADED")); + if (stdout?.includes("successfully created")) { + console.log(colors.green("GUIDES DOC FILES WERE UPLOADED!")); return resolve(true); } - throw new Error( - error?.toString?.() || "OPEN API FILE WAS NOT UPLOADED" - ); + console.log(colors.red(error?.toString?.())); + throw new Error("GUIDES DOC WERE NOT UPLOADED!"); } ); }); - console.log(colors.green("BUILDING MD TABLES FROM OPEN API...")); +}; + +const updateMdTablesInDocs = async () => { + console.log(colors.green("UPDATING MD TABLES IN DOCS...")); await new Promise((resolve) => { - exec(`npm run build-md-tables-from-openapi`, (error, stdout, stderr) => { + exec(`npm run update-md-tables-in-doc`, (error, stdout, stderr) => { if (stdout) { - console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); + console.log( + colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!") + ); return resolve(true); } console.log(colors.red(error?.toString?.())); - throw new Error("MD TABLES WERE NOT BUILDED!"); + throw new Error("MD TABLES WERE NOT UPDATED IN DOCS!"); }); }); - console.log(colors.green("UPDATING MD TABLES IN DOCS...")); +}; +const buildMdTables = async () => { + console.log(colors.green("BUILDING MD TABLES FROM OPEN API...")); await new Promise((resolve) => { - exec(`npm run update-md-tables-in-doc`, (error, stdout, stderr) => { + exec(`npm run build-md-tables-from-openapi`, (error, stdout, stderr) => { if (stdout) { - console.log( - colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!") - ); + console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); return resolve(true); } console.log(colors.red(error?.toString?.())); - throw new Error("MD TABLES WERE NOT UPDATED IN DOCS!"); + throw new Error("MD TABLES WERE NOT BUILDED!"); }); }); - console.log(colors.green("UPLOADING GUIDES DOC FILES...")); +}; + +const uploadOpenApiFile = async (version) => { + console.log( + colors.green( + "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" + ) + ); await new Promise((resolve) => { exec( - `rdme docs ./docs/guides --version=${version}`, + `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, (error, stdout, stderr) => { - if (stdout?.includes("successfully created")) { - console.log(colors.green("GUIDES DOC FILES WERE UPLOADED!")); + if ( + error + ?.toString?.() + ?.includes?.( + `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.` + ) || + stdout + ) { + console.log(colors.green("OPEN API FILE WAS UPLOADED")); return resolve(true); } - console.log(colors.red(error?.toString?.())); - throw new Error("GUIDES DOC WERE NOT UPLOADED!"); + throw new Error( + error?.toString?.() || "OPEN API FILE WAS NOT UPLOADED" + ); } ); }); - console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); - const maxNumberOfUploadingAttempts = 3; - for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { - const success = await updateReferenceDocs(version); - if (success) { - console.log(colors.green("REFERENCE DOC FILES WERE UPLOADED!")); - break; - } - if (i === maxNumberOfUploadingAttempts) { - throw new Error("REFERENCE DOC WERE NOT UPLOADED!"); - } - await new Promise((r) => setTimeout(r, 10000)); +}; + +const validateOptions = ({ + help, + version, + create, + update, +}: { + help?: boolean; + version?: string; + create?: boolean; + update?: boolean; +}) => { + if (help || (!version && !create && !update)) { + printHelp(); + return false; } - console.log( - colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) - ); + if (!version) { + console.log( + colors.red( + "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + if (!create && !update) { + console.log( + colors.red( + "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + if (create && update) { + console.log( + colors.red( + "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + return true; }; const updateReferenceDocs = async (version) => { @@ -329,4 +366,28 @@ const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; -main(); +const printHelp = () => { + console.log( + colors.green( + `options:` + + `\n"versionTag" or "vt" for versionTag` + + `\n"version" or "v" for version` + + `\n"create" if you want to create such version` + + `\n"update" if you want to update such version` + + `\n\nversionTag or version is required!` + + `\ncreate or update option is required!` + + `\n\nexamples:` + + `\nnpm run manage-project -- --vt=piotr-123 --create` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --create` + + `\nnpm run manage-project -- --vt=piotr-123 --update` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --update` + ) + ); +}; + +main({ + help, + version, + create, + update, +}); From af514be09671abda856458455065e1aa5e830020 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:15:07 +0200 Subject: [PATCH 052/108] Update manage-project.ts --- scripts/manage-project.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index ebb556816..6891970d0 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -2,16 +2,11 @@ import dotenv from "dotenv"; import minimist from "minimist"; import colors from "colors"; import { exec } from "child_process"; -import { buildMdTablesFromOpenApi } from "./build-md-tables-from-openapi"; -import { updateMdTablesInDoc } from "./update-md-tables-in-doc"; -import { boolean } from "yup"; dotenv.config(); const options = minimist(process.argv.slice(2)); const versionTag = options.versionTag || options.vt; const versionOption = options.version || options.v; - -//globals const { create, update } = options; const help = options.help || options.h; const mainVersion = "v2018-08-01"; From b6f118ee72cff99c280f8959370ef9c8fe122e6a Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:41:06 +0200 Subject: [PATCH 053/108] Update manage-project.ts --- scripts/manage-project.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 6891970d0..517cf516b 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -73,6 +73,31 @@ const uploadReferenceDocsWithMaxNumberOfAttempts = async ( } }; +const runProcess = async ({ + command, + stdoutIncludes, + stderrIncludes, +}: { + command: string; + stdoutIncludes?: string; + stderrIncludes?: string; +}) => { + await new Promise((resolve) => { + exec(command, (error, stdout, stderr) => { + if ( + (stdoutIncludes && stdout?.includes(stdoutIncludes)) || + (!stdoutIncludes && stdout) || + (stderrIncludes && stderr.includes(stderrIncludes)) + ) { + return resolve(true); + } + if (stderr) { + console.log(stderr); + } + throw error; + }); + }); +}; const uploadGuideFiles = async (version) => { console.log(colors.green("UPLOADING GUIDES DOC FILES...")); await new Promise((resolve) => { From 286ffd4b7c57371491e86cc9d4c79e24f1d358cf Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:18:32 +0200 Subject: [PATCH 054/108] Update manage-project.ts --- scripts/manage-project.ts | 173 ++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 101 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 517cf516b..d871a1ee9 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -56,33 +56,39 @@ const main = async ({ const uploadReferenceDocsWithMaxNumberOfAttempts = async ( version, - maxNumberOfUploadingAttempts = 6, - timeoutAfterEachFail = 5000 + maxNumberOfUploadingAttempts = 6 ) => { console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { - const success = await updateReferenceDocs(version); + await new Promise((r) => setTimeout(r, 5000)); + const success = await runCliProcess({ + command: `rdme docs ./docs/reference-docs --version=${version}`, + stdoutIncludes: "successfully created", + resolveErrorAsFalse: true, + }); if (success) { console.log(colors.green("REFERENCE DOC FILES WERE UPLOADED!")); break; } if (i === maxNumberOfUploadingAttempts) { - throw new Error("REFERENCE DOC WERE NOT UPLOADED!"); + throw new Error("REFERENCE DOC FILES WERE NOT UPLOADED!"); } - await new Promise((r) => setTimeout(r, timeoutAfterEachFail)); } + return; }; -const runProcess = async ({ +const runCliProcess = async ({ command, stdoutIncludes, stderrIncludes, + resolveErrorAsFalse = false, }: { command: string; stdoutIncludes?: string; stderrIncludes?: string; + resolveErrorAsFalse?: boolean; }) => { - await new Promise((resolve) => { + return await new Promise((resolve) => { exec(command, (error, stdout, stderr) => { if ( (stdoutIncludes && stdout?.includes(stdoutIncludes)) || @@ -91,6 +97,9 @@ const runProcess = async ({ ) { return resolve(true); } + if (resolveErrorAsFalse) { + return resolve(false); + } if (stderr) { console.log(stderr); } @@ -100,48 +109,26 @@ const runProcess = async ({ }; const uploadGuideFiles = async (version) => { console.log(colors.green("UPLOADING GUIDES DOC FILES...")); - await new Promise((resolve) => { - exec( - `rdme docs ./docs/guides --version=${version}`, - (error, stdout, stderr) => { - if (stdout?.includes("successfully created")) { - console.log(colors.green("GUIDES DOC FILES WERE UPLOADED!")); - return resolve(true); - } - console.log(colors.red(error?.toString?.())); - throw new Error("GUIDES DOC WERE NOT UPLOADED!"); - } - ); + await runCliProcess({ + command: `rdme docs ./docs/guides --version=${version}`, + stdoutIncludes: "successfully created", }); + console.log(colors.green("GUIDES DOC FILES WERE UPLOADED!")); }; const updateMdTablesInDocs = async () => { console.log(colors.green("UPDATING MD TABLES IN DOCS...")); - await new Promise((resolve) => { - exec(`npm run update-md-tables-in-doc`, (error, stdout, stderr) => { - if (stdout) { - console.log( - colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!") - ); - return resolve(true); - } - console.log(colors.red(error?.toString?.())); - throw new Error("MD TABLES WERE NOT UPDATED IN DOCS!"); - }); + await runCliProcess({ + command: `npm run update-md-tables-in-doc`, }); + console.log(colors.green("MD TABLES WERE UPDATED IN DOCS SUCCESSFULLY!")); }; const buildMdTables = async () => { console.log(colors.green("BUILDING MD TABLES FROM OPEN API...")); - await new Promise((resolve) => { - exec(`npm run build-md-tables-from-openapi`, (error, stdout, stderr) => { - if (stdout) { - console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); - return resolve(true); - } - console.log(colors.red(error?.toString?.())); - throw new Error("MD TABLES WERE NOT BUILDED!"); - }); + await runCliProcess({ + command: `npm run build-md-tables-from-openapi`, }); + console.log(colors.green("MD TABLES WERE BUILDED SUCCESSFULLY!")); }; const uploadOpenApiFile = async (version) => { @@ -150,69 +137,11 @@ const uploadOpenApiFile = async (version) => { "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" ) ); - await new Promise((resolve) => { - exec( - `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, - (error, stdout, stderr) => { - if ( - error - ?.toString?.() - ?.includes?.( - `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.` - ) || - stdout - ) { - console.log(colors.green("OPEN API FILE WAS UPLOADED")); - return resolve(true); - } - throw new Error( - error?.toString?.() || "OPEN API FILE WAS NOT UPLOADED" - ); - } - ); + await runCliProcess({ + command: `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, + stderrIncludes: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.`, }); -}; - -const validateOptions = ({ - help, - version, - create, - update, -}: { - help?: boolean; - version?: string; - create?: boolean; - update?: boolean; -}) => { - if (help || (!version && !create && !update)) { - printHelp(); - return false; - } - if (!version) { - console.log( - colors.red( - "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); - return false; - } - if (!create && !update) { - console.log( - colors.red( - "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); - return false; - } - if (create && update) { - console.log( - colors.red( - "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) - ); - return false; - } - return true; + console.log(colors.green("OPEN API FILE WAS UPLOADED")); }; const updateReferenceDocs = async (version) => { @@ -386,6 +315,48 @@ const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; +const validateOptions = ({ + help, + version, + create, + update, +}: { + help?: boolean; + version?: string; + create?: boolean; + update?: boolean; +}) => { + if (help || (!version && !create && !update)) { + printHelp(); + return false; + } + if (!version) { + console.log( + colors.red( + "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + if (!create && !update) { + console.log( + colors.red( + "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + if (create && update) { + console.log( + colors.red( + "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) + ); + return false; + } + return true; +}; + const printHelp = () => { console.log( colors.green( From f7c00d0395551d66ee477340697b4bbb1527c90f Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:25:07 +0200 Subject: [PATCH 055/108] Update CONTRIBUTING.md --- CONTRIBUTING.md | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d3c1e7d0c..f2ddafbfe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,24 +106,19 @@ Good practices: - Copy `.env.example` to `.env` and add to this file your personal API Key created in readme.io: `dashboard` > `configuration` > `API Keys` ### Development process -- For each change / pull request, create your copy of the current documentation, where you will test changes. - - `npm run manage-project -- --vt={your name}-{pull request number}` - Make changes in the repository following patterns and good practices. -- Deploy changes to test your documentation: - - Deploy OpenAPI file by command `rdme openapi ./reference/OpenAPI.json --version=2018-08-01-{your name}-{pull request number} --create`. - - Update tables in mark down tables: - - `npm run build-md-tables-from-openapi` - - `npm run update-md-tables-in-doc` - - Deploy guides and reference pages: `rdme docs ./docs --version=2018-08-01-{your name}-{pull request number}` - - Fix docs order: `npm run readme-fix-docs-order -- --version=v2018-08-01-{your name}-{pull request number}` -- test changes using preview on readme.io -- if changes are fine, then: +- Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --create` - this will create new version project with your tag number. +- Visit url provided at the end of the script run to test changes using preview on readme.io +- If you need to make a change: + - Do changes... + - Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --update`- this will update your version. + - Test changes using preview on readme.io +- If changes are fine, then: - Add a note in the changelog. - `git commit` - `git push` - publish PR - ## How to merge PR and update public documentation - Test changes on readme (you can use the version prepared by the contributor). From e997b2f47cfe98ea4dd31f4768639934aff0a3b3 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:25:27 +0200 Subject: [PATCH 056/108] Update CONTRIBUTING.md --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f2ddafbfe..1436a5d58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,8 +115,7 @@ Good practices: - Test changes using preview on readme.io - If changes are fine, then: - Add a note in the changelog. - - `git commit` - - `git push` + - `git commit; git push` - publish PR ## How to merge PR and update public documentation From 9248d4ce2b32c8887dd8f23eebc547c629636117 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:31:36 +0200 Subject: [PATCH 057/108] minor changes --- CONTRIBUTING.md | 6 +++--- scripts/manage-project.ts | 36 ++++++++++++++++-------------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1436a5d58..53f009d51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,9 +110,9 @@ Good practices: - Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --create` - this will create new version project with your tag number. - Visit url provided at the end of the script run to test changes using preview on readme.io - If you need to make a change: - - Do changes... - - Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --update`- this will update your version. - - Test changes using preview on readme.io + - Do changes... + - Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --update`- this will update your version. + - Test changes using preview on readme.io - If changes are fine, then: - Add a note in the changelog. - `git commit; git push` diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index d871a1ee9..91568583b 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -168,26 +168,22 @@ const updateReferenceDocs = async (version) => { const createNewVersion = async (version) => { //create fork try { - const response = await fetch( - ` -https://dash.readme.com/api/v1/version`, - { - method: "POST", - headers: { - authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), - "content-type": "application/json", - accept: "application/json", - }, - body: JSON.stringify({ - is_beta: false, - is_stable: false, - is_hidden: true, - is_deprecated: false, - from: mainVersion, - version, - }), - } - ); + const response = await fetch(`https://dash.readme.com/api/v1/version`, { + method: "POST", + headers: { + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + "content-type": "application/json", + accept: "application/json", + }, + body: JSON.stringify({ + is_beta: false, + is_stable: false, + is_hidden: true, + is_deprecated: false, + from: mainVersion, + version, + }), + }); if (response.status !== 200) { throw new Error( `Response status: ${response.status}, maybe this versionTag is already created?` From 74af90909ef76a2f9296db9d5bd50eda41726f06 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:38:49 +0200 Subject: [PATCH 058/108] Update CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53f009d51..6f5c0b131 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,13 +106,17 @@ Good practices: - Copy `.env.example` to `.env` and add to this file your personal API Key created in readme.io: `dashboard` > `configuration` > `API Keys` ### Development process +- For each change / pull request, create your copy of the current documentation, where you will test changes. + - Create your own branch from `master`, + - Create a draft pull request - Make changes in the repository following patterns and good practices. -- Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --create` - this will create new version project with your tag number. +- Run `npm run manage-project -- --vt={your name}-{pull request number} --create` - this will create new version project with your tag number. - Visit url provided at the end of the script run to test changes using preview on readme.io - If you need to make a change: - Do changes... - - Run `npm run manage-project -- --vt={your name}-{pull request number or tag number} --update`- this will update your version. + - Run `npm run manage-project -- --vt={your name}-{pull request number} --update`- this will update your version. - Test changes using preview on readme.io + - If needed - **REPEAT** - If changes are fine, then: - Add a note in the changelog. - `git commit; git push` From b6718159b8c6552333d78dc66e1f410f04dc5812 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:45:50 +0200 Subject: [PATCH 059/108] Update manage-project.ts --- scripts/manage-project.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 91568583b..0a89ea43f 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -42,6 +42,13 @@ const main = async ({ } if (create) { await createNewVersion(version); + } else if (!(await isVersionExists(version))) { + console.log( + colors.red( + `Version ${version} does not exist! Create it first. Use parameter --update instead of --create` + ) + ); + return; } await cleanProject(version); await uploadOpenApiFile(version); @@ -54,6 +61,23 @@ const main = async ({ ); }; +const isVersionExists = async (version: string) => { + return ( + ( + await fetch( + `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).status === 200 + ); +}; + const uploadReferenceDocsWithMaxNumberOfAttempts = async ( version, maxNumberOfUploadingAttempts = 6 From df3c7fde7a5dc6ebf7d104d7876629c2b5cc6e98 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:45:17 +0200 Subject: [PATCH 060/108] export voucher transactions --- Changelog.md | 1 + ...UCHERS-API-Export-Voucher-Transactions.md} | 4 +- reference/OpenAPI.json | 107 +++++++++--------- 3 files changed, 58 insertions(+), 54 deletions(-) rename docs/reference-docs/{VOUCHERS-API-Export-Gift-Card-Transactions.md => VOUCHERS-API-Export-Voucher-Transactions.md} (84%) diff --git a/Changelog.md b/Changelog.md index 0bb8efb1f..198087fb4 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ # 20231017 - Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions +- Vouchers - Export Gift Card Transactions (**GET** `/vouchers/{code}/transactions/export`) renamed to Export Voucher Transactions ## 20231012 - Product Collections diff --git a/docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md b/docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md similarity index 84% rename from docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md rename to docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md index a8ae97057..d5c9a8d9e 100644 --- a/docs/reference-docs/VOUCHERS-API-Export-Gift-Card-Transactions.md +++ b/docs/reference-docs/VOUCHERS-API-Export-Voucher-Transactions.md @@ -1,8 +1,8 @@ --- -title: Export Gift Card Transactions +title: Export Voucher Transactions type: endpoint categorySlug: voucherify-api -slug: export-gift-card-transactions +slug: export-voucher-transactions parentDocSlug: vouchers-api hidden: false order: 12 diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 79939955c..cad605e16 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -4544,18 +4544,18 @@ "details" ] }, - "1_req_create_gift_card_transactions_export": { + "vouchers_export_transactions_request_body": { "type": "object", "title": "Create Gift Card Transactions Export Request Body", "description": "Request body schema for **POST** `/vouchers/transactions/export`.", "properties": { "parameters": { - "$ref": "#/components/schemas/1_obj_export_gift_card_transactions", + "$ref": "#/components/schemas/voucher_transactions_export", "description": "Contains the parameters that define the data to be exported." } } }, - "1_obj_export_gift_card_transactions": { + "voucher_transactions_export_parameters": { "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", "title": "Export Transactions", "type": "object", @@ -4571,19 +4571,7 @@ "fields": { "type": "array", "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] + "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id" ], "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "items": { @@ -4592,7 +4580,7 @@ } } }, - "1_obj_export_transactions_object": { + "voucher_transactions_export": { "title": "Export Object", "type": "object", "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", @@ -4603,9 +4591,11 @@ "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" }, "object": { - "type": "string", "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." + "description": "The type of object being represented. This object stores information about the `export`.", + "enum": [ + "export" + ] }, "created_at": { "type": "string", @@ -4617,10 +4607,7 @@ "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", - "IN_PROGRESS", - "DONE", - "ERROR" + "SCHEDULED" ] }, "channel": { @@ -4629,16 +4616,24 @@ "default": "API" }, "exported_object": { - "type": "string", "description": "The type of exported object.", - "default": "voucher_transactions" + "default": "voucher_transactions", + "enum": [ + "voucher_transactions" + ] }, "parameters": { "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" }, "result": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "Contains the URL of the CSV file.", + "required": [ + "url" + ], "properties": { "url": { "type": "string", @@ -4647,11 +4642,25 @@ } }, "user_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" } - } + }, + "required": [ + "id", + "object", + "created_at", + "status", + "channel", + "exported_object", + "parameters", + "result", + "user_id" + ] }, "1_req_vouchers_import": { "title": "Import Vouchers Request Body", @@ -35763,8 +35772,8 @@ } }, "16_obj_export_gift_card_transactions": { - "description": "List of available fields and filters that can be exported with gift card transactions along with the sorting order of the returned data.", - "title": "gift card transactions", + "description": "List of available fields and filters that can be exported with gift card or loyalty card transactions along with the sorting order of the returned data.", + "title": "Voucher Transactions", "type": "object", "properties": { "order": { @@ -35778,19 +35787,7 @@ "fields": { "type": "array", "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details" - ] + "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id" ], "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "items": { @@ -35798,9 +35795,12 @@ } }, "filters": { - "$ref": "#/components/schemas/16_obj_filter_gift_card_transactions_voucher_id" + "$ref": "#/components/schemas/voucher_transactions_export_filter_conditions" } - } + }, + "required": [ + "filters" + ] }, "16_obj_export_loyalty_card_transactions": { "description": "List of available fields and filters that can be exported with loyalty card transactions along with the sorting order of the returned data.", @@ -36076,7 +36076,7 @@ } } }, - "16_obj_filter_gift_card_transactions_voucher_id": { + "voucher_transactions_export_filter_conditions": { "description": "Filter conditions set on`the `voucher_id`.", "title": "Filter by voucher ID", "type": "object", @@ -36087,7 +36087,10 @@ "junction": { "$ref": "#/components/schemas/16_filter_junction" } - } + }, + "required": [ + "voucher_id" + ] }, "16_obj_filter_loyalty_card_transactions_voucher_id": { "description": "Filter conditions set on`the `voucher_id`.", @@ -48052,7 +48055,7 @@ } ], "post": { - "operationId": "export-gift-card-transactions", + "operationId": "export-voucher-transactions", "tags": [ "VOUCHERS API" ], @@ -48063,14 +48066,14 @@ "X-App-Token-1": [] } ], - "summary": "Export Gift Card Transactions", - "description": "Export transactions that are associated with credit movements on a gift card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "summary": "Export Voucher Transactions", + "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "requestBody": { "description": "Specify the parameters for the transaction export.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/1_req_create_gift_card_transactions_export" + "$ref": "#/components/schemas/vouchers_export_transactions_request_body" }, "examples": { "Example": { @@ -48103,7 +48106,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/1_obj_export_transactions_object" + "$ref": "#/components/schemas/voucher_transactions_export" }, "examples": { "Example": { From cbea76c1b3efe8ac7ed7b3709389d5f029fcd951 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:56:49 +0200 Subject: [PATCH 061/108] Update OpenAPI.json --- reference/OpenAPI.json | 50 +++++------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index cad605e16..9a80e9f5d 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -4556,7 +4556,7 @@ } }, "voucher_transactions_export_parameters": { - "description": "List of available fields and filters that can be exported with a gift card transactions export along with the sorting order of the returned data.", + "description": "List of available fields and filters that can be exported with a gift card or loyalty card transactions export along with the sorting order of the returned data.", "title": "Export Transactions", "type": "object", "properties": { @@ -4623,7 +4623,7 @@ ] }, "parameters": { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + "$ref": "#/components/schemas/voucher_transactions_filters" }, "result": { "type": [ @@ -24603,49 +24603,11 @@ "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", "properties": { "parameters": { - "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", + "$ref": "#/components/schemas/voucher_transactions_export_parameters", "description": "Contains the parameters that define the data to be exported." } } }, - "8_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_TRANSFER_OUT`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_REFUND`
                                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                                  - `voucherify-web-ui`
                                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" - } - } - } - }, "8_obj_export_transactions_object": { "title": "Export Object", "type": "object", @@ -35294,7 +35256,7 @@ "$ref": "#/components/schemas/16_obj_export_points_expiration" }, { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + "$ref": "#/components/schemas/voucher_transactions_filters" }, { "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" @@ -35386,7 +35348,7 @@ "$ref": "#/components/schemas/16_obj_export_points_expiration" }, { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" + "$ref": "#/components/schemas/voucher_transactions_filters" }, { "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" @@ -35771,7 +35733,7 @@ } } }, - "16_obj_export_gift_card_transactions": { + "voucher_transactions_filters": { "description": "List of available fields and filters that can be exported with gift card or loyalty card transactions along with the sorting order of the returned data.", "title": "Voucher Transactions", "type": "object", From 11030962aa842237e9b04afe45f6909eb8752dd5 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:34:11 +0200 Subject: [PATCH 062/108] validation rules assignments --- reference/OpenAPI.json | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 9a80e9f5d..da6f58dc7 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -9198,7 +9198,7 @@ "description": "The type of object represented by JSON. This object stores information about the promotion tier." }, "validation_rule_assignments": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body" }, "category_id": { "type": "string", @@ -34760,8 +34760,8 @@ } } }, - "13_obj_validation_rule_assignment_object": { - "title": "Validation Rule Assignment Object", + "validation_rule_assignment": { + "title": "Validation Rule Assignment", "type": "object", "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", "x-tags": [ @@ -34802,13 +34802,23 @@ "format": "date-time" }, "object": { - "type": "string", "default": "validation_rules_assignment", - "description": "The type of object represented by the ID." + "description": "The type of object represented by the ID.", + "enum": [ + "validation_rules_assignment" + ] } - } + }, + "required": [ + "id", + "rule_id", + "related_object_id", + "related_object_type", + "created_at", + "object" + ] }, - "13_res_validation-rules_validationRuleId_assignments": { + "validation_rules_list_rules_assignments_response_body": { "type": "object", "description": "Validation Rule Assignments", "title": "Validation Rule Assignments", @@ -34827,14 +34837,20 @@ "type": "array", "description": "A dictionary that contains an array of validation rule assignments.", "items": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + "$ref": "#/components/schemas/validation_rule_assignment" } }, "total": { "type": "integer", "description": "Total number of validation rule assignments." } - } + }, + "required": [ + "object", + "data_ref", + "data", + "total" + ] }, "13_req_create_validation_rule_assignments": { "description": "Respone body schema for **POST** `/validation-rules/{validationRuleId}/assignments`.", @@ -81031,7 +81047,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + "$ref": "#/components/schemas/validation_rule_assignment" } } } @@ -81858,7 +81874,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body" }, "examples": { "Example": { @@ -81984,7 +82000,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/13_res_validation-rules_validationRuleId_assignments" + "$ref": "#/components/schemas/validation_rules_list_rules_assignments_response_body" }, "examples": { "Example": { @@ -82081,7 +82097,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/13_obj_validation_rule_assignment_object" + "$ref": "#/components/schemas/validation_rule_assignment" }, "examples": { "Example": { From c18db1129209d64f6f1569c03cc4c22e6cfecb2d Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:50:47 +0200 Subject: [PATCH 063/108] update md-tables --- docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md | 6 +++--- docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md | 6 +++--- .../STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md | 6 +++--- ...ALIDATION-RULES-API-Validation-Rule-Assignment-Object.md | 4 ++-- reference/OpenAPI.json | 2 +- scripts/md-tables.ts | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md index aad809190..d909455cb 100644 --- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md +++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md @@ -194,7 +194,7 @@ order: 1 |:-----|:--------| | object
                                  `string` |

                                  The type of object represented by JSON. This object stores information about validation rule assignments.

                                  | | data_ref
                                  `string` |

                                  Identifies the name of the JSON property that contains the array of validation rule assignments.

                                  | -| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) | +| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment](#validation-rule-assignment) | | total
                                  `integer` |

                                  Total number of validation rule assignments.

                                  | ## Calendar Periods @@ -211,7 +211,7 @@ order: 1 | unit
                                  `string` |

                                  Defines the type of unit of time in which the rounding period is counted.

                                  Available values: `MONTH` | | value
                                  `integer` |

                                  Value for the unit of time that the rounding applies to. Units for this parameter are defined by the rounding.unit parameter.

                                  • 0: January
                                  • 1: February
                                  • 2: March
                                  • 3: April
                                  • 4: May
                                  • 5: June
                                  • 6: July
                                  • 7: August
                                  • 8: September
                                  • 9: October
                                  • 10: November
                                  • 11: December
                                  | -## Validation Rule Assignment Object +## Validation Rule Assignment | Attributes | Description | |:-----|:--------| | id
                                  `string` |

                                  Validation rule assignment ID.

                                  **Example:**

                                  asgm_74F7QZoYbUoljwQO

                                  | @@ -219,7 +219,7 @@ order: 1 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object
                                  `string` |

                                  The type of object represented by the ID.

                                  | +| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md index 747fe1737..c60c6e87e 100644 --- a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md +++ b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md @@ -88,7 +88,7 @@ order: 1 |:-----|:--------| | object
                                  `string` |

                                  The type of object represented by JSON. This object stores information about validation rule assignments.

                                  | | data_ref
                                  `string` |

                                  Identifies the name of the JSON property that contains the array of validation rule assignments.

                                  | -| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) | +| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment](#validation-rule-assignment) | | total
                                  `integer` |

                                  Total number of validation rule assignments.

                                  | ## Category Object @@ -101,7 +101,7 @@ order: 1 | updated_at
                                  `string` |

                                  Timestamp representing the date and time when the category was updated in ISO 8601 format.

                                  **Example:**

                                  2022-08-16T10:52:08.094Z

                                  | | object
                                  `string` |

                                  The type of object represented by the JSON. This object stores information about the category.

                                  | -## Validation Rule Assignment Object +## Validation Rule Assignment | Attributes | Description | |:-----|:--------| | id
                                  `string` |

                                  Validation rule assignment ID.

                                  **Example:**

                                  asgm_74F7QZoYbUoljwQO

                                  | @@ -109,7 +109,7 @@ order: 1 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object
                                  `string` |

                                  The type of object represented by the ID.

                                  | +| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md index 30b3ff6b7..99e03545e 100644 --- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md +++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md @@ -403,7 +403,7 @@ One of: |:-----|:--------| | object
                                  `string` |

                                  The type of object represented by JSON. This object stores information about validation rule assignments.

                                  | | data_ref
                                  `string` |

                                  Identifies the name of the JSON property that contains the array of validation rule assignments.

                                  | -| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment Object](#validation-rule-assignment-object) | +| data
                                  `array` |

                                  A dictionary that contains an array of validation rule assignments.

                                  Array of [Validation Rule Assignment](#validation-rule-assignment) | | total
                                  `integer` |

                                  Total number of validation rule assignments.

                                  | ## Unstacked Redemption @@ -411,7 +411,7 @@ One of: |:-----|:--------| | redemption_ID
                                  `object` |

                                  The property name is the unique redemption ID; i.e. r_0ba186c4824e4881e1. This object contains information about the redemption of an incentive.

                                  AttributesDescription
                                  date
                                  string

                                  Timestamp representing the date and time when the redemption was created in ISO 8601 format.

                                  Example:

                                  2022-09-02T17:06:56.649Z

                                  related_object_type
                                  string

                                  The source of the incentive.

                                  Available values: voucher, promotion_tier
                                  related_object_id
                                  string

                                  Unique ID of the related object that defines the incentive.

                                  related_object_parent_id
                                  string

                                  Represent's the campaign ID of the voucher if the redemption was based on a voucher that was part of bulk codes generated within a campaign. In case of a promotion tier, this represents the campaign ID of the promotion tier's parent campaign.

                                  | -## Validation Rule Assignment Object +## Validation Rule Assignment | Attributes | Description | |:-----|:--------| | id
                                  `string` |

                                  Validation rule assignment ID.

                                  **Example:**

                                  asgm_74F7QZoYbUoljwQO

                                  | @@ -419,7 +419,7 @@ One of: | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object
                                  `string` |

                                  The type of object represented by the ID.

                                  | +| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md index 64c763d7b..239083436 100644 --- a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md +++ b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md @@ -8,7 +8,7 @@ hidden: false order: 2 --- -## Validation Rule Assignment Object +## Validation Rule Assignment | Attributes | Description | |:-----|:--------| | id
                                  `string` |

                                  Validation rule assignment ID.

                                  **Example:**

                                  asgm_74F7QZoYbUoljwQO

                                  | @@ -16,7 +16,7 @@ order: 2 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object
                                  `string` |

                                  The type of object represented by the ID.

                                  | +| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index da6f58dc7..e626c3ae6 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -4581,7 +4581,7 @@ } }, "voucher_transactions_export": { - "title": "Export Object", + "title": "Export", "type": "object", "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", "properties": { diff --git a/scripts/md-tables.ts b/scripts/md-tables.ts index 48f4506f1..ae788b855 100644 --- a/scripts/md-tables.ts +++ b/scripts/md-tables.ts @@ -20,7 +20,7 @@ export const mdTables: [string, string?][] = [ ['11_obj_sku_object', 'PRODUCTS-API-SKU-Object.md'], ['product_collections_collection_item', 'PRODUCT-COLLECTIONS-API-Product-Collection-Object.md'], ['13_obj_validation_rule_object', 'VALIDATION-RULES-API-Validation-Rule-Object.md'], - ['13_obj_validation_rule_assignment_object', 'VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md'], + ['validation_rule_assignment', 'VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md'], ['14_obj_segment_object', 'SEGMENTS-API-Customer-Segment-Object.md'], ['15_req_track_custom_event', 'EVENTS-API-Custom-Event-Object.md'], ['18_res_list_consents_GET', 'CONSENTS-API-Consents-Object.md'], 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 064/108] 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 065/108] 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 066/108] 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 6112ac15d2155bd01df06006e29a75f6c15ae0b9 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:08:09 +0200 Subject: [PATCH 067/108] removing unused schemas --- reference/OpenAPI.json | 5331 ++++------------------------------------ 1 file changed, 441 insertions(+), 4890 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index dae42e817..5df63f4b4 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -193,42 +193,6 @@ "description": "A **code** that identifies the voucher.", "required": true }, - "X-App-Id": { - "name": "X-App-Id", - "in": "header", - "required": true, - "schema": { - "type": "string" - }, - "description": "Application ID" - }, - "X-App-Token": { - "name": "X-App-Token", - "in": "header", - "required": true, - "schema": { - "type": "string" - }, - "description": "Application Secret Key" - }, - "X-Client-Token": { - "name": "X-Client-Token", - "in": "header", - "required": true, - "schema": { - "type": "string" - }, - "description": "Application Secret Key" - }, - "X-Client-Application-Id": { - "name": "X-Client-Application-Id", - "in": "header", - "required": true, - "schema": { - "type": "string" - }, - "description": "Application ID" - }, "audienceRulesOnly": { "name": "audienceRulesOnly", "in": "query", @@ -361,17 +325,6 @@ "style": "deepObject", "explode": true }, - "filters": { - "name": "filters", - "in": "query", - "required": false, - "schema": { - "anyOf": [] - }, - "description": "A filter.", - "style": "deepObject", - "explode": true - }, "campaign_type": { "name": "campaign_type", "in": "query", @@ -399,70 +352,6 @@ }, "description": "Indicates the origin (scheme, hostname, and port)." }, - "session2": { - "name": "session", - "in": "query", - "required": false, - "schema": { - "anyOf": [ - { - "$ref": "#/components/schemas/6_req_session_lock_discount_code" - }, - { - "$ref": "#/components/schemas/6_req_session_lock_gift_card" - }, - { - "$ref": "#/components/schemas/6_req_session_lock_loyalty_card" - } - ] - }, - "style": "deepObject", - "explode": true, - "description": "The session object required to establish a session between multiple parallel validation and redemption requests." - }, - "session": { - "name": "session", - "in": "query", - "required": false, - "schema": { - "type": "object", - "description": "Schema model for `session` lock object. The session object is **required** to establish a session between multiple parallel validation and redemption requests. If you only send the `type` parameter in the request, then by default the session lock will be established for 7 days. Read more on establishing a [validation session](doc:locking-validation-session).", - "properties": { - "type": { - "type": "string", - "description": "This parameter is **required** to establish a new session. The session locks the redemption **quantity** by 1 and addtionally the redemption **gift credits** specified within the request for a gift card and the **loyalty points** for a loyalty card.", - "enum": [ - "LOCK" - ] - }, - "key": { - "type": "string", - "description": "The session unique ID assigned by Voucherify or your own unique session ID. Sending an existing ID will result in overwriting an existing session. If no session key is provided, then a new ID will be generated.", - "example": "ssn_yQGMTeKBSw8OOuFPwlBEjzGy8d8VA9Ts" - }, - "ttl_unit": { - "type": "string", - "description": "Defines the type of unit in which the session time is counted.", - "enum": [ - "HOURS", - "DAYS", - "MINUTES", - "SECONDS", - "MILLISECONDS", - "MICROSECONDS", - "NANOSECONDS" - ] - }, - "ttl": { - "type": "integer", - "description": "Value for the period of time that the session is active. Units for this parameter are defined by the `session.ttl_unit` parameter." - } - } - }, - "style": "deepObject", - "explode": true, - "description": "The session object required to establish a session between multiple parallel validation and redemption requests." - }, "metadata": { "name": "metadata", "in": "query", @@ -3543,37 +3432,6 @@ } } }, - "1_obj_voucher_object_discount_shipping_PUT": { - "title": "Shipping", - "description": "Update shipping discount type.", - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "UNIT", - "description": "Applies a full value discount to item(s)." - }, - "unit_off": { - "type": "number", - "format": "float", - "description": "Subtracts 1 shipping item from the subtotal.", - "default": 1 - }, - "unit_type": { - "type": "string", - "description": "The shipping product deemed as free.", - "default": "prod_5h1pp1ng" - }, - "effect": { - "type": "string", - "enum": [ - "ADD_MISSING_ITEMS" - ], - "description": "Defines how the unit is added to the customer's order.", - "default": "ADD_MISSING_ITEMS" - } - } - }, "1_obj_vouchers_import_discount_amount": { "title": "Import amount discount type", "type": "object", @@ -4697,19 +4555,6 @@ "code" ] }, - "1_req_vouchers_importCSV": { - "type": "object", - "title": "Import Vouchers by CSV Request Body", - "description": "Request body schema for `vouchers/importCSV`.", - "format": "binary", - "properties": { - "file": { - "type": "string", - "format": "binary", - "description": "The property name 'file' will be used for the file path." - } - } - }, "1_res_vouchers_qualification": { "title": "Vouchers Qualification Response Body", "type": "object", @@ -5138,96 +4983,6 @@ "related_object" ] }, - "1_req_obj_vouchers_qualification_product-copy-2-use-for-other-objects-as-reference": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item. You can send this object in the request body to check against vouchers requiring specific product validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" - }, - "product_id": { - "type": "string", - "description": "A unique identifier that represents the product and is assigned by Voucherify.", - "example": "prod_0a9f9aeddb019a42db" - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`). You can send the total item amount to check against vouchers requiring specific order amount validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order volume_ → _Total amount_. The qualification adds the individual amounts of the items and checks whether the sum meets the limits set by the _Total amount_. Additionally, another rule checked is one that is defined in _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Subtotal of matched items_. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.\n", - "example": 10000 - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart. \n\nThe qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. Another validation rule against which the qualification does the checks is defined in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Quantity of matched items_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 - }, - "price": { - "type": "integer", - "description": "Unit price of an item. [This is not true in the case of using sourceid what was the case that this happened.]This `price` property takes precedence. If you provide a value at this level, then a price property defined once again in the `related_object` will be ignored. If this property will not be defined here, then the `price` property in the `related_object` will be used in the qualification.\n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item_ → _Unit Price of any matching order line_ and also _Order Volume_ → _Price of each item/Price of any item_. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).\n\n Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": "object", - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order line item** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item_ → _Metadata of matched items_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "related_object": { - "type": "string", - "enum": [ - "product" - ], - "description": "A reference to the object containing details of the related product. __Required__ when sending `source_id` in payload." - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on name filters_.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If product does not exist, it will be created with the use of `source_id`." - } - } - } - } - }, "1_req_obj_vouchers_qualification_sku": { "title": "SKU Item", "type": "object", @@ -5313,1708 +5068,177 @@ } } }, - "1_req_obj_vouchers_qualification_sku-copy-2_forfuturereference": { - "title": "SKU Item", + "res_empty_json": { "type": "object", - "description": "Schema model for a SKU item.", + "description": "Schema model for an empty json.", + "title": "Empty JSON", + "examples": [ + {} + ] + }, + "2_obj_campaign_object": { + "type": "object", + "title": "Campaign Object", + "description": "This is an object representing a campaign.", + "x-tags": [ + "CAMPAIGNS API" + ], "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique sku identifier from your inventory system. __Requires__ the `related_object` property to be defined. \n\n The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on Source Id filters_ . [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": "product_1234" + "id": { + "type": "string", + "description": "Unique campaign ID, assigned by Voucherify.", + "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" }, - "sku_id": { - "type": [ - "string", - "null" - ], - "example": "sku_0a41e31c7b41c28358", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." + "name": { + "type": "string", + "description": "Campaign name." }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]", - "example": 10000 + "description": { + "type": "string", + "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." }, - "quantity": { - "type": [ - "integer", - "null" + "campaign_type": { + "type": "string", + "enum": [ + "LOYALTY_PROGRAM", + "GIFT_VOUCHERS", + "DISCOUNT_COUPONS", + "PROMOTION", + "REFERRAL_PROGRAM", + "LUCKY_DRAW" ], - "description": "Quantity of the item in the cart. The qualification runs against rules that are defined through the Create Validation Rules endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order Volume_ → _Items quantity_. The qualification adds the individual quantities of the items and checks whether the sum meets the limits set by _Items quantity_ validation rule. [Read more](https://support.voucherify.io/article/529-validation-rules-campaign-limits).", - "example": 1 + "description": "Type of campaign." }, - "related_object": { - "type": [ - "string", - "null" - ], + "type": { + "type": "string", + "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", "enum": [ - "product", - "sku" - ], - "description": "A reference to the object containing details of the related product/sku. __Required__ when sending `source_id` in payload." + "AUTO_UPDATE", + "STATIC" + ] }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", - "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique product identifier from your inventory system.", - "example": "product_1234" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "Product name.", - "example": "Phone" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 + "voucher": { + "anyOf": [ + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **product** metadata validation rules to be satisfied.\n\n The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Every order item/Any order item/None of the order items_ → _Select a product collection or create a new product collection based on metadata filters_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used to store the product in the system. If the product does not exist, it will be created with the use of `source_id`." + { + "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" } - } + ] }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. __Required__ when sending `source_id` in payload. These details will be used for qualification on top of details already stored in the system.", + "auto_join": { + "type": "boolean", + "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." + }, + "join_once": { + "type": "boolean", + "description": "If this value is set to `true`, customers will be able to join the campaign only once." + }, + "use_voucher_metadata_schema": { + "type": "boolean", + "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", "properties": { - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique SKU identifier from your inventory system.", - "example": "sku_1234" - }, - "sku": { - "type": [ - "string", - "null" - ], - "description": "SKU name.", - "example": "iPhone 12" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of custom key/value pairs that you can attach to a SKU." + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist, it will be created with the use of `source_id`. If a SKU does not exist, it's required to set `product_id` that it belongs to." + "duration": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." } } - } - } - }, - "1_req_obj_vouchers_qualification_sku-copy": { - "title": "SKU Item", - "type": "object", - "description": "Schema model for a SKU item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s product/SKU ID (if it is different from the Voucherify product/SKU ID). It is really useful in case of integration between multiple systems. It can be an ID from an eCommerce, a database or a 3rd-party service." + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", + "items": { + "type": "integer" + } }, - "product_id": { - "type": [ - "string", - "null" - ] + "activity_duration_after_publishing": { + "type": "string", + "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." }, - "related_object": { - "type": [ - "string", - "null" + "vouchers_count": { + "type": "integer", + "description": "Total number of unique vouchers in campaign." + }, + "start_date": { + "type": "string", + "format": "date-time", + "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", + "example": "2022-09-20T00:00:00.000Z" + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", + "example": "2022-09-30T00:00:00.000Z" + }, + "active": { + "type": "boolean", + "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2021-12-01T08:00:50.038Z", + "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." + }, + "updated_at": { + "type": "string", + "format": "date-time", + "example": "2022-09-20T09:18:19.623Z", + "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." + }, + "category": { + "type": "string", + "description": "Unique category name." + }, + "creation_status": { + "type": "string", + "enum": [ + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT", + "MODIFYING" ], + "description": "Indicates the status of the campaign creation." + }, + "vouchers_generation_status": { + "type": "string", + "description": "Indicates the status of the campaign's vouchers.", "enum": [ - "product", - "sku" + "DONE", + "IN_PROGRESS", + "FAILED", + "DRAFT" ] }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item.[I'm not sure what this means here, it's from the original docs]" + "protected": { + "type": "boolean", + "description": "Indicates whether the resource can be deleted." }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." + "category_id": { + "type": "string", + "description": "Unique category ID that this campaign belongs to.", + "example": "cat_0b688929a2476386a7" }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exist it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - }, - "1_req_vouchers_qualification_copy_for_reverting_changes": { - "title": "Vouchers Qualification Request Body", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details. You can send this object in the request body to check against vouchers requiring specific customer validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer segment_ or _Basic Builder_ → _Customer Activity_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule). ", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. This ID was assigned by the Voucherify API.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. This is a tracking identifier of a user that is validating a voucher. The `source_id` is built based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the one returned in the original voucher validation method done by a specific customer, or a string identifying the customer (e.g., email, database ID, CRM ID).", - "example": "firstname.lastname@mycompany.com" - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name. You can send the name in the request body to check against vouchers requiring specific name validation rules to be satisfied.", - "example": "FirstName LastName" - }, - "email": { - "type": [ - "string", - "null" - ], - "description": "You can send the email in the request body to check against vouchers requiring specific email validation rules to be satisfied.", - "example": "firstname.lastname@mycompany.com" - }, - "phone": { - "type": [ - "string", - "null" - ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]", - "description": "You can send the phone in the request body to check against vouchers requiring specific phone validation rules to be satisfied." - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address. You can send the address in the request body to check against vouchers requiring specific address validation rules to be satisfied.", - "properties": { - "city": { - "type": [ - "string", - "null" - ], - "description": "You can send the city in the request body to check against vouchers requiring specific city validation rules to be satisfied.", - "example": "New York" - }, - "country": { - "type": [ - "string", - "null" - ], - "description": "You can send the country in the request body to check against vouchers requiring specific country validation rules to be satisfied.", - "example": "United States of America" - }, - "postal_code": { - "type": [ - "string", - "null" - ], - "description": "You can send the postal code in the request body to check against vouchers requiring specific postal code validation rules to be satisfied.", - "example": "10001" - }, - "state": { - "type": [ - "string", - "null" - ], - "description": "You can send the state in the request body to check against vouchers requiring specific state validation rules to be satisfied.", - "example": "NY" - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **customer** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Audience_ → _Customer metadata satisfy_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "format": "date", - "description": "You can send the birthdate in the request body to check against vouchers requiring specific birthdate validation rules to be satisfied, i.e. `YYYY-MM-DD`." - } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions. You can send the order in the request body to check against vouchers requiring specific order validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure/Order volume_ or _Basic Builder_ → _Order_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule).", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order in Voucherify's system that will be linked to the redemption of this request. This ID was assigned by the Voucherify API. You can send the order id in the request body to check against vouchers requiring specific order validation rules to be satisfied.", - "example": "ord_gqj1QYW2j2A1E3Ula2YjdPf4" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "The merchant’s order ID if it is different from the Voucherify order ID. It is really useful in case of an integration between multiple systems. It can be an order ID from a CRM system, database or 3rd-party service." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Pre-discount order amount represents the total amount of order items' amounts (sum of each item's `amount` property). You can send the amount in the request body to check against vouchers requiring specific order amount validation rules to be satisfied. \n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000.", - "example": 10000 - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by `product_id` or `sku_id`. For every item, you must define the quantity. Read more about the [order item object] (hyperlink the Order Item Object).\n", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_product" - }, - { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_sku" - } - ] - } - }, - "customer": { - "$ref": "#/components/schemas/1_req_obj_vouchers_qualification_customer" - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **order** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Order structure_ → _Order metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _ORDER METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can send in the request body to check against vouchers requiring **redemption** metadata validation rules to be satisfied. The qualification runs against rules that are defined through the [Create Validation Rules](ref:create-validation-rules) endpoint or via the Dashboard; in the _Advanced Rule Builder_ → _Advanced_ → _Redemption metadata satisfy_ or _Basic Builder_ → _Attributes match_ → _REDEMPTION METADATA_. [Read more](https://support.voucherify.io/article/148-how-to-build-a-rule)." - } - } - }, - "1_req_obj_vouchers_qualification_product-copy": { - "title": "Product Item", - "type": "object", - "description": "Schema model for a product item.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ] - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "quantity": { - "type": [ - "integer", - "null" - ], - "description": "Quantity of the item in the cart." - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related product. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "integer", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ] - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of the related SKU. These details will be used for validation and redemption processes on top of details already stored in the system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - }, - "1_req_vouchers_qualification-prepforcampaignqualification": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name" - }, - "email": { - "type": [ - "string", - "null" - ] - }, - "phone": { - "type": [ - "string", - "null" - ], - "minLength": 1, - "maxLength": 30, - "pattern": "^[-+.() 0-9]" - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ] - }, - "country": { - "type": [ - "string", - "null" - ] - }, - "postal_code": { - "type": [ - "string", - "null" - ] - }, - "state": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate, i.e. `YYYY-MM-DD`.", - "format": "date" - } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ - "string", - "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { - "type": [ - "object", - "null" - ], - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "quantity": { - "type": [ - "integer", - "null" - ] - }, - "discount_quantity": { - "type": [ - "integer", - "null" - ], - "description": "number of items being discounted\t" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ] - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - } - } - }, - "1_req_vouchers_qualification-copy": { - "title": "RequestBodyVouchersQualification", - "type": "object", - "description": "Request body schema for /vouchers/qualification.", - "properties": { - "customer": { - "type": [ - "object", - "null" - ], - "description": "This object stores customer details.", - "properties": { - "id": { - "type": "string", - "description": "The ID of an existing customer that will be linked to the redemption in this request. Assigned by the Voucherify API, identifies the customer.", - "example": "cust_J1CDUdbqn5Exva8ASWk1Fq0j" - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side). A tracking identifier of a user that validate a voucher. It is build based on your internal id (e.g., email, database ID). If you also pass a customer ID, the source ID will be ignored. Otherwise, if you do not pass a customer ID, the source ID you provide must either be a token, like the ones returned in origin voucher validation method done by specific customer, or a string identifying customer (e.g., email, database ID, CRM ID)." - }, - "name": { - "type": [ - "string", - "null" - ], - "description": "First and Last Name" - }, - "description": { - "type": [ - "string", - "null" - ], - "description": "An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.\t" - }, - "email": { - "type": [ - "string", - "null" - ] - }, - "phone": { - "type": [ - "string", - "null" - ] - }, - "address": { - "type": [ - "object", - "null" - ], - "additionalProperties": false, - "description": "A set of key/value pairs which describes the address.", - "properties": { - "city": { - "type": [ - "string", - "null" - ] - }, - "country": { - "type": [ - "string", - "null" - ] - }, - "line_1": { - "type": [ - "string", - "null" - ] - }, - "line_2": { - "type": [ - "string", - "null" - ] - }, - "postal_code": { - "type": [ - "string", - "null" - ] - }, - "state": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "A set of key/value pairs that you can attach to a customer object for segment building. It can be useful for storing additional information about the customer in a structured format." - }, - "email_unsubscribed": { - "type": [ - "boolean", - "null" - ] - }, - "birthday": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate.", - "format": "date", - "example": "2022-03-07" - }, - "birthdate": { - "type": [ - "string", - "null" - ], - "description": "Customer's birthdate", - "example": "2022-03-07", - "format": "date" - }, - "customer_landing_page": { - "type": [ - "object", - "null" - ], - "properties": { - "custom_event": { - "type": [ - "object", - "null" - ] - }, - "consents": { - "type": [ - "object", - "null" - ] - }, - "publication_id": { - "type": [ - "string", - "null" - ] - }, - "voucher_code": { - "type": [ - "string", - "null" - ] - } - } - }, - "created_at": { - "type": "string" - } - } - }, - "order": { - "type": [ - "object", - "null" - ], - "description": "Tracks purchase transactions.", - "properties": { - "id": { - "type": [ - "string", - "null" - ], - "description": "The ID of an existing order that will be linked to redemption in this request." - }, - "status": { - "type": [ - "string", - "null" - ], - "enum": [ - "CREATED", - "PAID", - "CANCELED", - "FULFILLED" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "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." - }, - "amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Represents a total amount of order items (sum of item.amount)\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "minimum": 0, - "description": "Summarize all discounts applied to the order inlcuding discounts applied to particular order line items and discounts applied to the whole cart.\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "items": { - "type": "array", - "description": "List of Order Items constituting the order. Order items can be defined either by product_id or sku_id. Along with every item you must define quantity.A list of Order Items that have been applied to the order. hyperlink the Order Items to another object.\n", - "items": { - "type": [ - "object", - "null" - ], - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ], - "description": "Product/SKU reference ID" - }, - "product_id": { - "type": [ - "string", - "null" - ] - }, - "sku_id": { - "type": [ - "string", - "null" - ] - }, - "related_object": { - "type": [ - "string", - "null" - ], - "enum": [ - "product", - "sku" - ], - "description": "Allowed values: `product`, `sku`" - }, - "amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents a total amount of order item (price * quantity).\n\nYou should provide it to retrieve `discount_amount` if the discount is applied only to this item." - }, - "discount_amount": { - "type": [ - "integer", - "null" - ], - "description": "Represents total amount of the discount applied to order line items\n\nValue is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "quantity": { - "type": [ - "integer", - "null" - ] - }, - "discount_quantity": { - "type": [ - "integer", - "null" - ], - "description": "number of items being discounted\t" - }, - "price": { - "type": [ - "integer", - "null" - ], - "description": "Unit price of an item" - }, - "product": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related product. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "name": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "null", - "integer" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The `override` is used once the product should be stored in system. If product does not exists it will be created with the use of `source_id`." - } - } - }, - "sku": { - "type": [ - "object", - "null" - ], - "description": "An object containing details of related SKU. Those details will be used for validation and redemption processes on top of details already stored in system.", - "properties": { - "id": { - "type": [ - "string", - "null" - ] - }, - "source_id": { - "type": [ - "string", - "null" - ] - }, - "sku": { - "type": [ - "string", - "null" - ] - }, - "price": { - "type": [ - "string", - "null" - ] - }, - "metadata": { - "type": [ - "object", - "null" - ] - }, - "override": { - "type": [ - "boolean", - "null" - ], - "description": "The override is used once the product should be stored in system. If sku does not exists it will be created with the use of `source_id`. If sku does not exists it's required to set `product_id` that it belongs to." - } - } - } - } - } - }, - "customer": { - "type": [ - "object", - "null" - ], - "description": "The customer used for the order." - }, - "referrer": { - "description": "The person who referred the customer to make the order.", - "type": [ - "object", - "null" - ] - }, - "metadata": { - "type": [ - "string", - "null" - ] - } - } - }, - "reward": { - "type": [ - "object", - "null" - ], - "properties": { - "points": { - "type": [ - "number", - "null" - ] - }, - "assignment_id": { - "type": [ - "string", - "null" - ] - }, - "id": { - "type": [ - "string", - "null" - ] - } - } - }, - "metadata": { - "type": [ - "object", - "null" - ], - "description": "Metadata can be a string, number, boolean, date, datetime, image_url, object, geopoint, unknown. | related objects: campaign, voucher, publication, redemption, product, customer, order, order_item, loyalty_tier, promotion_tier." - }, - "gift": { - "type": [ - "object", - "null" - ], - "properties": { - "credits": { - "type": [ - "number", - "null" - ] - } - } - }, - "session": { - "type": [ - "object", - "null" - ], - "properties": { - "key": { - "type": [ - "string", - "null" - ], - "description": "Unique session identifier assigned by the Voucherify API." - }, - "type": { - "type": [ - "string", - "null" - ], - "enum": [ - "COUNT_PER_CUSTOMER", - "ORDER", - "LOCK" - ], - "description": "The type of session. Required to establish a new session. \n\n`LOCK`: Locks the following parameters within the session:\n\n- redemption quantity by 1\n- redemption gift credits specified with the requests\n- redemption loyalty points specified with the request" - }, - "ttl": { - "type": [ - "number", - "null" - ], - "description": "Value for the period of time that the session is active. Units for this parameter are defined by `session.ttl_unit`." - }, - "ttl_unit": { - "type": [ - "string", - "null" - ], - "enum": [ - "DAYS", - "HOURS", - "MICROSECONDS", - "MILLISECONDS", - "MINUTES", - "NANOSECONDS", - "SECONDS" - ], - "description": "Defines the type of unit in which the session time is counted." - } - } - }, - "tracking_id": { - "type": [ - "string", - "null" - ], - "maxLength": 2500, - "example": "track_fxEMFisanb7t4l96X8WKcemyGNPnHpGM3KTfUsqZGCOx/p57/J2+Yw==", - "description": "A tracking identifier of a user that validated a voucher. Identifier generated during voucher validation. This is a hashed customer source ID." - } - } - }, - "1_req_obj_vouchers_qualification_order": { - "title": "OrderObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "1_req_obj_vouchers_qualification_reward": { - "title": "RewardObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "0_obj_metadata": { - "title": "MetadataObject", - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "res_empty_json": { - "type": "object", - "description": "Schema model for an empty json.", - "title": "Empty JSON", - "examples": [ - {} - ] - }, - "2_obj_campaign_object": { - "type": "object", - "title": "Campaign Object", - "description": "This is an object representing a campaign.", - "x-tags": [ - "CAMPAIGNS API" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique campaign ID, assigned by Voucherify.", - "example": "camp_f7fBbQxUuTN7dI7tGOo5XMDA" - }, - "name": { - "type": "string", - "description": "Campaign name." - }, - "description": { - "type": "string", - "description": "An optional field to keep any extra textual information about the campaign such as a campaign description and details." - }, - "campaign_type": { - "type": "string", - "enum": [ - "LOYALTY_PROGRAM", - "GIFT_VOUCHERS", - "DISCOUNT_COUPONS", - "PROMOTION", - "REFERRAL_PROGRAM", - "LUCKY_DRAW" - ], - "description": "Type of campaign." - }, - "type": { - "type": "string", - "description": "Defines whether the campaign can be updated with new vouchers after campaign creation. \n\n- `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria \n- `STATIC`: vouchers need to be manually published", - "enum": [ - "AUTO_UPDATE", - "STATIC" - ] - }, - "voucher": { - "anyOf": [ - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_DISCOUNT" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_GIFT_CARD" - }, - { - "$ref": "#/components/schemas/2_obj_campaign_object_voucher_object_LOYALTY_CARD" - } - ] - }, - "auto_join": { - "type": "boolean", - "description": "Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled." - }, - "join_once": { - "type": "boolean", - "description": "If this value is set to `true`, customers will be able to join the campaign only once." - }, - "use_voucher_metadata_schema": { - "type": "boolean", - "description": "Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the campaign is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, a campaign with an `interval` of `P2D` will be active every other day." - }, - "duration": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format. For example, a campaign with a `duration` of `P1D` will be valid for a duration of one day." - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the campaign is valid.\n\n- `0` Sunday \n- `1` Monday \n- `2` Tuesday \n- `3` Wednesday \n- `4` Thursday \n- `5` Friday \n- `6` Saturday ", - "items": { - "type": "integer" - } - }, - "activity_duration_after_publishing": { - "type": "string", - "description": "Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days." - }, - "vouchers_count": { - "type": "integer", - "description": "Total number of unique vouchers in campaign." - }, - "start_date": { - "type": "string", - "format": "date-time", - "description": "Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. ", - "example": "2022-09-20T00:00:00.000Z" - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "description": "Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.", - "example": "2022-09-30T00:00:00.000Z" - }, - "active": { - "type": "boolean", - "description": "A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. \n\n- `true` indicates an *active* campaign\n- `false` indicates an *inactive* campaign" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2021-12-01T08:00:50.038Z", - "description": "Timestamp representing the date and time when the campaign was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-09-20T09:18:19.623Z", - "description": "Timestamp representing the date and time when the voucher was updated in ISO 8601 format." - }, - "category": { - "type": "string", - "description": "Unique category name." - }, - "creation_status": { - "type": "string", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT", - "MODIFYING" - ], - "description": "Indicates the status of the campaign creation." - }, - "vouchers_generation_status": { - "type": "string", - "description": "Indicates the status of the campaign's vouchers.", - "enum": [ - "DONE", - "IN_PROGRESS", - "FAILED", - "DRAFT" - ] - }, - "protected": { - "type": "boolean", - "description": "Indicates whether the resource can be deleted." - }, - "category_id": { - "type": "string", - "description": "Unique category ID that this campaign belongs to.", - "example": "cat_0b688929a2476386a7" - }, - "categories": { - "$ref": "#/components/schemas/20_obj_category_object" + "categories": { + "$ref": "#/components/schemas/20_obj_category_object" }, "object": { "type": "string", @@ -9695,62 +7919,6 @@ } ] }, - "4_req_create_reward-copy": { - "title": "Create Reward Request Body", - "type": "object", - "description": "Request body schema for **POST** `/rewards`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "type": { - "type": "string", - "enum": [ - "CAMPAIGN", - "COIN", - "MATERIAL" - ], - "description": "Reward type." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } - } - }, "4_req_create_reward_CAMPAIGN": { "title": "Digital Reward", "type": "object", @@ -9859,53 +8027,6 @@ } ] }, - "4_req_update_reward-copy": { - "title": "Update Reward Request Body", - "type": "object", - "description": "Request body schema for **PUT** `/rewards/{rewardId}`.", - "properties": { - "name": { - "type": "string", - "description": "Reward name." - }, - "parameters": { - "oneOf": [ - { - "$ref": "#/components/schemas/4_req_reward_parameters_COIN" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_MATERIAL" - }, - { - "$ref": "#/components/schemas/4_req_reward_parameters_CAMPAIGN" - } - ], - "description": "Defines how the reward is generated." - }, - "stock": { - "type": "integer", - "description": "Configurable for material rewards. The number of units of the product that you want to share as a reward." - }, - "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": "string", - "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." - } - } - }, "4_req_update_reward_CAMPAIGN": { "title": "Digital Reward", "type": "object", @@ -10977,30 +9098,6 @@ } } }, - "6_obj_validation_object": { - "title": "Validation Object", - "description": "This is an object representing a validation.", - "x-tags": [ - "VALIDATIONS API" - ], - "anyOf": [ - { - "$ref": "#/components/schemas/6_res_validate_voucher_discount_code" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_gift_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_loyalty_card" - }, - { - "$ref": "#/components/schemas/6_res_validate_voucher_false" - }, - { - "$ref": "#/components/schemas/6_res_validate_promotion_object" - } - ] - }, "6_req_validate_voucher": { "title": "Validate Voucher Request Body", "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", @@ -11040,12 +9137,6 @@ } } }, - "6_req_validate_voucher_customer_id_string": { - "type": "string", - "title": "Customer ID", - "description": "You can pass the unique customer ID that was assigned by Voucherify.", - "example": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv" - }, "6_req_validate_voucher_customer_source_id": { "title": "Customer Source ID", "description": "You can send the source ID that you used to create the customer in Voucherify.", @@ -11280,16 +9371,6 @@ } } }, - "6_req_validate_voucher_unpublished_discount_code": { - "title": "Unpublished Discount Code", - "type": "object", - "description": "Request schema model for validating a voucher using **POST** `/vouchers/{code}/validate`.", - "properties": { - "session": { - "type": "string" - } - } - }, "6_req_session_lock_discount_code": { "title": "Discount Code Session Lock", "type": "object", @@ -22686,89 +20767,6 @@ "LOYALTIES API" ] }, - "8_obj_loyalty_reward_object": { - "title": "Loyalty Reward Object", - "type": "object", - "description": "This is an object representing a loyalty reward.", - "x-tags": [ - "LOYALTIES API" - ], - "properties": { - "reward": { - "$ref": "#/components/schemas/4_obj_reward_object" - }, - "assignment": { - "$ref": "#/components/schemas/4_obj_reward_assignment_object" - }, - "object": { - "type": "string", - "default": "loyalty_reward", - "description": "The type of object represented by JSON. This object stores information about the loyalty reward object." - } - } - }, - "8_obj_loyalty_points_bucket": { - "type": "object", - "title": "Loyalty Points Bucket Object", - "description": "This is an object representing a loyalty points bucket.", - "properties": { - "id": { - "type": "string", - "example": "lopb_zdeIBq3EsnPnRSDa7Tyyb6X2", - "description": "Unique loyalty points bucket ID." - }, - "voucher_id": { - "type": "string", - "example": "v_0aMj6Mdp0i3zuXrd9NnBKboc7746mlgF", - "description": "Unique parent loyalty card ID." - }, - "campaign_id": { - "type": "string", - "example": "camp_7s3uXI44aKfIk5IhmeOPr6ic", - "description": "Unique parent campaign ID." - }, - "bucket": { - "type": "object", - "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." - } - } - }, - "status": { - "type": "string", - "enum": [ - "ACTIVE" - ], - "description": "Loyalty points bucket point status." - }, - "expires_at": { - "type": "string", - "example": "2022-11-30", - "format": "date", - "description": "Date when the number of points defined in the `bucket` object are due to expire." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-21T13:49:54.949Z", - "description": "Timestamp representing the date and time when the loyalty points bucket object was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-08-30T08:34:45.989Z", - "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", - "default": "loyalty_points_bucket", - "description": "The type of object represented by JSON. This object stores information about the loyalty points bucket." - } - } - }, "8_obj_loyalty_tier_reward_object": { "title": "Loyalty Tier Reward Object", "type": "object", @@ -24620,517 +22618,110 @@ "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", "anyOf": [ { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." - } - } - } - } - }, - "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." - } - } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." - } - } - }, - "8_obj_loyalty_tier_object_member": { - "type": "object", - "title": "Loyalty Tier Object", - "description": "This is an object representing a loyalty tier. \n\nLoyalty tiers are used to create a loyalty program with different levels of membership and varied earning rules and rewards based on customer’s tiers.", - "properties": { - "id": { - "type": "string", - "example": "ltr_30KHciA0UG8B71Fo51GZqwgN", - "description": "Unique loyalty tier ID." - }, - "name": { - "type": "string", - "description": "Loyalty Tier name." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "metadata": { - "type": "object", - "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", - "example": "2022-11-10T12:20:52.755Z", - "description": "Timestamp representing the date and time when the loyalty tier was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "format": "date-time", - "example": "2022-11-25T10:59:43.231Z", - "description": "Timestamp representing the date and time when the loyalty tier was updated in ISO 8601 format." - }, - "earning_rules": { - "type": "object", - "description": "Contains a list of earning rule IDs and their points mapping for the given earning rule.", - "properties": { - "unique_earning_rule_ID": { - "description": "ern_95aq3JaE5A8xzHjoJPYNRqXZ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "rewards": { - "type": "object", - "description": "Contains a list of reward IDs and their points mapping for the given reward.", - "properties": { - "unique_reward_ID": { - "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_mapping_multiply" - }, - { - "$ref": "#/components/schemas/8_obj_mapping_fixed" - } - ] - } - } - }, - "config": { - "type": "object", - "description": "Defines loyalty tier range in 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." - } - } - } - } - }, - "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": "Contains information about when the expiration tier will expire.", - "properties": { - "customer_id": { - "type": "string", - "example": "cust_qBwHpagDOFu71Z3F22UzR80X", - "description": "Unique customer ID whose point expiration dates are defined in this object." - }, - "campaign_id": { - "type": "string", - "example": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "description": "Unique parent campaign ID." - }, - "tier_id": { - "type": "string", - "example": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2", - "description": "Unique loyalty tier ID." - }, - "start_date": { - "type": "string", - "example": "2022-11-10", - "description": "Exact start date of the loyalty tier for the given customer." - }, - "expiration_date": { - "type": "string", - "example": "2023-02-28", - "description": "Exact expiration date of the loyalty tier for the given customer." - }, - "created_at": { - "type": "string", - "example": "2022-11-09T11:26:26.719Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - }, - "updated_at": { - "type": "string", - "example": "2022-11-10T08:54:47.200Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the loyalty tier expiration was created in ISO 8601 format." - } - } - }, - "object": { - "type": "string", - "default": "loyalty_tier", - "description": "The type of object represented by JSON. This object stores information about the loyalty." - } - } - }, - "8_obj_mapping_multiply": { - "type": "object", - "title": "Multiply Points", - "description": "Points are multiplied by a multiplier.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "MULTIPLY" - ] - }, - "multiplier": { - "type": "integer", - "description": "Multiplication factor used to multiply the points to obtain the mapped points." - } - } - }, - "8_obj_mapping_fixed": { - "type": "object", - "title": "Fixed Points", - "description": "Points are fixed.", - "properties": { - "type": { - "type": "string", - "description": "Type of calculation.", - "enum": [ - "CUSTOM" - ] - }, - "points": { - "type": "integer", - "description": "Fixed number of points to be applied." - } - } - }, - "8_obj_earning_rule_object": { - "description": "This is an object representing an earning rule.", - "title": "Earning Rule Object", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - }, - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - }, - { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", - "source": { - "banner": "Entered segment 100 points.", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" - }, - { - "id": "ern_gVo6CHBduFPoh1hctASfXHLT", - "created_at": "2022-11-24T17:01:42.809Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 4, - "points": 4, - "property": "customer_life_time_value" - } - } - }, - "event": "customer.loyalty.tier.joined", - "loyalty_tier": { - "id": "ltr_pudTGWasuIqxdiDM0go31OV1" - }, - "source": { - "banner": "Tier joined", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7", - "metadata": { - "Type": "Tier joined - customer metadata - proportional" - } - }, - { - "id": "ern_66OdCyLADv5IGFoQe18vGUwa", - "created_at": "2022-11-24T17:03:59.414Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 2, - "points": 2, - "property": "customer_life_time_value" - } + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] } - }, - "event": "customer.loyalty.tier.left", - "loyalty_tier": { - "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2" - }, - "source": { - "banner": "Tier left", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq", - "metadata": { - "Type": "Tier left" } }, - { - "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm", - "created_at": "2022-11-25T07:29:38.961Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "type": "PROPORTIONAL", - "calculation_type": "CUSTOMER_METADATA", - "customer": { - "metadata": { - "every": 3, - "points": 4, - "property": "customer_life_time_value" + "rewards": { + "type": "object", + "description": "Contains a list of reward IDs and their points mapping for the given reward.", + "properties": { + "unique_reward_ID": { + "description": "rewa_t88DnSdNnE0IzQX6gqH3jHGQ", + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_mapping_multiply" + }, + { + "$ref": "#/components/schemas/8_obj_mapping_fixed" + } + ] + } + } + }, + "config": { + "type": "object", + "description": "Defines loyalty tier range in 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." + } } } - }, - "event": "customer.loyalty.tier.upgraded", - "loyalty_tier": { - "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" - }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" } }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" + "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." + } } }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} + "object": { + "type": "string", + "default": "loyalty_tier", + "description": "The type of object represented by JSON. This object stores information about the loyalty." } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" + } + }, + "8_obj_mapping_multiply": { + "type": "object", + "title": "Multiply Points", + "description": "Points are multiplied by a multiplier.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "MULTIPLY" + ] }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" + "multiplier": { + "type": "integer", + "description": "Multiplication factor used to multiply the points to obtain the mapped points." + } + } + }, + "8_obj_mapping_fixed": { + "type": "object", + "title": "Fixed Points", + "description": "Points are fixed.", + "properties": { + "type": { + "type": "string", + "description": "Type of calculation.", + "enum": [ + "CUSTOM" + ] }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" + "points": { + "type": "integer", + "description": "Fixed number of points to be applied." } - ] + } }, - "8_obj_earning_rule_object_no_validation_rule": { + "8_obj_earning_rule_object": { "description": "This is an object representing an earning rule.", "title": "Earning Rule Object", "examples": [ @@ -25308,455 +22899,83 @@ "loyalty_tier": { "id": "ltr_30KHciA0UG8B71Fo51GZqwgN" }, - "source": { - "banner": "Tier upgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", - "metadata": { - "Type": "Upgraded" - } - }, - { - "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", - "created_at": "2022-11-25T07:31:05.866Z", - "updated_at": "2022-11-25T07:31:43.029Z", - "validation_rule_id": "val_kfmWpfXMI9P1", - "loyalty": { - "points": 1, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.downgraded", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Tier Downgraded", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", - "metadata": { - "Type": "Tier" - } - }, - { - "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", - "created_at": "2022-11-25T07:31:42.767Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 5, - "type": "FIXED" - }, - "event": "customer.loyalty.tier.prolonged", - "loyalty_tier": { - "id": "__ANY__" - }, - "source": { - "banner": "Prolonged", - "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", - "object_type": "campaign" - }, - "active": true, - "object": "earning_rule", - "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", - "metadata": {} - } - ], - "anyOf": [ - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment_no_validation_rule" - }, - { - "$ref": "#/components/schemas/8_obj_earning_rule_object_tier_no_validation_rule" - } - ] - }, - "8_obj_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ - { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", - "validation_rule_id": null, - "loyalty": { - "points": 1000, - "type": "FIXED" - }, - "event": "order.paid", - "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], - "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" - } - ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "event": { - "type": "string", - "enum": [ - "order.paid" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } + "source": { + "banner": "Tier upgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv", + "metadata": { + "Type": "Upgraded" } }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + { + "id": "ern_A2RArBE30Tkt56utVLrRv7rZ", + "created_at": "2022-11-25T07:31:05.866Z", + "updated_at": "2022-11-25T07:31:43.029Z", + "validation_rule_id": "val_kfmWpfXMI9P1", + "loyalty": { + "points": 1, + "type": "FIXED" + }, + "event": "customer.loyalty.tier.downgraded", + "loyalty_tier": { + "id": "__ANY__" + }, + "source": { + "banner": "Tier Downgraded", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", + "object_type": "campaign" + }, + "active": true, + "object": "earning_rule", + "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW", + "metadata": { + "Type": "Tier" } }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_req_update_earning_rule_object_order_paid": { - "description": "This is an object representing an earning rule for a paid order.", - "type": "object", - "title": "Earning Rule Object for Order Paid", - "examples": [ { - "id": "ern_taClaOIiaGNdmdby8xS0lCcy", - "created_at": "2022-02-04T13:27:50.665Z", - "updated_at": "2022-02-07T08:19:44.198Z", + "id": "ern_AdlWO2yt6b6llWsibIdiRXVE", + "created_at": "2022-11-25T07:31:42.767Z", + "updated_at": null, "validation_rule_id": null, "loyalty": { - "points": 1000, + "points": 5, "type": "FIXED" }, - "event": "order.paid", + "event": "customer.loyalty.tier.prolonged", + "loyalty_tier": { + "id": "__ANY__" + }, "source": { - "banner": "Order paid 1000 points", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "banner": "Prolonged", + "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N", "object_type": "campaign" }, "active": true, - "start_date": "2022-02-02T13:00:00.000Z", - "expiration_date": "2022-03-03T14:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "validity_day_of_week": [ - 4 - ], "object": "earning_rule", - "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" + "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb", + "metadata": {} } ], - "properties": { - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" - } - ] - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + "anyOf": [ + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_order_paid" }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_custom_event" }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_entered_segment" }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + { + "$ref": "#/components/schemas/8_obj_earning_rule_object_tier" } - } + ] }, - "8_obj_earning_rule_object_order_paid_no_validation_rule": { + "8_obj_earning_rule_object_order_paid": { "description": "This is an object representing an earning rule for a paid order.", "type": "object", "title": "Earning Rule Object for Order Paid", @@ -25809,7 +23028,7 @@ "format": "date-time" }, "validation_rule_id": { - "type": "null", + "type": "string", "example": "val_248vs7tUjlIE", "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." }, @@ -25907,26 +23126,23 @@ } } }, - "8_obj_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", + "8_req_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", "type": "object", - "title": "Earning Rule Object for Entered Segment", + "title": "Earning Rule Object for Order Paid", "examples": [ { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", "validation_rule_id": null, "loyalty": { "points": 1000, "type": "FIXED" }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", + "event": "order.paid", "source": { - "banner": "Entered segment 100 points.", + "banner": "Order paid 1000 points", "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", "object_type": "campaign" }, @@ -25938,34 +23154,13 @@ "interval": "P1D" }, "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 + 4 ], "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" } ], "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, "validation_rule_id": { "type": "string", "example": "val_248vs7tUjlIE", @@ -25978,26 +23173,16 @@ "$ref": "#/components/schemas/8_obj_fixed_points" }, { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } ] }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, "event": { "type": "string", "enum": [ - "customer.segment.entered" + "order.paid" ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. " }, "source": { "type": "object", @@ -26007,16 +23192,6 @@ "type": "string", "example": "Order Paid - You will get 100 points", "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } } }, @@ -26059,42 +23234,29 @@ "type": "integer" } }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, "metadata": { "type": "object", "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } }, - "8_req_earning_rule_object_entered_segment": { - "description": "This is an object representing an earning rule for entering a customer segment.", + "8_req_update_earning_rule_object_order_paid": { + "description": "This is an object representing an earning rule for a paid order.", "type": "object", - "title": "Earning Rule Object for Entered Segment", + "title": "Earning Rule Object for Order Paid", "examples": [ { - "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", - "created_at": "2022-02-04T13:02:52.937Z", - "updated_at": "2022-02-07T08:19:43.291Z", + "id": "ern_taClaOIiaGNdmdby8xS0lCcy", + "created_at": "2022-02-04T13:27:50.665Z", + "updated_at": "2022-02-07T08:19:44.198Z", "validation_rule_id": null, "loyalty": { "points": 1000, "type": "FIXED" }, - "segment": { - "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" - }, - "event": "customer.segment.entered", + "event": "order.paid", "source": { - "banner": "Entered segment 100 points.", + "banner": "Order paid 1000 points", "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", "object_type": "campaign" }, @@ -26106,14 +23268,10 @@ "interval": "P1D" }, "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 + 4 ], "object": "earning_rule", - "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + "automation_id": "auto_RjBuwpeFQZ7TyQ5LP2LFVZYG" } ], "properties": { @@ -26129,27 +23287,10 @@ "$ref": "#/components/schemas/8_obj_fixed_points" }, { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_order_paid" } ] }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, "source": { "type": "object", "description": "Contains the custom earning rule name and parent campaign.", @@ -26206,7 +23347,7 @@ } } }, - "8_req_update_earning_rule_object_entered_segment": { + "8_req_earning_rule_object_entered_segment": { "description": "This is an object representing an earning rule for entering a customer segment.", "type": "object", "title": "Earning Rule Object for Entered Segment", @@ -26264,6 +23405,23 @@ } ] }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, "source": { "type": "object", "description": "Contains the custom earning rule name and parent campaign.", @@ -26320,7 +23478,7 @@ } } }, - "8_obj_earning_rule_object_entered_segment_no_validation_rule": { + "8_req_update_earning_rule_object_entered_segment": { "description": "This is an object representing an earning rule for entering a customer segment.", "type": "object", "title": "Earning Rule Object for Entered Segment", @@ -26362,183 +23520,6 @@ } ], "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "type": "null", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - } - }, - "event": { - "type": "string", - "enum": [ - "customer.segment.entered" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, - "8_obj_earning_rule_object_custom_event": { - "description": "This is an object representing an earning rule triggered by a custom event.", - "type": "object", - "title": "Earning Rule Object for Custom Event", - "examples": [ - { - "id": "ern_abvbD0d7Wv4hgr3fTElLb38G", - "created_at": "2022-02-07T08:19:41.810Z", - "updated_at": null, - "validation_rule_id": null, - "loyalty": { - "points": 2, - "type": "FIXED" - }, - "custom_event": { - "schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R" - }, - "event": "saw_on_facebook", - "source": { - "banner": "Saw on Facebook Timeframe", - "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "object_type": "campaign" - }, - "active": true, - "start_date": "2022-02-07T08:30:00.000Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P1D" - }, - "object": "earning_rule", - "automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA" - } - ], - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, "validation_rule_id": { "type": "string", "example": "val_248vs7tUjlIE", @@ -26550,32 +23531,11 @@ { "$ref": "#/components/schemas/8_obj_fixed_points" }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_custom_event_metadata" - }, { "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" } ] }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, "source": { "type": "object", "description": "Contains the custom earning rule name and parent campaign.", @@ -26584,16 +23544,6 @@ "type": "string", "example": "Order Paid - You will get 100 points", "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } } }, @@ -26636,23 +23586,13 @@ "type": "integer" } }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, "metadata": { "type": "object", "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } }, - "8_req_earning_rule_object_custom_event": { + "8_obj_earning_rule_object_custom_event": { "description": "This is an object representing an earning rule triggered by a custom event.", "type": "object", "title": "Earning Rule Object for Custom Event", @@ -26686,6 +23626,23 @@ } ], "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, "validation_rule_id": { "type": "string", "example": "val_248vs7tUjlIE", @@ -26731,6 +23688,16 @@ "type": "string", "example": "Order Paid - You will get 100 points", "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } } }, @@ -26773,13 +23740,23 @@ "type": "integer" } }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, "metadata": { "type": "object", "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." } } }, - "8_req_update_earning_rule_object_custom_event": { + "8_req_earning_rule_object_custom_event": { "description": "This is an object representing an earning rule triggered by a custom event.", "type": "object", "title": "Earning Rule Object for Custom Event", @@ -26832,6 +23809,24 @@ } ] }, + "custom_event": { + "type": "object", + "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", + "properties": { + "schema_id": { + "type": "string", + "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", + "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" + } + } + }, + "event": { + "type": "string", + "enum": [ + "custom_event_defined_in_EVENT_SCHEMA" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " + }, "source": { "type": "object", "description": "Contains the custom earning rule name and parent campaign.", @@ -26888,7 +23883,7 @@ } } }, - "8_obj_earning_rule_object_custom_event_no_validation_rule": { + "8_req_update_earning_rule_object_custom_event": { "description": "This is an object representing an earning rule triggered by a custom event.", "type": "object", "title": "Earning Rule Object for Custom Event", @@ -26922,25 +23917,8 @@ } ], "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, "validation_rule_id": { - "type": "null", + "type": "string", "example": "val_248vs7tUjlIE", "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." }, @@ -26958,24 +23936,6 @@ } ] }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API.", - "example": "ms_gn4Qe4xsFPf7orCArCiNVY13" - } - } - }, - "event": { - "type": "string", - "enum": [ - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining [custom events](https://support.voucherify.io/article/111-custom-events). " - }, "source": { "type": "object", "description": "Contains the custom earning rule name and parent campaign.", @@ -26984,16 +23944,6 @@ "type": "string", "example": "Order Paid - You will get 100 points", "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." } } }, @@ -27036,16 +23986,6 @@ "type": "integer" } }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, "metadata": { "type": "object", "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." @@ -27375,142 +24315,6 @@ } } }, - "8_obj_earning_rule_object_tier_no_validation_rule": { - "description": "This is an object representing an earning rule for tiers.", - "type": "object", - "title": "Earning Rule Object for Tiers", - "properties": { - "id": { - "type": "string", - "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", - "description": "Assigned by the Voucherify API, identifies the earning rule object." - }, - "created_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", - "example": "2022-02-02T13:18:32.557Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", - "example": "2022-02-03T13:09:27.206Z", - "format": "date-time" - }, - "validation_rule_id": { - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance.", - "type": "null" - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "$ref": "#/components/schemas/8_obj_fixed_points" - }, - { - "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" - } - ] - }, - "event": { - "type": "string", - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.loyalty.tier.joined` an event defined by the Voucherify API corresponding to a customer joining a tier \n- `customer.loyalty.tier.left` an event defined by the Voucherify API corresponding to a customer leaving a tier \n- `customer.loyalty.tier.upgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.downgraded` an event defined by the Voucherify API corresponding to a customer's tier being upgraded \n- `customer.loyalty.tier.prolonged` an event defined by the Voucherify API corresponding to a customer's tier being prolonged", - "enum": [ - "customer.loyalty.tier.joined", - "customer.loyalty.tier.left", - "customer.loyalty.tier.upgraded", - "customer.loyalty.tier.downgraded", - "customer.loyalty.tier.prolonged" - ] - }, - "loyalty_tier": { - "type": "object", - "description": "Defines the tier associated with the earning rule definition.", - "properties": { - "id": { - "type": "string", - "description": "Unique loyalty tier ID associated with the earning rule. \n\n- `__ANY__`: any loyalty tier within the campaign", - "example": "ltr_pudTGWasuIqxdiDM0go31OV1" - } - } - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - }, - "object_id": { - "type": "string", - "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", - "description": "A unique campaign identifier assigned by the Voucherify API." - }, - "object_type": { - "type": "string", - "default": "campaign", - "description": "Defines the object associated with the earning rule. Defaults to `campaign`." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - } - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "object": { - "type": "string", - "default": "earning_rule", - "description": "The type of object represented by JSON. Default is `earning_rule`." - }, - "automation_id": { - "type": "string", - "description": "For internal use by Voucherify.", - "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" - }, - "metadata": { - "type": "object", - "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." - } - } - }, "8_obj_fixed_points": { "title": "Define Fixed Amount of Points", "type": "object", @@ -28399,177 +25203,6 @@ ] } }, - "8_req_create_earning_rules_copy": { - "description": "This data model represents the request body for the `/loyalties/{campaignId}/earning-rules` endpoint.", - "type": "object", - "title": "Create Earning Rule Request Body", - "properties": { - "event": { - "type": "string", - "enum": [ - "order.paid", - "customer.segment.entered", - "custom_event_defined_in_EVENT_SCHEMA" - ], - "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `order.paid` an event defined by the Voucherify API corresponding to an order status `PAID`. Read more here. \n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment. Read more here. \n- `custom_event_name` the name of a custom event defined in the Dashboard → **Project Settings** → **EVENT SCHEMA** → **Add event definition**. Read more on defining custom events. " - }, - "validation_rule_id": { - "type": "string", - "example": "val_248vs7tUjlIE", - "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." - }, - "loyalty": { - "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", - "oneOf": [ - { - "description": "Fixed. Applicable to events `order.paid`, `customer.segment.entered`, and `custom_event`.", - "properties": { - "points": { - "type": "integer", - "description": "The number of points to be added to the loyalty card.", - "example": 1000 - }, - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card. `FIXED` adds a fixed number of `points`.", - "default": "FIXED" - } - }, - "required": [ - "points", - "type" - ] - }, - { - "description": "Proportional. Applicable to only `order.paid`.", - "properties": { - "type": { - "type": "string", - "description": "Defines how the points will be added to the loyalty card.`PROPORTIONAL` adds points based on a pre-defined ratio", - "default": "PROPORTIONAL" - }, - "order": { - "type": "object", - "description": "Defines proportion for calculating how many points to add to a loyalty card. The ratio is based on the order amount. For `every` dollar spent, the customer will get this many `points`. \n", - "required": [ - "amount" - ], - "properties": { - "amount": { - "type": "object", - "description": "Defines the ratio based on the order amount.", - "required": [ - "every", - "points" - ], - "properties": { - "every": { - "type": "integer", - "description": "Order amount. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 order amount is written as 1000." - }, - "points": { - "type": "integer", - "description": "Number of points awarded." - } - } - } - } - } - }, - "required": [ - "type", - "order" - ] - } - ], - "type": "object" - }, - "source": { - "type": "object", - "description": "Contains the custom earning rule name and parent campaign.", - "properties": { - "banner": { - "type": "string", - "example": "Order Paid - You will get 100 points", - "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." - } - } - }, - "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" - }, - "start_date": { - "type": "string", - "example": "2022-02-02T13:00:00.000Z", - "format": "date-time", - "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default." - }, - "expiration_date": { - "type": "string", - "format": "date-time", - "example": "2022-03-03T14:30:00.000Z", - "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." - }, - "validity_timeframe": { - "type": "object", - "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day. `start_date` **required** when including the `validity_timeframe`.", - "properties": { - "duration": { - "type": "string", - "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", - "example": "PT1H" - }, - "interval": { - "type": "string", - "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", - "example": "P2D" - } - }, - "required": [ - "duration", - "interval" - ] - }, - "validity_day_of_week": { - "type": "array", - "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" - } - }, - "custom_event": { - "type": "object", - "description": "Contains the schema id of a custom event. **Required** for the custom event option in `event`.", - "properties": { - "schema_id": { - "type": "string", - "description": "Contains a unique identifier of a custom event schema. Assigned by the Voucherify API." - } - }, - "required": [ - "schema_id" - ] - }, - "segment": { - "type": "object", - "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", - "properties": { - "id": { - "type": "string", - "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." - } - }, - "required": [ - "id" - ] - } - }, - "required": [ - "event", - "loyalty" - ] - }, "8_req_update_earning_rule": { "description": "Request body schema for updating earning rules using **PUT** `/loyalties/{campaignId}/earning-rules/{earningRuleId}` endpoint.", "title": "Update Earning Rule Request Body", @@ -28920,187 +25553,6 @@ } } }, - "8_res_loyalties_campaign_id_tiers_tier_id_earning_rules": { - "type": "object", - "properties": { - "object": { - "type": "string" - }, - "data_ref": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "created_at": { - "type": "string" - }, - "updated_at": { - "type": "null" - }, - "validation_rule_id": { - "type": "null" - }, - "loyalty": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "type": { - "type": "string" - } - } - }, - "event": { - "type": "string" - }, - "source": { - "type": "object", - "properties": { - "banner": { - "type": "string" - }, - "object_id": { - "type": "string" - }, - "object_type": { - "type": "string" - } - } - }, - "active": { - "type": "boolean" - }, - "object": { - "type": "string" - }, - "automation_id": { - "type": "string" - }, - "custom_event": { - "type": "object", - "properties": { - "schema_id": { - "type": "string" - } - } - } - } - } - }, - "total": { - "type": "integer" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "title": "List Loyalty Tier Earning Rules" - }, - "8_res_loyalties_campaign_id_tiers_tier_id_rewards": { - "title": "List Loyalty Tier Rewards", - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/rewards`." - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id": { - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}`", - "title": "Get Reward Assignment", - "properties": { - "id": { - "type": "string", - "example": "rewa_hzc19a5NLyIr2bVL3UB1w0B3" - }, - "reward_id": { - "type": "string", - "example": "rew_JhjeISE1npQyxRmGV1JYohDP" - }, - "related_object_id": { - "type": "string", - "example": "camp_pqZjuhG6Mgtp4GD0zD7b8hA3" - }, - "related_object_type": { - "type": "string", - "example": "campaign" - }, - "created_at": { - "type": "string", - "example": "2021-12-13T11:58:32.261Z", - "format": "date-time" - }, - "updated_at": { - "type": "string", - "example": "2022-01-13T11:58:32.261Z", - "format": "date-time" - }, - "object": { - "type": "string", - "default": "reward_assignment" - } - } - }, - "8_res_loyalties_campaign_id_reward-assignments_assignment_id_reward": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "parameters": { - "type": "object", - "properties": { - "coin": { - "type": "object", - "properties": { - "exchange_ratio": { - "type": "number" - }, - "points_ratio": { - "type": "integer" - } - } - } - } - }, - "stock": { - "type": "null" - }, - "redeemed": { - "type": "null" - }, - "attributes": { - "type": "object", - "properties": {} - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "updated_at": { - "type": "null", - "format": "date-time" - }, - "object": { - "type": "string" - } - }, - "description": "Response body schema for `/loyalties/{campaignId}/reward-assignments/{assignmentId}/`", - "title": "Get Reward Details" - }, "8_obj_export_object_points_expiration": { "title": "Points Expirations Export Object", "type": "object", @@ -29271,17 +25723,6 @@ } } }, - "8_req_filter_junction": { - "title": "Filter by campaign ID", - "type": "object", - "description": "Filter conditions by campaign ID.", - "properties": { - "junction": { - "type": "string", - "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." - } - } - }, "8_req_filter_conditions": { "title": "Filter by conditions", "type": "object", @@ -29345,61 +25786,6 @@ } } }, - "8_res_list_loyalty_tiers": { - "title": "List Loyalty Tiers", - "type": "object", - "description": "Response body schema for listing loyalty tiers for a campaign using **GET** `/loyalties/{campaignId}/tiers`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects.", - "default": "data" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tier objects." - } - } - }, - "8_res_get_member_loyalty_tier": { - "title": "Get Member's Loyalty Tier Response Body", - "type": "object", - "description": "Response body schema for retrieving a member's loyalty tier for a campaign using **GET** `/loyalties/members/{memberId}/tiers`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty tiers in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty tier objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_tier_object_member" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty tiers." - } - } - }, "8_req_create_reward_assignment": { "title": "Create Reward Assignment Request Body", "type": "array", @@ -29462,32 +25848,6 @@ } } }, - "8_res_list_loyalty_tier_earning_rules": { - "title": "List Loyalty Tier Earning Rules", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/tiers/{tierId}/earning-rules`.", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about loyalty tier earning rules in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty tier earning rule objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty tier earning rules.", - "items": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of earning rule objects." - } - } - }, "8_res_list_loyalty_tier_rewards": { "title": "List Loyalty Tier Rewards", "type": "object", @@ -29633,62 +25993,6 @@ } } }, - "8_res_list_member_rewards": { - "title": "List Member Rewards", - "type": "object", - "description": "Response body schema for `/loyalties/members/{memberId}/rewards`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about member rewards in a dictionary." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of loyalty reward objects." - }, - "data": { - "type": "array", - "description": "Contains array of loyalty reward objects.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_reward_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of loyalty reward objects." - } - } - }, - "8_res_get_points_expiration": { - "title": "Get Points Expiration Response Body", - "type": "object", - "description": "Response body schema for `/loyalties/{campaignId}/members/{memberId}/points-expiration`.", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON. This object stores information about loyalty points expiration buckets in a dictionary." - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of loyalty points expiration bucket objects.", - "default": "data" - }, - "data": { - "type": "array", - "description": "Contains array of loyalty points expiration buckets.", - "items": { - "$ref": "#/components/schemas/8_obj_loyalty_points_bucket" - } - }, - "total": { - "type": "integer", - "description": "Total number of point expiration buckets." - } - } - }, "9_req_create_customer": { "type": "object", "title": "Customer", @@ -30653,414 +26957,6 @@ } } }, - "22_obj_webhooks": { - "type": "object", - "title": "Webhooks", - "description": "Data object model for a webhook.\n\n\nredemption.succeeded \nredemption.failed \nredemption.rollback.succeeded \nredemption.rollback.failed \npublication.succeeded \nvoucher.published \nvoucher.updated \nvoucher.deleted \nvoucher.created \nVoucher.enabled \nvoucher.disabled \nvoucher.loyalty_card.points_added \nvoucher.gift.balance_added \ncampaign.enabled \ncampaign.deleted \ncampaign.created \ncampaign.updated \ncampaign.disabled \ncampaign.vouchers.generation.completed \nbusiness_validation_rule.assignment.created \nbusiness_validation_rule.assignment.deleted \nbusiness_validation_rule.created \nbusiness_validation_rule.deleted \nbusiness_validation_rule.updated \ncustomer.created \ncustomer.deleted \ncustomer.rewarded \ncustomer.rewarded.loyalty_points \ncustomer.consents.revoked \ncustomer.consents.given ", - "x-tags": [ - "WEBHOOKS" - ], - "properties": { - "id": { - "type": "string", - "example": "event_m7MXf3zPf1n51IoUM8XHpP0w", - "description": "Unique event ID." - }, - "object": { - "type": "string", - "default": "event", - "description": "The type of object represented by JSON. This object stores information about events in a dictionary." - }, - "webhook_id": { - "type": "string", - "example": "wh_K7hpwSVDmKaxmBsDn0EpCvDy", - "description": "Unique webhook ID." - }, - "project_id": { - "type": "string", - "example": "proj_z7id5", - "description": "Unique Voucherify project ID." - }, - "created_at": { - "type": "string", - "example": "2022-11-30T16:53:30.434Z", - "format": "date-time", - "description": "Timestamp representing the date and time when the webhook was created in ISO 8601 format." - }, - "type": { - "type": "string", - "enum": [ - "redemption.succeeded", - "redemption.failed", - "redemption.rollback.succeeded", - "redemption.rollback.failed", - "publication.succeeded", - "voucher.published", - "voucher.updated", - "voucher.deleted", - "voucher.created", - "Voucher.enabled", - "voucher.disabled", - "voucher.loyalty_card.points_added", - "voucher.gift.balance_added", - "campaign.enabled", - "campaign.deleted", - "campaign.created", - "campaign.updated", - "campaign.disabled", - "campaign.vouchers.generation.completed", - "business_validation_rule.assignment.created", - "business_validation_rule.assignment.deleted", - "business_validation_rule.created", - "business_validation_rule.deleted", - "business_validation_rule.updated", - "customer.created", - "customer.deleted", - "customer.rewarded", - "customer.rewarded.loyalty_points", - "customer.consents.revoked", - "customer.consents.given" - ] - }, - "data": { - "$ref": "#/components/schemas/22_obj_webhook_object_data" - }, - "metadata": { - "type": "object", - "description": "A set of custom key/value pairs attached to a webhook. The metadata object stores all custom attributes assigned to the webhook. It can be useful for storing additional information about the webhook in a structured format.", - "properties": { - "source": { - "type": "string", - "description": "The origin of the webhook.", - "enum": [ - "API" - ] - } - } - } - } - }, - "22_obj_webhook_object_data": { - "title": "Webhook Object", - "description": "Webhook event data object schema.", - "anyOf": [ - { - "$ref": "#/components/schemas/22_obj_event_redemption_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_redemption_rollback_failed" - }, - { - "$ref": "#/components/schemas/22_obj_event_publication_succeeded" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_published" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_loyalty_card_points_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_voucher_gift_balance_added" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_enabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_disabled" - }, - { - "$ref": "#/components/schemas/22_obj_event_campaign_vouchers_generation_completed" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_assignment_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_business_validation_rule_updated" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_created" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_deleted" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_rewarded_loyalty_points" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_given" - }, - { - "$ref": "#/components/schemas/22_obj_event_customer_consents_revoked" - } - ] - }, - "22_obj_event_redemption_succeeded": { - "title": "Redemption Succeeded", - "description": "Event data object schema for `redemption.succeeded`.", - "type": "object" - }, - "22_obj_event_redemption_failed": { - "title": "Redemption Failed", - "description": "Event data object schema for `redemption.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_failed": { - "title": "Redemption Rollback Failed", - "description": "Event data object schema for `redemption.rollback.failed`.", - "type": "object" - }, - "22_obj_event_redemption_rollback_succeeded": { - "title": "Redemption Rollback Succeeded", - "description": "Event data object schema for `redemption.rollback.succeeded`.", - "type": "object" - }, - "22_obj_event_publication_succeeded": { - "title": "Publication Succeeded", - "description": "Event data object schema for `publication.succeeded`.", - "type": "object" - }, - "22_obj_event_voucher_published": { - "title": "Voucher Published", - "description": "Event data object schema for `voucher.published`.", - "type": "object" - }, - "22_obj_event_voucher_updated": { - "title": "Voucher Updated", - "description": "Event data object schema for `voucher.updated`.", - "type": "object" - }, - "22_obj_event_voucher_deleted": { - "title": "Voucher Deleted", - "description": "Event data object schema for `voucher.deleted`.", - "type": "object" - }, - "22_obj_event_voucher_created": { - "title": "Voucher Created", - "description": "Event data object schema for `voucher.created`.", - "type": "object" - }, - "22_obj_event_voucher_enabled": { - "title": "Voucher Enabled", - "description": "Event data object schema for `voucher.enabled`.", - "type": "object" - }, - "22_obj_event_voucher_disabled": { - "title": "Voucher Disabled", - "description": "Event data object schema for `voucher.disabled`.", - "type": "object" - }, - "22_obj_event_voucher_loyalty_card_points_added": { - "title": "Voucher Loyalty Card Points Added", - "description": "Event data object schema for `voucher.loyalty_card.points_added`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "voucher": { - "$ref": "#/components/schemas/1_obj_voucher_object" - } - } - }, - "22_obj_event_voucher_gift_balance_added": { - "title": "Voucher Gift Balance Added", - "description": "Event data object schema for `voucher.gift.balance_added`.", - "type": "object" - }, - "22_obj_event_campaign_enabled": { - "title": "Campaign Enabled", - "description": "Event data object schema for `campaign.enabled`.", - "type": "object" - }, - "22_obj_event_campaign_deleted": { - "title": "Campaign Deleted", - "description": "Event data object schema for `campaign.deleted`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/2_obj_campaign_object" - }, - "campaign": { - "$ref": "#/components/schemas/2_obj_campaign_object" - } - } - }, - "22_obj_event_campaign_created": { - "title": "Campaign Created", - "description": "Event data object schema for `campaign.created`.", - "type": "object" - }, - "22_obj_event_campaign_updated": { - "title": "Campaign Updated", - "description": "Event data object schema for `campaign.updated`.", - "type": "object" - }, - "22_obj_event_campaign_disabled": { - "title": "Campaign Disabled", - "description": "Event data object schema for `campaign.disabled`.", - "type": "object" - }, - "22_obj_event_campaign_vouchers_generation_completed": { - "title": "Campaign Vouchers Generation Completed", - "description": "Event data object schema for `campaign.vouchers.generation.completed`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_created": { - "title": "Business Validation Rule Assignment Created", - "description": "Event data object schema for `business_validation_rule.assignment.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_assignment_deleted": { - "title": "Business Validation Rule Assignment Deleted", - "description": "Event data object schema for `business_validation_rule.assignment.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_created": { - "title": "Business Validation Rule Created", - "description": "Event data object schema for `business_validation_rule.created`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_deleted": { - "title": "Business Validation Rule Deleted", - "description": "Event data object schema for `business_validation_rule.deleted`.", - "type": "object" - }, - "22_obj_event_business_validation_rule_updated": { - "title": "Business Validation Rule Updated", - "description": "Event data object schema for `business_validation_rule.updated`.", - "type": "object" - }, - "22_obj_event_customer_created": { - "title": "Customer Created", - "description": "Event data object schema for `customer.created`.", - "type": "object" - }, - "22_obj_event_customer_deleted": { - "title": "Customer Deleted", - "description": "Event data object schema for `customer.deleted`.", - "type": "object" - }, - "22_obj_event_customer_rewarded": { - "title": "Customer Rewarded", - "description": "Event data object schema for `customer.rewarded`.", - "type": "object" - }, - "22_obj_event_customer_rewarded_loyalty_points": { - "title": "Customer Rewarded Loyalty Points", - "description": "Event data object schema for `customer.rewarded.loyalty_points`.", - "type": "object", - "properties": { - "object": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "related_object": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" - }, - "customer": { - "$ref": "#/components/schemas/9_obj_customer_object" - }, - "voucher": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "code": { - "type": "string" - }, - "loyalty_card": { - "type": "object", - "properties": { - "points": { - "type": "integer" - }, - "balance": { - "type": "integer" - } - } - }, - "type": { - "type": "string", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string" - }, - "campaign_id": { - "type": "string" - }, - "is_referral_code": { - "type": "boolean" - }, - "holder_id": { - "type": "string", - "example": "cust_o3ffuQSwM0vlxeJJoMqiOLMI" - } - } - }, - "campaign": { - "type": "string" - }, - "earning_rule": { - "$ref": "#/components/schemas/8_obj_earning_rule_object" - } - } - }, - "22_obj_event_customer_consents_revoked": { - "title": "Customer Consents Revoked", - "description": "Event data object schema for `customer.consents.revoked`.", - "type": "object" - }, - "22_obj_event_customer_consents_given": { - "title": "Customer Consents Given", - "description": "Event data object schema for `customer.consents.given`.", - "type": "object" - }, "9_obj_customer_activity_object": { "type": "object", "title": "Customer Activity Object", @@ -31230,16 +27126,6 @@ } ] }, - "9_obj_customer_activity_object_data_customer_email_unsubscribed": { - "title": "Email Unsubscribed", - "description": "Email unsubscribed", - "type": "object", - "properties": { - "email_unsubscribed": { - "type": "boolean" - } - } - }, "9_obj_customer_activity_object_data_customer_confirmed": { "title": "Customer Confirmed", "description": "Event data object schema for `customer.confirmed`.", @@ -32835,100 +28721,6 @@ } } }, - "10_obj_order_item_object": { - "title": "Order Item Object", - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "order_item", - "description": "The type of object represented by JSON. This object stores information about the `order_item`." - }, - "product_id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "sku_id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "quantity": { - "type": "integer", - "description": "Quantity of the item in the cart." - }, - "amount": { - "type": "integer", - "description": "Represents a total pre-discount amount of order item (`price` * `quantity`)." - }, - "discount_amount": { - "type": "integer", - "description": "The item-level discount applied to the item." - }, - "price": { - "type": "integer", - "description": "Unit price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - }, - "subtotal_amount": { - "type": "integer", - "description": "Final order item amount after the applied item-level discount. If there are no item-level discounts applied, this item is equal to the `amount`. \n`subtotal_amount`=`amount`-`discount_amount`" - }, - "product": { - "type": "object", - "description": "This object stores more information about the related product.", - "properties": { - "id": { - "type": "string", - "example": "prod_5h0wc453_1", - "description": "A unique identifier that represents the product and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "description": "A unique product identifier from your inventory system.", - "example": "illy-arabica" - }, - "name": { - "type": "string", - "example": "Brewing System", - "description": "Product name." - }, - "price": { - "type": "integer", - "description": "Unit price of a product. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - }, - "sku": { - "type": "object", - "description": "This object stores more information about the related SKU.", - "properties": { - "id": { - "type": "string", - "example": "sku_prod_5h0wc453_1_1", - "description": "A unique identifier that represents the SKU and is assigned by Voucherify." - }, - "source_id": { - "type": "string", - "example": "illy-arabica-250g", - "description": "A unique SKU identifier from your inventory system." - }, - "sku": { - "type": "string", - "description": "SKU name." - }, - "price": { - "type": "integer", - "description": "Unit price of a SKU. Value is multiplied by 100 to precisely represent 2 decimal places. For example, $100 is written as 10000." - } - } - } - }, - "description": "This is an object representing an order item. \n\nOrder Items are always specified within the [order object](ref:get-order). They can be related either to [products](list-products) or [SKUs](ref:list-skus-in-product). \n\nProduct/SKU details sent within an order item will be used on top of Product/SKU already stored in the system during the [Redeem Voucher](ref:redeem-voucher), [Validate Voucher](ref:validate-voucher), [Validate Promotions](ref:validate-promotions) and [Redeem Promotion](ref:redeem-promotion) requests.", - "x-tags": [ - "ORDERS API" - ] - }, "11_obj_product_object": { "type": "object", "description": "This is an object representing a product. \n\nThis entity should be used to map product items from your inventory management system. The aim of products is to build validation rules which reflect product-specific campaigns.", @@ -34998,14 +30790,6 @@ } } }, - "15_obj_event_object": { - "title": "Event Object", - "type": "object", - "description": "This is an object representing an event. \n\nVoucherify distinguishes two types of events - custom and internal. Both are presented in the same Event structure. \n\n## Custom Events\n\nCustom Events are actions taken by your customers. They’re best suited for tracking high-value customer interactions with your application. Logging a custom event can trigger any number of distributions, and enables the segmentation filters around the recency and frequency of that event.\n\nWith Custom Event metadata field, Voucherify allows you to set properties on custom events. These properties can then be used for further qualifying trigger conditions, increasing personalization in messaging, and generating more sophisticated analytics through raw data export.\n\nThe Custom Events are directly linked to the customers' resources from Voucherify. It means that each event gets a connection to a customer. \n\n\n> #### An example \n>\n> If an e-commerce application wanted to send a message to a user when he/she abandons their cart, the custom event could additionally improve its target audience and allow for increased distribution personalization by adding a Custom Event of the `value` of customers’ order.\n\n## Internal Voucherify Events \n\nMoreover, Events are our way of letting you know when something interesting happens in your project. When an interesting event occurs, we create a new Event object. For example, when a redemption succeeds, we create a `redemption.succeeded` event.\n\nNote that many API requests may cause multiple events to be created. For example, if you create a new redemption for a new customer not existing yet in Voucherify, you will receive both a `customer.created` event and a `redemption.succeeded` event.\n\nThe events occur when the state of another API resource changes and the state of that resource at the time of the change is embedded in the data field of the event. \n\n| **Types of internal events** |\n|:---|\n| **Campaign** |\n| campaign.validation_rules.created
                                  campaign.created
                                  campaign.disabled
                                  campaign.export_mailchimp_scheduled
                                  campaign.export_mailchimp_done
                                  campaign.validation_rules.deleted
                                  campaign.validation_rules.updated
                                  campaign.updated
                                  campaign.deleted
                                  campaign.export_mailchimp_failed
                                  campaign.enabled |\n| **Voucher** |\n| voucher.validation.succeeded
                                  voucher.updated
                                  voucher.enabled
                                  voucher.gift.balance_added
                                  voucher.validation_rules.updated
                                  voucher.published
                                  voucher.validation_rules.deleted
                                  voucher.disabled
                                  voucher.validation.failed
                                  voucher.validation_rules.created
                                  voucher.deleted
                                  voucher.created |\n| **Redemption** |\n| redemption.succeeded
                                  redemption.failed
                                  redemption.rollback.failed
                                  redemption.rollback.succeeded |\n| **Customer** |\n| customer.rewarded
                                  customer.rewarded.loyalty_points
                                  customer.sms.sent
                                  customer.email.failed
                                  customer.deleted
                                  customer.created
                                  customer.updated
                                  customer.segment.left
                                  customer.sms.failed
                                  customer.segment.entered
                                  customer.email.sent |\n| **Order** |\n| order.canceled
                                  order.created
                                  order.updated
                                  order.paid |\n| **Product** |\n| product.updated
                                  product.created
                                  product.deleted |\n| **SKU** |\n| sku.updated
                                  sku.created
                                  sku.deleted |\n| **Distribution** |\n| distribution.sms.failed
                                  distribution.sms.sent
                                  distribution.email.sent
                                  distribution.email.failed |\n| **Export** |\n| export.done
                                  export.scheduled
                                  export.failed
                                  export.deleted | \n\n## Webhooks \n\nVoucherify also has a separate system for sending the event objects directly to an endpoint at your end (server). We called that mechanism webhooks. They are managed in your project settings. \n\n| **Attribute** | **Description** | **Example** |\n|:---|:---|:---|\n| `id`
                                  string | | event_xjGas2mI2PduFFPL2NAcFeHkHfLn3H |\n| `object`
                                  string | Type of the object represented by JSON. Value is `event`. | |\n| `created_at`
                                  string, ISO 8601 date format | Time at which the object was created. | 2016-11-16T14:14:31Z |\n| `type`
                                  string | Description of the event | view_pricing_page
                                  redemption.succeeded |\n| `data.object`
                                  object | The object containing data associated with the event. It can be a `customer`, `redemption` or any other type of object which is a source of the event. In this object structure, you can also find a property `related_object` which contains values presenting any other resource connected to the event.

                                  For Custom Event the structure of child attributes is constant:

                                  - customer (`object`) - The object presenting a profile of the related customer who performed an action.

                                  - metadata (`object`) - A set of key/value pairs that you can attach to a custom event object. It can be useful for storing additional information about the event in a structured format. | \"data\": { \"object\": { \"customer\": { \"id\": \"cust_OtHDKrv5sJrjd8aYBYZ6AOIF\", \"name\": \"Gustav Purpleson\", \"object\": \"customer\", \"source_id\": \"gustav@purpleson.com\", \"created_at\": 1510834859417, \"updated_at\": 1510835106559 }, \"metadata\": { \"lang\": \"en\", \"test\": true, \"page\": \"http://main.io\" } } } |\n| `metadata`
                                  object | A set of key/value pairs that Voucherify attaches to a custom event object. It is a set of additional system information about the event in a structured format. | |\n\n\n```json\n{\n \"id\": \"event_ehkvgZFgSePlb95SH3JJulkApy9Kg9\",\n \"object\": \"event\",\n \"created_at\": \"2017-11-16T14:45:34.181Z\",\n \"type\": \"redemption.succeeded\",\n \"data\": {\n \"object\": {\n \"id\": \"r_mist0IpebikTaRdxiOGI2IhL\",\n \"date\": \"2017-11-16T14:45:32.733Z\",\n \"order\": {\n \"id\": \"ord_AhDlR13vQE5ino95P2NIABBN\",\n \"items\": [\n {\n \"object\": \"order_item\",\n \"sku_id\": null,\n \"quantity\": 1,\n \"source_id\": null,\n \"product_id\": \"iphone8\"\n }\n ],\n \"amount\": 50000,\n \"object\": \"order\",\n \"status\": \"CREATED\",\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": null,\n \"referrer\": null,\n \"source_id\": null,\n \"created_at\": \"2017-11-16T14:45:32.023Z\",\n \"updated_at\": null,\n \"discount_amount\": 2000\n },\n \"object\": \"redemption\",\n \"result\": \"SUCCESS\",\n \"voucher\": {\n \"code\": \"2017-goX-aH\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"object\": \"voucher\",\n \"campaign\": \"SteffenTest\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 2000\n },\n \"is_referral_code\": false\n },\n \"customer\": {\n \"id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"object\": \"customer\"\n },\n \"metadata\": {\n \"city\": \"London1\"\n },\n \"customer_id\": \"cust_fJPsoub5ITJnIEVO3v9whrP9\",\n \"tracking_id\": \"track_3tM7KR57bbeIRtMcvpKYr2aAOrCpYBDZ\",\n \"related_object_type\": \"voucher\"\n },\n \"previous_attributes\": {}\n },\n \"metadata\": {\n \"source\": \"API\"\n }\n}\n```\n\n## Customisable Campaign Events \n\nAs part of campaign creation, users can configure webhooks triggered when specific activities appear within a campaign's lifetime. Those webhooks get configurable names and the users implement them in Voucherify Dashboard as part of the campaign creation process.\n\nThis type of webhooks can be configured for the following actions: \n\n| **Action** |\n|:---|\n| **Referral Program** |\n| Referrer rewarded
                                  Referral code assigned
                                  Customer referred |\n| **Loyalty Campaign** |\n| Loyalty card assigned
                                  Points earned
                                  Points redeemed | \n\nPayloads of customizable webhooks:\n\n### Referral Program\n\n\n```json\n{\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:09:57.765Z\",\n \"type\": \"referral_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"is_referral_code\": true,\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 1,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:00:08.306Z\",\n \"updated_at\": \"2021-11-12T11:09:40.671Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null,\n \"last_order_date\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:09:57.749Z\",\n \"updated_at\": \"2021-11-12T11:09:58.620Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null,\n \"value\": \"$10.00\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b1a5acd3437894\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_gSpZUNX0hcDfEeRx3qIMMFrtfsZjeJO8\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"gift\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19wsHlNj5GT/2Kkf/MnPKlL4WjU55GyTsmpXgw+KQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy/OHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va+MFPSHRy5tesDQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19wsHlNj5GT%2F2Kkf%2FMnPKlL4WjU55GyTsmpXgw%2BKQOwp3ux0XzUAgsTcujC49hkjk7ony8mPL429zzWHGy%2FOHpvDwuY0Z6AECrqzRea81MCjkqI0gKlVEhqYWoCm7Va%2BMFPSHRy5tesDQ%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19ZgrgURtgcjD1cvt/L6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i/UVUbmXTxDvNXsceP+nzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19ZgrgURtgcjD1cvt%2FL6wMNDySfG6AOT4NHpVJgceyuHAqJWYN3UgCn9jv8TIPtSfkNuHzI4i%2FUVUbmXTxDvNXsceP%2BnzHjmWp6fS3e7dR3SVEL3VHdSLZ1O7W9xPjRadOCGNZXPddd3w%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/xYwEheRh/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Referral Webhooks\",\n \"category\": null,\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"metadata\": {},\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"created_at\": \"2021-11-12T11:09:57.772Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/xYwEheRh/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"loyalty_card\": null,\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": true,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"referred_customers_count\": null\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"test_referrer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:09:57.765Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"tracking_id\": \"test_referrer__01\",\n \"vouchers_id\": [\n \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:09:57.765Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:49.723Z\",\n \"type\": \"referrer_rewarded_webhook\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/k\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1+tdyBGQeM+ZONM/k\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": true\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"source_id\": \"test_referrer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 1,\n \"campaigns\": {\n \"Referral Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 1\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:09:57.749Z\",\n \"updated_at\": \"2021-01-24T11:19:41.513Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_9Y7nwUx3BaU3cHqBVbd0TEtS2ENiFZhJ\",\n \"created_at\": \"2021-01-24T11:19:40.317Z\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"test_referrer__01\",\n \"metadata\": {},\n \"channel\": \"Automation\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"dOzJ84Ky\",\n \"vouchers\": [\n {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"category\": null,\n \"type\": \"GIFT_VOUCHER\",\n \"discount\": null,\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX1+tdyBGQeM+ZONM/kBdZ\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BtdyBGQeM%2BZONM%2FkBdZ\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1+WOEBHpX4y\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BWOEBHpX4y\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-01-24T11:19:40.409Z\",\n \"updated_at\": \"2021-01-24T11:19:41.518Z\",\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/dOzJ84Ky/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"redeemed_amount\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/dOzJ84Ky/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\"\n ],\n \"campaign_name\": \"Bonus Cards\",\n \"gift\": {\n \"amount\": 0,\n \"balance\": 0\n },\n \"loyalty_card\": null,\n \"discount\": null,\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b3e7b718c480ca\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"test_referrer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"code\": \"xYwEheRh\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"amount_off\": 1000,\n \"effect\": \"APPLY_TO_ORDER\"\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"Referral Webhooks\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"is_referral_code\": true,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"referrer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"campaign\": {\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": true,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"auto_join\": null,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_Fuzc1rngCCuKRDfBXBjUwl5j\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-01-24T11:19:43.883Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_ZlNAlSHNgK57ErFgOxAz7swPBPfMBlMp\",\n \"campaign_id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"customer_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\",\n \"reward_assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"source_id\": \"event_0a26b3d269013fc79e\",\n \"source_type\": \"redemption_event\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"voucher\": {\n \"id\": \"v_2teI9HcRvdvK1RsWD6gyNztHr4SMkMDy\",\n \"code\": \"dOzJ84Ky\",\n \"gift\": {\n \"amount\": 500,\n \"balance\": 500\n },\n \"type\": \"GIFT_VOUCHER\",\n \"campaign\": \"Bonus Cards\",\n \"campaign_id\": \"camp_yheSCBQGrgeBwGMkQqjsUW24\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_laSm5Bbd6fzSgVtyKYfGot4L\"\n },\n \"id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"object\": \"reward\",\n \"name\": \"Credits - 5$\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_9FxFsy0M5UYc8jWjNrlSBWtG\",\n \"reward_id\": \"rew_e5taIjbo05k2vODIJtZ7mGED\",\n \"related_object_id\": \"rrt_NWk1WYi1sZs3Epjvvd5a9JZx\",\n \"related_object_type\": \"referral_tier\",\n \"created_at\": \"2021-01-24T11:00:08.471Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"event_0a26b3d269013fc79e\",\n \"type\": \"redemption_event\"\n },\n \"balance\": {\n \"amount\": 500\n }\n },\n \"created_at\": \"2021-01-24T11:19:49.723Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-01-24T11:19:41.101Z\",\n \"type\": \"referee_invited\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_UaT2wwkN9zQs3RiIk7H0PcBc\",\n \"name\": \"Referral Webhooks\",\n \"campaign_type\": \"REFERRAL_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": \"2021-01-24T11:09:40.671Z\",\n \"created_at\": \"2021-01-24T11:00:08.306Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"AMOUNT\",\n \"effect\": \"APPLY_TO_ORDER\",\n \"amount_off\": 1000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": {\n \"conversion_event_type\": \"redemption\"\n },\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b3d893cc3ac160\",\n \"type\": \"customer.referred\",\n \"created_at\": \"2021-01-24T11:19:34.223Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_BfTxUsoofap6Sb6oxG1BLCi5\",\n \"source_id\": \"referred_001\",\n \"name\": null,\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 25000,\n \"total_count\": 1,\n \"average_amount\": 25000,\n \"last_order_amount\": 25000,\n \"last_order_date\": \"2021-01-24T11:19:28.598Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"metadata\": {\n \"vip\": true\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-01-24T11:19:27.844Z\",\n \"updated_at\": \"2021-01-24T11:19:28.926Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {}\n },\n \"metadata_json\": {\n \"is_rewarded\": true,\n \"source\": null\n },\n \"automation_id\": null,\n \"group_id\": \"v-0a26b3d24b032c4871\"\n }\n },\n \"metadata\": {}\n}\n```\n\n### Loyalty Campaign \n\n\n```json\n{\n \"id\": \"evcus_0a26b89763051ed721\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"type\": \"loyalty_code_assigned\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"prefix\": \"\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"use_voucher_metadata_schema\": true,\n \"vouchers_count\": 0,\n \"active\": true,\n \"metadata\": {},\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"creation_status\": \"DONE\",\n \"vouchers_generation_status\": \"DONE\",\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 0,\n \"total_count\": 0,\n \"average_amount\": null,\n \"last_order_amount\": null\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {}\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:40:19.724Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"value\": 0\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26b89763051ed721\",\n \"type\": \"customer.publication.succeeded\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"publication\": {\n \"id\": \"pub_ZAS0kZMqzF8LG5y55nx6dHMx2GkVPmxP\",\n \"object\": \"publication\",\n \"result\": \"SUCCESS\",\n \"channel\": \"API\",\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"gift\": null,\n \"type\": \"LOYALTY_CARD\",\n \"active\": true,\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"object\": \"voucher\",\n \"publish\": {\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\",\n \"count\": 1,\n \"object\": \"list\"\n },\n \"campaign\": \"Loyalty Webhooks\",\n \"category\": null,\n \"discount\": null,\n \"metadata\": {},\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"redemption\": {\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\",\n \"object\": \"list\",\n \"quantity\": null,\n \"redeemed_points\": 0,\n \"redeemed_quantity\": 0\n },\n \"start_date\": null,\n \"updated_at\": null,\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"distributions\": null,\n \"additional_info\": null,\n \"expiration_date\": null,\n \"is_referral_code\": false,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"object\": \"customer\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"source_id\": \"Loyal_customer__01\"\n },\n \"metadata\": {},\n \"source_id\": null,\n \"created_at\": \"2021-11-12T11:40:18.125Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"tracking_id\": \"Loyal_customer__01\",\n \"vouchers_id\": [\n \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n ]\n }\n },\n \"created_at\": \"2021-11-12T11:40:18.125Z\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json\n{\n \"id\": \"event_0a26b9290fc4891587\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:42:51.380Z\",\n \"type\": \"points_earned\",\n \"data\": {\n \"object\": {\n \"order\": {},\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"category\": null,\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 220\n },\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf/oALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186jVQjLtmZYQOPrfFKy9deofCfaFP8VhVe0TTOFxTfEp2zjF3mnS3cvUuB3MkpJDNAvMKNJotHJMUla555NQ8ZBFXSW2fAXBiP997Zf%2FoALLiIGjqo5LTFtedHUTNq5IQ9XgvwgPJBLg%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX1/ICHe/XvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU+S0A4SpuuDsMXXotf/AOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FICHe%2FXvFeZfl2koGimwFH3D4ha4nTSbCzoIdbmxzXYKESU%2BS0A4SpuuDsMXXotf%2FAOO1kdii3o99cHExXipCGBlHaduIu64ogx4oyA9w4P3nmkZ2Nv6aLukBaVd969i5Gylp0GW71sA%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:40:18.138Z\",\n \"updated_at\": \"2021-11-12T11:42:50.332Z\",\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": {\n \"distr_naR4rx0AgM1baWZkFm1kfHn7A9\": {\n \"date\": \"2021-11-12T11:40:21.957Z\"\n },\n \"distr_pnfPKLDAxUpiPi3ZsuMrygtYNN\": {\n \"date\": \"2021-11-12T11:42:50.332Z\"\n }\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/qjvEslzU/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0,\n \"redeemed_points\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/qjvEslzU/redemptions?page=1&limit=10\"\n }\n },\n \"campaign\": {\n \"object\": \"campaign\",\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"description\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"activity_duration_after_publishing\": null,\n \"vouchers_count\": 0,\n \"updated_at\": null,\n \"created_at\": \"2021-11-12T11:39:05.254Z\",\n \"active\": true,\n \"metadata\": {},\n \"vouchers_generation_status\": \"DONE\",\n \"category\": null,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"discount\": null,\n \"gift\": null,\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null\n },\n \"code_config\": {\n \"length\": 8,\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\"\n }\n },\n \"referral_program\": null,\n \"lucky_draw\": null\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 220\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 220,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 220,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:47.393Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n }\n },\n \"related_object\": {\n \"id\": \"event_0a26b9290fc4891587\",\n \"type\": \"customer.rewarded.loyalty_points\",\n \"created_at\": \"2021-11-12T11:42:47.359Z\",\n \"data_json\": {\n \"object\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 0,\n \"total_failed\": 0,\n \"total_succeeded\": 0,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0,\n \"gift\": {\n \"redeemed_amount\": 0,\n \"amount_to_go\": 0\n },\n \"loyalty_card\": {\n \"redeemed_points\": 0,\n \"points_to_go\": 0\n }\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 0,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 0,\n \"referred_customers\": 0\n }\n }\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:42:40.635Z\",\n \"email_unsubscribed\": false,\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"object\": \"customer\"\n },\n \"previous_attributes\": {},\n \"related_object\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n },\n \"balance\": {\n \"points\": 220,\n \"total\": 220,\n \"balance\": 220,\n \"type\": \"loyalty_card\",\n \"object\": \"balance\",\n \"related_object\": {\n \"type\": \"voucher\",\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\"\n }\n }\n },\n \"metadata_json\": {\n \"source\": \"Automation\"\n },\n \"automation_id\": \"auto_McXM3rjWcPwaNU5ndIIP13jX\",\n \"group_id\": \"v-0a26b921779d7eebcb\"\n }\n },\n \"metadata\": {}\n}\n```\n\n```json \n{\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"object\": \"event\",\n \"webhook_id\": null,\n \"project_id\": \"proj_nXIkFGNmrFSf\",\n \"created_at\": \"2021-11-12T11:53:09.910Z\",\n \"type\": \"points_redeemed\",\n \"data\": {\n \"object\": {\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n },\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"object\": \"voucher\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n },\n \"is_referral_code\": false\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"vouchers_count\": 0,\n \"active\": true,\n \"object\": \"campaign\"\n },\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"source_id\": \"Loyal_customer__01\",\n \"name\": \"John Doe\",\n \"description\": null,\n \"email\": null,\n \"phone\": null,\n \"birthday\": null,\n \"birthdate\": null,\n \"address\": null,\n \"summary\": {\n \"redemptions\": {\n \"total_redeemed\": 1,\n \"total_failed\": 0,\n \"total_succeeded\": 1,\n \"total_rolled_back\": 0,\n \"total_rollback_failed\": 0,\n \"total_rollback_succeeded\": 0\n },\n \"orders\": {\n \"total_amount\": 22000,\n \"total_count\": 1,\n \"average_amount\": 22000,\n \"last_order_amount\": 22000,\n \"last_order_date\": \"2021-11-12T11:42:39.633Z\"\n }\n },\n \"loyalty\": {\n \"points\": 218,\n \"referred_customers\": 0,\n \"campaigns\": {\n \"Loyalty Webhooks\": {\n \"points\": 218,\n \"referred_customers\": 0\n }\n }\n },\n \"referrals\": {\n \"total\": 0,\n \"campaigns\": []\n },\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"system_metadata\": {},\n \"created_at\": \"2021-11-12T11:40:18.077Z\",\n \"updated_at\": \"2021-11-12T11:53:07.582Z\",\n \"object\": \"customer\"\n },\n \"publication\": {\n \"id\": \"pub_aFszQ4kOtT1Hori8Wl1i0az1sFQN3CRv\",\n \"created_at\": \"2021-11-12T11:53:03.172Z\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"tracking_id\": \"Loyal_customer__01\",\n \"metadata\": {},\n \"channel\": \"API\",\n \"source_id\": null,\n \"result\": \"SUCCESS\",\n \"voucher_code\": \"xUgBLQck\",\n \"vouchers\": [\n {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"category\": null,\n \"type\": \"DISCOUNT_VOUCHER\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"gift\": null,\n \"loyalty_card\": null,\n \"start_date\": null,\n \"expiration_date\": null,\n \"validity_timeframe\": null,\n \"validity_day_of_week\": null,\n \"active\": true,\n \"additional_info\": null,\n \"metadata\": {},\n \"assets\": {\n \"qr\": {\n \"id\": \"U2FsdGVkX19pNCYXQ8ztNEb+OaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY+oc3HzEpFr2SqITQ/IdD6V7RuYxsyrcfz53Je6+me6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19pNCYXQ8ztNEb%2BOaYwP13ZoOfOMBJwzgz2RNchFxoMDPIHS47i8tY%2Boc3HzEpFr2SqITQ%2FIdD6V7RuYxsyrcfz53Je6%2Bme6VBl9Pze3p8lTSJWwjp79tKEZHygNMggPsfIEi4Ei3Wt1A%3D%3D\"\n },\n \"barcode\": {\n \"id\": \"U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv/upu9ZD9iWat6+nlw+PsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ==\",\n \"url\": \"https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19a0CQqRE3y6dRDn0Jyr74H85dLNo9MQrXRZFBj9fcDUlaV3Q0uG2xa4l4Ch4WVfPGQ3iEEPpYTMQGwm8xN9cynpCv%2Fupu9ZD9iWat6%2Bnlw%2BPsKH5CcyNemhfI273GhBOvh5ysRMpFUZQ%3D%3D\"\n }\n },\n \"is_referral_code\": false,\n \"created_at\": \"2021-11-12T11:53:03.194Z\",\n \"updated_at\": null,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"object\": \"voucher\",\n \"distributions\": null,\n \"publish\": {\n \"object\": \"list\",\n \"count\": 1,\n \"url\": \"/v1/vouchers/xUgBLQck/publications?page=1&limit=10\"\n },\n \"redemption\": {\n \"quantity\": 1,\n \"redeemed_quantity\": 0,\n \"object\": \"list\",\n \"url\": \"/v1/vouchers/xUgBLQck/redemptions?page=1&limit=10\"\n }\n }\n ],\n \"vouchers_id\": [\n \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\"\n ],\n \"campaign_name\": \"20% discount\",\n \"gift\": null,\n \"loyalty_card\": null,\n \"discount\": {\n \"type\": \"PERCENT\",\n \"percent_off\": 20,\n \"amount_limit\": 5000\n },\n \"is_referral_code\": false,\n \"failure_code\": null,\n \"failure_message\": null,\n \"voucher\": null\n }\n },\n \"related_object\": {\n \"id\": \"evcus_0a26bb89060c3ad8bc\",\n \"type\": \"customer.reward_redemptions.completed\",\n \"data\": {\n \"customer\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"holder\": {\n \"id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"name\": \"John Doe\",\n \"email\": null,\n \"source_id\": \"Loyal_customer__01\",\n \"metadata\": {\n \"test\": true,\n \"acq_channel\": \"Twitter\"\n },\n \"object\": \"customer\"\n },\n \"voucher\": {\n \"id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"code\": \"qjvEslzU\",\n \"loyalty_card\": {\n \"points\": 220,\n \"balance\": 218\n },\n \"type\": \"LOYALTY_CARD\",\n \"campaign\": \"Loyalty Webhooks\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"campaign\": {\n \"id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"name\": \"Loyalty Webhooks\",\n \"campaign_type\": \"LOYALTY_PROGRAM\",\n \"type\": \"AUTO_UPDATE\",\n \"is_referral_code\": false,\n \"voucher\": {\n \"type\": \"LOYALTY_CARD\",\n \"loyalty_card\": {\n \"points\": 0,\n \"balance\": 0\n },\n \"redemption\": {\n \"quantity\": null,\n \"redeemed_quantity\": 0\n },\n \"code_config\": {\n \"length\": 8,\n \"prefix\": \"\",\n \"charset\": \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\",\n \"pattern\": \"########\",\n \"postfix\": \"\"\n }\n },\n \"auto_join\": false,\n \"join_once\": false,\n \"active\": true\n },\n \"reward_redemption\": {\n \"id\": \"rewr_uATcoUjIp3VJNgT5TZT5NMaT\",\n \"state\": \"COMPLETED\",\n \"created_at\": \"2021-11-12T11:53:06.025Z\",\n \"updated_at\": null,\n \"voucher_id\": \"v_CGrEQ778F6kLkgktg9xCyzvoMjzTcwbU\",\n \"campaign_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"customer_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\",\n \"reward_assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"source_id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"source_type\": \"redemption\"\n },\n \"reward\": {\n \"assignment_id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"voucher\": {\n \"id\": \"v_ix6p7zxM8m7AdlgObubjP2ibDTCsnEkq\",\n \"code\": \"xUgBLQck\",\n \"discount\": {\n \"type\": \"PERCENT\",\n \"amount_limit\": 5000,\n \"percent_off\": 20\n },\n \"type\": \"DISCOUNT_VOUCHER\",\n \"campaign\": \"20% discount\",\n \"campaign_id\": \"camp_o9vZ7yIqtj5B9CbhJlKRXIZ5\",\n \"is_referral_code\": false,\n \"holder_id\": \"cust_vfkFOr6pMg3MZAHcd7J8Hch7\"\n },\n \"id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"object\": \"reward\",\n \"name\": \"20% discount\",\n \"type\": \"CAMPAIGN\"\n },\n \"reward_assignment\": {\n \"id\": \"rewa_bRTNrtAqXmdHNDe4cNg7y3JC\",\n \"reward_id\": \"rew_l7z9yeLGZHJgCsxwNX5tDXqs\",\n \"related_object_id\": \"camp_iQgR6PmpF3D5H22OcNcRUU0f\",\n \"related_object_type\": \"campaign\",\n \"parameters\": {\n \"loyalty\": {\n \"points\": 2\n }\n },\n \"created_at\": \"2021-11-12T11:39:05.504Z\",\n \"updated_at\": null,\n \"object\": \"reward_assignment\"\n },\n \"source\": {\n \"id\": \"r_Lbxqqjv59hCRLG3Nkl8E4yYk\",\n \"type\": \"redemption\"\n },\n \"balance\": null\n },\n \"created_at\": \"2021-11-12T11:53:09.910Z\"\n }\n },\n \"metadata\": {}\n}\n```", - "x-tags": [ - "EVENTS API" - ] - }, "15_req_track_custom_event": { "title": "Track Custom Event Request Body", "type": "object", @@ -36100,73 +31884,6 @@ } } }, - "16_filter_conditions_array": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$not_in": { - "type": "array", - "description": "Array of resource values that should be included in the results. (multiple values)", - "items": { - "type": "string" - } - }, - "$is": { - "type": "string", - "description": "Value is exactly this value. (single value)" - }, - "$is_not": { - "type": "string", - "description": "Results omit this value. (single value)" - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - }, - "$starts_with": { - "type": "string", - "description": "Value starts with the specified string." - }, - "$ends_with": { - "type": "string", - "description": "Value ends with the specified string." - }, - "$count": { - "type": "integer", - "description": "Value has exactly this number of elements." - }, - "$count_less": { - "type": "integer", - "description": "Value has less than this number of elements." - }, - "$count_more": { - "type": "integer", - "description": "Value has more than this number of elements." - }, - "$contains": { - "type": "string", - "description": "Array contains this element." - } - } - } - } - }, "16_filter_conditions_boolean": { "title": "Filter by conditions", "type": "object", @@ -36196,35 +31913,6 @@ } } }, - "16_filter_conditions_date": { - "title": "Filter by conditions", - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "conditions": { - "type": "object", - "description": "Data filters used to narrow the data records to be returned in the result.", - "properties": { - "$after": { - "type": "string", - "description": "Value is after this date. Value for this parameter is in ISO 8601 format." - }, - "$before": { - "type": "string", - "description": "Value is before this date. Value for this parameter is in ISO 8601 format." - }, - "$has_value": { - "type": "string", - "description": "Value is NOT null. The value for this parameter is an empty string." - }, - "$is_unknown": { - "type": "string", - "description": "Value is null. The value for this parameter is an empty string." - } - } - } - } - }, "16_filter_conditions_date_time": { "title": "Filter by conditions", "type": "object", @@ -36544,61 +32232,6 @@ } } }, - "17_res_obj_get_async_action_result_message": { - "title": "Message", - "type": "object", - "description": "Result schema with message.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - } - } - }, - "17_res_obj_get_async_action_result_message_failed": { - "title": "Message with Failed Array", - "type": "object", - "description": "Result schema with message and failed array.", - "properties": { - "message": { - "type": "string", - "description": "A human-readable message providing a short description about the result." - }, - "failed": { - "type": "array", - "description": "If any records failed during the process, this array shows the failure details.", - "items": {} - } - } - }, - "17_res_obj_get_async_action_result_code_updated_found": { - "title": "Code Updated and Found", - "type": "object", - "description": "Result schema with an array of code, updated, and found parameters.", - "properties": { - "results": { - "type": "array", - "description": "An array of statuses for each record.", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique voucher code." - }, - "updated": { - "type": "boolean", - "description": "Indicates whether the record was updated." - }, - "found": { - "type": "boolean", - "description": "Indicates whether the record was found." - } - } - } - } - } - }, "17_res_obj_get_async_action_result_campaign_vouchers_import": { "title": "CAMPAIGN.VOUCHERS_IMPORT", "type": "object", @@ -39540,9 +35173,6 @@ }, "EarningRuleBase": { "title": "EarningRuleBase", - "x-stoplight": { - "id": "w4ci1ljqva0r1" - }, "type": "object", "properties": { "id": { @@ -39680,9 +35310,6 @@ }, "EarningRuleEvent": { "title": "EarningRuleEvent", - "x-stoplight": { - "id": "6vxql7fnzg2zp" - }, "type": "string", "enum": [ "order.paid", @@ -39697,9 +35324,6 @@ }, "EarningRuleFixed": { "title": "Define fixed amount of points", - "x-stoplight": { - "id": "r5o8m0sdli7fq" - }, "type": "object", "properties": { "type": { @@ -39731,9 +35355,6 @@ }, "EarningRuleProportionalOrderAmount": { "title": "Order Amount", - "x-stoplight": { - "id": "1z7lk7z1lp5af" - }, "type": "object", "properties": { "type": { @@ -39785,9 +35406,6 @@ }, "EarningRuleProportionalOrderTotalAmount": { "title": "Order Total Amount", - "x-stoplight": { - "id": "ekudxr430edgk" - }, "type": "object", "properties": { "type": { @@ -39839,9 +35457,6 @@ }, "EarningRuleProportionalOrderMetadata": { "title": "Order Metadata", - "x-stoplight": { - "id": "4ccw4gz8b47u5" - }, "type": "object", "properties": { "type": { @@ -39899,9 +35514,6 @@ }, "EarningRuleProportionalOrderItemsQuantity": { "title": "Order Items Quantity", - "x-stoplight": { - "id": "pqsn9otpzyot9" - }, "type": "object", "properties": { "type": { @@ -39968,9 +35580,6 @@ }, "EarningRuleProportionalOrderItemsAmount": { "title": "Order Items Amount", - "x-stoplight": { - "id": "8pg4o23daepkb" - }, "type": "object", "properties": { "type": { @@ -40037,9 +35646,6 @@ }, "EarningRuleProportionalOrderItemsSubtotalAmount": { "title": "Order Items Subtotal Amount", - "x-stoplight": { - "id": "duxy5qw36h5ph" - }, "type": "object", "properties": { "type": { @@ -42863,7 +38469,7 @@ }, "ExportsGetResponseBody": { "$ref": "#/components/schemas/Export", - "title": "" + "title": "Exports Get Response Body" }, "ExportsListResponseBody": { "title": "Exports List Response Body", @@ -43373,9 +38979,6 @@ }, "LoyaltiesCreateTiersRequestBody": { "title": "Loyalties Create Tiers Request Body", - "x-stoplight": { - "id": "i1emmwlaqp7lt" - }, "type": "array", "items": { "allOf": [ @@ -43396,31 +38999,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": { @@ -43445,11 +39036,50 @@ } } }, + "LoyaltiesListMemberRewardsResponseBody": { + "title": "LoyaltiesListMemberRewardsResponseBody", + "type": "object", + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ] + }, + "data_ref": { + "type": "string", + "enum": [ + "data" + ] + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "reward": { + "$ref": "#/components/schemas/Reward" + }, + "assignment": { + "$ref": "#/components/schemas/RewardAssignment" + }, + "object": { + "type": "string", + "enum": [ + "loyalty_reward" + ] + } + } + } + }, + "total": { + "type": "integer", + "minimum": 0 + } + } + }, "LoyaltiesListLoyaltyTierEarningRulesRequestQuery": { "title": "LoyaltiesListLoyaltyTierEarningRulesRequestQuery", - "x-stoplight": { - "id": "zs0z1cyyzac9u" - }, "type": "object", "properties": { "limit": { @@ -43465,16 +39095,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 +39136,6 @@ }, "LoyaltiesListMemberLoyaltyTiersResponseBody": { "title": "Loyalties List Member Loyalty Tiers Response Body", - "x-stoplight": { - "id": "s3zpgud510xl6" - }, "type": "object", "properties": { "object": { @@ -43587,9 +39208,6 @@ }, "LoyaltiesListLoyaltyTierEarningRulesResponseBody": { "title": "Loyalties List Loyalty Tier Earning Rules ResponseBody", - "x-stoplight": { - "id": "i180zbh3ffwaa" - }, "type": "object", "properties": { "object": { @@ -43627,9 +39245,6 @@ }, "LoyaltyTierBase": { "title": "Loyalty Tier Base", - "x-stoplight": { - "id": "3af9422223696" - }, "type": "object", "properties": { "name": { @@ -43787,9 +39402,6 @@ }, "MappingMultiply": { "title": "MappingMultiply", - "x-stoplight": { - "id": "7zrwgr2oqh4tj" - }, "type": "object", "properties": { "type": { @@ -43807,9 +39419,6 @@ }, "MappingFixed": { "title": "MappingFixed", - "x-stoplight": { - "id": "86eksegayxcxa" - }, "type": "object", "properties": { "type": { @@ -44496,33 +40105,6 @@ } } }, - "e_403_wrong_api_endpoint": { - "title": "Wrong API Endpoint", - "type": "object", - "description": "Error: Forbidden → Wrong API Endpoint", - "properties": { - "code": { - "type": "integer", - "default": 403, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "wrong_api_endpoint", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Wrong API endpoint", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Given project is bound to different API endpoint, you should use: https://api.voucherify.io", - "description": "A human-readable message providing more details about the error." - } - } - }, "e_404_not_found": { "description": "Error: Not Found", "type": "object", @@ -44632,37 +40214,6 @@ } } }, - "e_400_duplicate_source_id": { - "title": "Duplicate Source ID", - "type": "object", - "description": "Error: Conflict → Duplicate source_id found", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "duplicate_source_id", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Duplicate source_id", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0aa36e570e44cb3bdd", - "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}`.\",", @@ -71880,7 +67431,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_list_member_rewards" + "$ref": "#/components/schemas/LoyaltiesListMemberRewardsResponseBody" }, "examples": { "Example": { From dfc2e13b76e4dfe48b2abe1053da556bb933ffbe Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:11:27 +0200 Subject: [PATCH 068/108] fix path for vouchers --- reference/OpenAPI.json | 2288 ++++++++++++++++++++-------------------- 1 file changed, 1143 insertions(+), 1145 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 5df63f4b4..39433b3c3 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -40665,28 +40665,14 @@ } } } - } - }, - "/v1/vouchers/{code}": { - "parameters": [ - { - "schema": { - "type": "string", - "example": "7fjWdr" - }, - "in": "path", - "name": "code", - "description": "A unique **code** that identifies the voucher.", - "required": true - } - ], - "get": { - "operationId": "get-voucher", + }, + "post": { + "operationId": "generate-random-code", "tags": [ "VOUCHERS API" ], - "summary": "Get Voucher", - "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", + "summary": "Generate Random Code", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", "parameters": [], "security": [ { @@ -40694,433 +40680,546 @@ "X-App-Token-1": [] } ], + "requestBody": { + "description": "Specify the details of the voucher that you would like to create.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_req_vouchers__POST" + }, + "examples": { + "Percentage Discount": { + "value": { + "category": "New Customers", + "code": "NEW-WELCOME-COUPON", + "type": "DISCOUNT_VOUCHER", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "discount": { + "percent_off": 10, + "type": "PERCENT", + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2016-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 10 + }, + "metadata": { + "test": true, + "locale": "de-en" + }, + "validation_rules": [ + "val_4j7DCRm2IS59" + ] + } + }, + "Gift Card": { + "value": { + "category": "New Customers", + "type": "GIFT_VOUCHER", + "gift": { + "amount": 10000, + "effect": "APPLY_TO_ORDER" + }, + "start_date": "2022-01-01T00:00:00Z", + "active": true, + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "code_config": { + "pattern": "GIFT-CARD-##########", + "prefix": "New-", + "postfix": "0", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + } + } + }, + "Loyalty Card": { + "value": { + "category": "New Customers", + "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "type": "LOYALTY_CARD", + "loyalty_card": { + "points": 10000 + }, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "code_config": { + "pattern": "LOYALTY-CARD-##", + "prefix": "New-", + "postfix": "1", + "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + } + } + }, + "Unit Discount Multiple Items": { + "value": { + "category": "New Customers", + "code": "MultipleUnitTypesUnitDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] + }, + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 5 + }, + "metadata": { + "test": true, + "locale": "de-en" + } + } + }, + "Unit Discount Single Item": { + "value": { + "category": "New Customers", + "code": "AddMissingItemDiscount", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "UNIT", + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + "start_date": "2020-01-01T00:00:00Z", + "expiration_date": "2022-12-31T23:59:59Z", + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "redemption": { + "quantity": 3 + } + } + } + } + } + } + }, "responses": { "200": { - "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", + "description": "Returns a voucher object if the call succeeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/1_obj_voucher_object" }, "examples": { - "Loyalty Card": { + "Percentage Discount": { "value": { - "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", - "code": "LOYALTY-CARD-xLPbpbXR", - "campaign": "Loyalty Program Fall 2022", - "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "LOYALTY_CARD", - "discount": null, + "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "code": "NEW-WELCOME-COUPON", + "campaign": "Bug fix", + "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "category": "New Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 10, + "effect": "APPLY_TO_ORDER" + }, "gift": null, - "loyalty_card": { - "points": 110, - "balance": 100, - "next_expiration_date": "2023-12-31", - "next_expiration_points": 100 + "loyalty_card": null, + "start_date": "2016-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" }, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" + "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" }, "barcode": { - "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" + "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" } }, "is_referral_code": false, - "created_at": "2022-09-19T07:56:22.355Z", - "updated_at": "2022-09-19T08:04:22.458Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", + "created_at": "2022-02-17T07:14:40.096Z", + "updated_at": null, "validation_rules_assignments": { "object": "list", "data_ref": "data", - "data": [], - "total": 0 + "data": [ + { + "id": "asgm_COu5PJAsWmAwuCqR", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "related_object_type": "voucher", + "created_at": "2022-02-17T07:14:40.280Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 }, "redemption": { - "quantity": null, - "redeemed_quantity": 1, - "redeemed_points": 10, + "quantity": 10, + "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" + "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" }, "publish": { "object": "list", - "count": 1, - "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" + "count": 0, + "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" }, "object": "voucher" } }, - "Gift Card": { + "Gift Voucher": { "value": { - "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", - "code": "GIFT-CARD-xwc6X7Tk", - "campaign": "Gift Cards", - "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", - "category": null, - "category_id": null, + "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", + "code": "New-GIFT-CARD-8tqB6FcyhE0", + "campaign": null, + "campaign_id": null, + "category": "New Customers", "type": "GIFT_VOUCHER", "discount": null, "gift": { - "amount": 55000, - "balance": 44700, + "amount": 10000, + "balance": 10000, "effect": "APPLY_TO_ORDER" }, "loyalty_card": null, - "start_date": null, + "start_date": "2022-01-01T00:00:00.000Z", "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, "active": true, - "additional_info": null, - "metadata": {}, - "assets": { - "qr": { - "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" - }, - "barcode": { - "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" - } - }, - "is_referral_code": false, - "created_at": "2022-07-08T09:44:33.179Z", - "updated_at": "2022-08-29T09:37:20.185Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, - "redemption": { - "quantity": null, - "redeemed_quantity": 7, - "redeemed_amount": 10300, - "object": "list", - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" - }, - "publish": { - "object": "list", - "count": 1, - "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" - }, - "object": "voucher" - } - }, - "Amount Discount": { - "value": { - "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "code": "AMOUNTDISCOUNTUSINGFORMULA", - "campaign": null, - "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "AMOUNT", - "amount_off": 400, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" + "additional_info": "This gift card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" }, - "gift": null, - "loyalty_card": null, - "start_date": "2022-09-01T00:00:00.000Z", - "expiration_date": "2022-10-31T00:00:00.000Z", - "validity_timeframe": null, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", - "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" + "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" }, "barcode": { - "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" + "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" } }, "is_referral_code": false, - "created_at": "2022-09-12T07:51:02.145Z", - "updated_at": "2022-09-19T08:29:12.566Z", - "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_tO5AuzXIkkNPTC50", - "rule_id": "val_5h0wc453_2", - "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", - "related_object_type": "voucher", - "created_at": "2022-09-19T08:27:59.160Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, + "created_at": "2022-02-17T07:49:10.834Z", + "updated_at": null, "redemption": { "quantity": null, - "redeemed_quantity": 2, + "redeemed_quantity": 0, + "redeemed_amount": 0, "object": "list", - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" }, "publish": { "object": "list", - "count": 1, - "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" + "count": 0, + "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" }, "object": "voucher" } }, - "Percent Discount": { + "Loyalty Card": { "value": { - "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "code": "PercentDiscountUsingFormula", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 3, - "percent_off_formula": "CUSTOMER_METADATA(\"age\")", - "effect": "APPLY_TO_ITEMS" - }, + "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", + "code": "New-LOYALTY-CARD-UC1", + "campaign": "Loyalty Campaign", + "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", + "category": "New Customers", + "type": "LOYALTY_CARD", + "discount": null, "gift": null, - "loyalty_card": null, + "loyalty_card": { + "points": 10000, + "balance": 10000 + }, "start_date": null, "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, "active": true, - "additional_info": null, - "metadata": {}, + "additional_info": "This loyalty card is enabled immediately upon creation.", + "metadata": { + "test": true, + "locale": "de-en" + }, "assets": { "qr": { - "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" + "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" }, "barcode": { - "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" + "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" } }, "is_referral_code": false, - "created_at": "2022-09-15T10:20:46.467Z", - "updated_at": "2022-09-15T10:43:51.116Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [ - { - "id": "asgm_EuYasM5fyDR9G2r4", - "rule_id": "val_0k19OQHjNZRT", - "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", - "related_object_type": "voucher", - "created_at": "2022-09-15T10:20:46.460Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 - }, + "created_at": "2022-02-17T08:06:41.091Z", + "updated_at": null, "redemption": { "quantity": null, - "redeemed_quantity": 3, + "redeemed_quantity": 0, + "redeemed_points": 0, "object": "list", - "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" + "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" }, "object": "voucher" } }, - "Fixed Discount": { + "Unit Discount Multiple Items": { "value": { - "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", - "code": "FixedDiscountUsingFormula", + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, + "campaign_id": null, + "category": "New Customers", "type": "DISCOUNT_VOUCHER", "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ORDER", - "fixed_amount": 200, - "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 1, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_NEW_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] }, "gift": null, "loyalty_card": null, - "start_date": null, - "expiration_date": null, - "validity_timeframe": null, - "validity_day_of_week": null, - "active": true, - "additional_info": null, - "metadata": {}, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, "assets": { "qr": { - "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" }, "barcode": { - "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" } }, "is_referral_code": false, - "created_at": "2022-09-15T12:46:55.818Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": null, "redemption": { - "quantity": null, - "redeemed_quantity": 5, + "quantity": 5, + "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" }, "object": "voucher" } }, - "Unit Discount": { + "Unit Discount Single Item": { "value": { - "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", - "code": "UnitDiscountUsingFormula", + "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", + "code": "AddMissingItemDiscount", "campaign": null, "campaign_id": null, - "category": null, - "category_id": null, + "category": "New Customers", "type": "DISCOUNT_VOUCHER", "discount": { "type": "UNIT", "unit_off": 1, - "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", - "unit_type": "sku_0b661e41eccd35a8e9", + "unit_type": "prod_0a9f9ab4ab019a42d5", "effect": "ADD_MISSING_ITEMS" }, "gift": null, "loyalty_card": null, - "start_date": null, - "expiration_date": null, + "start_date": "2020-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", "validity_timeframe": null, "validity_day_of_week": null, - "active": true, - "additional_info": null, + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" + "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" }, "barcode": { - "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" + "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" } }, "is_referral_code": false, - "created_at": "2022-09-15T13:36:27.838Z", - "updated_at": "2022-09-16T10:03:25.057Z", - "validation_rules_assignments": { - "object": "list", - "data_ref": "data", - "data": [], - "total": 0 - }, + "created_at": "2022-02-18T06:46:44.536Z", + "updated_at": null, "redemption": { - "quantity": null, - "redeemed_quantity": 5, + "quantity": 3, + "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" + "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" + "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" }, "object": "voucher" } - }, - "Multiple Unit Discount": { + } + } + } + } + } + } + } + }, + "/v1/vouchers/{code}": { + "parameters": [ + { + "schema": { + "type": "string", + "example": "7fjWdr" + }, + "in": "path", + "name": "code", + "description": "A unique **code** that identifies the voucher.", + "required": true + } + ], + "get": { + "operationId": "get-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Get Voucher", + "description": "Retrieves the voucher with the given `code` or unique Voucherify ID. You can either pass the voucher ID which was assigned by Voucherify, e.g., `v_7HxHkf4VAkMuc8u4lZs78lyRwhRze5UE`, or the `code` of the voucher as the path parameter value, e.g., `7fjWdr`.", + "parameters": [], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "200": { + "description": "Returns a voucher object if a valid identifier was provided. \n\nAdditionally, the response returns validation rules related to the voucher object. They can be inherited from a campaign.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/1_obj_voucher_object" + }, + "examples": { + "Loyalty Card": { "value": { - "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", - "code": "UnitDiscountUsingFormulaForMultipleProductVariants", - "campaign": null, - "campaign_id": null, - "category": null, - "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 3, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "unit_type": "sku_0b661e41fc8d35a8f7", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 4, - "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", - "unit_type": "sku_0b661e41fc8d35a8f6", - "effect": "ADD_NEW_ITEMS" - } - ] - }, + "id": "v_hrMBBeT4sOP9VSGPmj5KAgJwX202UjiY", + "code": "LOYALTY-CARD-xLPbpbXR", + "campaign": "Loyalty Program Fall 2022", + "campaign_id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], + "type": "LOYALTY_CARD", + "discount": null, "gift": null, - "loyalty_card": null, + "loyalty_card": { + "points": 110, + "balance": 100, + "next_expiration_date": "2023-12-31", + "next_expiration_points": 100 + }, "start_date": null, "expiration_date": null, "validity_timeframe": null, @@ -41130,17 +41229,18 @@ "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" + "id": "U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8/6I6hUEqtz/F6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD/DjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19OrTPNyUztbNretF7tPRL4ZlUDPAUXVGL9e5UCPh6dic8zXEP8%2F6I6hUEqtz%2FF6IMIghWz1ljdjzpdizGHG3HZBw4c19fd8SD%2FDjhBRDSr8APqKGpZTLKe4QC2gislFTeDAq2lmJb6T1oOTBUGkUEwMgEX1Vlco9A%3D" }, "barcode": { - "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" + "id": "U2FsdGVkX1/SpYuOrU9wd6/o1wzy6E/04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ/FJtiw69djuzQk1f4HdQo8s5gaZ7fd2U+1zbaeAvi9usyvRHZE4=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FSpYuOrU9wd6%2Fo1wzy6E%2F04wURHJ1xuMutzkIUx6OBTmHX5BO8XZRmEFHkgjC5eWJ27ArgAruJfwRXWuQfTNFD4raI9YvIiQNEzsZ0ydxwKBqJ%2FFJtiw69djuzQk1f4HdQo8s5gaZ7fd2U%2B1zbaeAvi9usyvRHZE4%3D" } }, "is_referral_code": false, - "created_at": "2022-09-16T05:44:50.722Z", - "updated_at": "2022-09-19T09:25:17.303Z", + "created_at": "2022-09-19T07:56:22.355Z", + "updated_at": "2022-09-19T08:04:22.458Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", "validation_rules_assignments": { "object": "list", "data_ref": "data", @@ -41149,34 +41249,34 @@ }, "redemption": { "quantity": null, - "redeemed_quantity": 3, + "redeemed_quantity": 1, + "redeemed_points": 10, "object": "list", - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/redemptions?page=1&limit=10" }, "publish": { "object": "list", - "count": 0, - "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" + "count": 1, + "url": "/v1/vouchers/LOYALTY-CARD-xLPbpbXR/publications?page=1&limit=10" }, "object": "voucher" } }, - "Free Shipping": { + "Gift Card": { "value": { - "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", - "code": "FreeShipping", - "campaign": null, - "campaign_id": null, + "id": "v_hS8JFl8S6lNcd1L69wLIoXgTio7eWEgk", + "code": "GIFT-CARD-xwc6X7Tk", + "campaign": "Gift Cards", + "campaign_id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe", "category": null, "category_id": null, - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_5h1pp1ng", - "effect": "ADD_MISSING_ITEMS" + "type": "GIFT_VOUCHER", + "discount": null, + "gift": { + "amount": 55000, + "balance": 44700, + "effect": "APPLY_TO_ORDER" }, - "gift": null, "loyalty_card": null, "start_date": null, "expiration_date": null, @@ -41187,17 +41287,18 @@ "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" + "id": "U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM/aTyHCYfr7kRWb2vv08WIgY/Tv53SJGW+k2keqfsTq/Ohb5shkCN3FTFsaI8gulTp616sEGn/JJoIInIoNkO9Vd1+AfrKiAjmirCmekE6cz2SVCyNAXs=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19SdT2kQZokSFsMRa5NmGvsHunHReeb4gF9b5LtLA4rCTM%2FaTyHCYfr7kRWb2vv08WIgY%2FTv53SJGW%2Bk2keqfsTq%2FOhb5shkCN3FTFsaI8gulTp616sEGn%2FJJoIInIoNkO9Vd1%2BAfrKiAjmirCmekE6cz2SVCyNAXs%3D" }, "barcode": { - "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" + "id": "U2FsdGVkX18vWc/qplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO/199U+zicnFNWqg/jF5ZCQW+6jO1q8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18vWc%2FqplwajJz4RIIy2wDUcAXVo1KEmyXx2IJy44xxHg608po3RizU9OYOzKelOAEjXFf7E4BS5Q01s4dds8Du70LGAp3idYMKAaXIjMTcFjMNczNO6ULK7r4eDx2Np8jvO%2F199U%2BzicnFNWqg%2FjF5ZCQW%2B6jO1q8%3D" } }, "is_referral_code": false, - "created_at": "2022-09-16T07:19:53.945Z", - "updated_at": "2022-09-16T07:26:35.361Z", + "created_at": "2022-07-08T09:44:33.179Z", + "updated_at": "2022-08-29T09:37:20.185Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", "validation_rules_assignments": { "object": "list", "data_ref": "data", @@ -41206,356 +41307,204 @@ }, "redemption": { "quantity": null, - "redeemed_quantity": 2, + "redeemed_quantity": 7, + "redeemed_amount": 10300, "object": "list", - "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/redemptions?page=1&limit=10" }, "publish": { "object": "list", - "count": 0, - "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" + "count": 1, + "url": "/v1/vouchers/GIFT-CARD-xwc6X7Tk/publications?page=1&limit=10" }, "object": "voucher" } - } - } - } - } - }, - "404": { - "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_404_not_found" - }, - "examples": { - "Not Found": { - "value": { - "code": 404, - "key": "not_found", - "message": "Resource not found", - "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "request_id": "v-0bb3403b9a158c87b2", - "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", - "resource_type": "voucher" - } - } - } - } - } - } - } - }, - "put": { - "operationId": "update-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Update Voucher", - "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", - "parameters": [], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "requestBody": { - "required": true, - "description": "Specify the parameters to be updated.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_PUT" - }, - "examples": { - "Percent Discount": { - "value": { - "category": "Second", - "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "PERCENT", - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", - "amount_limit": 1800, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-02-01T00:00:00Z", - "expiration_date": "2023-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT2H", - "interval": "P3D" - }, - "validity_day_of_week": [ - 0, - 1, - 2 - ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" - } - } - }, - "Gift Card": { - "value": { - "category": "Existing Customers", - "gift": { - "amount": 20000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z", - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" - } - } - }, - "Loyalty Card": { - "value": { - "category": "Existing Customers", - "loyalty_card": { - "points": 20000 - }, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" - } - } - }, - "Amount Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "amount_off": 2000, - "type": "AMOUNT", - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } - }, - "Fixed Discount": { - "value": { - "category": "Existing Customers", - "discount": { - "type": "FIXED", - "fixed_amount": 2000, - "effect": "APPLY_TO_ITEMS" - }, - "start_date": "2021-01-01T00:00:00Z" - } - }, - "Unit Discount": { - "value": { - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] - } - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Returns the voucher object if the update succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/1_obj_voucher_object" - }, - "examples": { - "Percent Discount": { + }, + "Amount Discount": { "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", + "id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "code": "AMOUNTDISCOUNTUSINGFORMULA", "campaign": null, "campaign_id": null, - "category": "Second", - "category_id": "cat_0bb81a481615a37b5e", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", "categories": [ { - "id": "cat_0bb81a481615a37b5e", - "name": "Second", - "hierarchy": 2, - "created_at": "2022-09-20T05:58:01.561Z", + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", "object": "category" } ], "type": "DISCOUNT_VOUCHER", "discount": { - "type": "PERCENT", - "amount_limit": 1800, - "percent_off": 45, - "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "type": "AMOUNT", + "amount_off": 400, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", "effect": "APPLY_TO_ORDER" }, "gift": null, "loyalty_card": null, - "start_date": "2020-02-01T00:00:00.000Z", - "expiration_date": "2023-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P3D", - "duration": "PT2H" - }, + "start_date": "2022-09-01T00:00:00.000Z", + "expiration_date": "2022-10-31T00:00:00.000Z", + "validity_timeframe": null, "validity_day_of_week": [ - 0, 1, - 2 + 2, + 3, + 4, + 5 ], - "active": false, - "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", - "metadata": { - "Season": "Winter" - }, + "active": true, + "additional_info": "This voucher discount is based on a formula, payment must be using VISA, and order must be over $100.", + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + "id": "U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy+aA==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18tV6jdzxWPwEzjeiX4DoM06JpwaoKUNGMNx4Td5e8FwA68uIHQwPaRpJr9CUCpiP4IsSD8nEJn1YtEv6FnY83wIv7uljYoQOYmMPyhKec8Ct3zH7KurMGuj4Fhws3HNA3bqP5MYEy%2BaA%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + "id": "U2FsdGVkX181+WljOgxIt9Jg1Urbuv226+8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo+4FH3Ey8G2YXCPM6nUhZRSMF5oL3+uNjcLtBvb7MF5+ynY5fIgpXolwUK0R/BuT4Pa8prhgTg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX181%2BWljOgxIt9Jg1Urbuv226%2B8Ug0DIyZiI0WtThPNYKZZEodzqQpIsGSdrDGXr2chLo%2B4FH3Ey8G2YXCPM6nUhZRSMF5oL3%2BuNjcLtBvb7MF5%2BynY5fIgpXolwUK0R%2FBuT4Pa8prhgTg%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": "2022-09-20T06:00:50.202Z", + "created_at": "2022-09-12T07:51:02.145Z", + "updated_at": "2022-09-19T08:29:12.566Z", + "holder_id": "cust_eWgXlBBiY6THFRJwX45Iakv4", "validation_rules_assignments": { "object": "list", "data_ref": "data", - "data": [], - "total": 0 + "data": [ + { + "id": "asgm_tO5AuzXIkkNPTC50", + "rule_id": "val_5h0wc453_2", + "related_object_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2bn", + "related_object_type": "voucher", + "created_at": "2022-09-19T08:27:59.160Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 }, "redemption": { - "quantity": 101, - "redeemed_quantity": 0, + "quantity": null, + "redeemed_quantity": 2, "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/redemptions?page=1&limit=10" }, "publish": { "object": "list", - "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + "count": 1, + "url": "/v1/vouchers/AMOUNTDISCOUNTUSINGFORMULA/publications?page=1&limit=10" }, "object": "voucher" } }, - "Gift Card": { + "Percent Discount": { "value": { - "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", - "code": "welcomegiftcard", + "id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "code": "PercentDiscountUsingFormula", "campaign": null, "campaign_id": null, - "category": "Existing Customers", - "type": "GIFT_VOUCHER", - "discount": null, - "gift": { - "amount": 20000, - "balance": 20000, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "PERCENT", + "percent_off": 3, + "percent_off_formula": "CUSTOMER_METADATA(\"age\")", "effect": "APPLY_TO_ITEMS" }, + "gift": null, "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", + "start_date": null, "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, - "active": false, - "additional_info": "This gift card is disabled.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, + "active": true, + "additional_info": null, + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" + "id": "U2FsdGVkX1+74dNbbuHNdVR+5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr+j8ayuFU7+BtCdNe25YRae4Mp+3Y1HsrkVudshKRzMBdS/43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM/VDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa/aQ==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B74dNbbuHNdVR%2B5SXVrdo6Zp2tUInlseZtheoYEvrayBBDEoJFaeDuC1BzQr%2Bj8ayuFU7%2BBtCdNe25YRae4Mp%2B3Y1HsrkVudshKRzMBdS%2F43GT9Qi6tOXQDsYjHh70zNz13lMOC9bnaX6WZCVU0vRWM%2FVDXbYNxGZH6V1wpcGOkmkhkEYPSuIXBDF65FsgHOAwIPvKBxa%2FaQ%3D%3D" }, "barcode": { - "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" + "id": "U2FsdGVkX19t8/dJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB+p0gzGM0tyXa/npbPUTe0Y5Y/arDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy/20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19t8%2FdJWDNnnwPtxt3e0kZTDAELYiQcSHWIEO5wr6uLeDbM2KKbGYUfkKKtZRsWtiKhOQQc7zmNoCqR82UB%2Bp0gzGM0tyXa%2FnpbPUTe0Y5Y%2FarDPnomb9AaUFjK9Uq5OUBYbxi1ERqEhy%2F20Owr0m0e0E2I3jQmgAxkNokRm1g31zX4zheea8gTtiFwb6ZrYvGbaOhj5IxYWg%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T09:09:49.665Z", - "updated_at": "2022-02-17T11:11:48.071Z", + "created_at": "2022-09-15T10:20:46.467Z", + "updated_at": "2022-09-15T10:43:51.116Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", - "data": [], - "total": 0 + "data": [ + { + "id": "asgm_EuYasM5fyDR9G2r4", + "rule_id": "val_0k19OQHjNZRT", + "related_object_id": "v_2LcXRN4X0TNNgPoBceXIsE4LYs13kta1", + "related_object_type": "voucher", + "created_at": "2022-09-15T10:20:46.460Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 }, "redemption": { "quantity": null, - "redeemed_quantity": 0, - "redeemed_amount": 0, + "redeemed_quantity": 3, "object": "list", - "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" + "url": "/v1/vouchers/PercentDiscountUsingFormula/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" + "url": "/v1/vouchers/PercentDiscountUsingFormula/publications?page=1&limit=10" }, "object": "voucher" } }, - "Loyalty Card": { + "Fixed Discount": { "value": { - "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", - "code": "welcomeloyalty", - "campaign": "Loyalty Campaign", - "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "Existing Customers", - "type": "LOYALTY_CARD", - "discount": null, - "gift": null, - "loyalty_card": { - "points": 20000, - "balance": 20000 + "id": "v_zXQtyi5FYQYoRXv459hmK8M5Gi2lLoDl", + "code": "FixedDiscountUsingFormula", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "FIXED", + "effect": "APPLY_TO_ORDER", + "fixed_amount": 200, + "fixed_amount_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - 2)" }, + "gift": null, + "loyalty_card": null, "start_date": null, "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, - "active": false, - "additional_info": "This loyalty card is being deactivated and points updated.", - "metadata": { - "test": false, - "locale": "de-en-pl" - }, + "active": true, + "additional_info": null, + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" + "id": "U2FsdGVkX1+sY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72/hyyDUi8DflzcYixFdXTOR3o1rcaPoY=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BsY8iWRFMrrPOjY6pS7JZSqJUPIzAgFO5oy5GvTj27KrukNxucE4wrA4n9QL7pua3CfJzGWe0Hc5J6XXU2m5ktik4iUNRO6pxZmL4ZuR96C1XHJAGaIiI7lM17OjJD2b72%2FhyyDUi8DflzcYixFdXTOR3o1rcaPoY%3D" }, "barcode": { - "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" + "id": "U2FsdGVkX1+af+iouhzUVUL0IocB7BAWR8rB0z8/9/OgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE/CYTR/S135KZ6GIfCS/+VQNrzbS/bFXgY=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2Baf%2BiouhzUVUL0IocB7BAWR8rB0z8%2F9%2FOgYi32EHQ9salEEtE3XYPWtseOAxi5keMRp6K3JLDyx4RvYpw3Fe5SN0ed7PEcWr4fLUoUBntHtH0lOPFOtWxpY3tAjnyWpE%2FCYTR%2FS135KZ6GIfCS%2F%2BVQNrzbS%2FbFXgY%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": "2022-02-17T11:20:12.447Z", + "created_at": "2022-09-15T12:46:55.818Z", + "updated_at": "2022-09-16T10:03:25.057Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", @@ -41564,111 +41513,106 @@ }, "redemption": { "quantity": null, - "redeemed_quantity": 0, - "redeemed_points": 0, + "redeemed_quantity": 5, "object": "list", - "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" + "url": "/v1/vouchers/FixedDiscountUsingFormula/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" + "url": "/v1/vouchers/FixedDiscountUsingFormula/publications?page=1&limit=10" }, "object": "voucher" } }, - "Amount Discount": { + "Unit Discount": { "value": { - "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "code": "WelcomeDiscountAmount", + "id": "v_JkjV4v9OKTsaIuHoqXGrkGijNaRGYNzm", + "code": "UnitDiscountUsingFormula", "campaign": null, "campaign_id": null, - "category": "Existing Customers", + "category": null, + "category_id": null, "type": "DISCOUNT_VOUCHER", "discount": { - "type": "AMOUNT", - "amount_off": 2000, - "effect": "APPLY_TO_ITEMS" + "type": "UNIT", + "unit_off": 1, + "unit_off_formula": "IF(ORDER_UNITS_QUANTITY > 3;CUSTOMER_METADATA(\"age\") / 5;CUSTOMER_METADATA(\"age\") / 10)", + "unit_type": "sku_0b661e41eccd35a8e9", + "effect": "ADD_MISSING_ITEMS" }, "gift": null, "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" + "id": "U2FsdGVkX1+6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z/lehzciL0vdtutoiMVf8Nzl+B278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V+b89EAmbMouLlaDvkD63bZI=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6okuUQBKDcu0jGGg0jOU3kwYUFhX79TdwYKjXyV14BX74z%2FlehzciL0vdtutoiMVf8Nzl%2BB278gSHI5TiecPsTXChbGKSjH9gYUxZkdQev0qfmR4frKHjKKHHfT9DEcRWCLwKDJ9V%2Bb89EAmbMouLlaDvkD63bZI%3D" }, "barcode": { - "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" + "id": "U2FsdGVkX19E7POETWB9YO+S4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs/2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz+Ka/vTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr/ciSN8=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19E7POETWB9YO%2BS4gkbGFQSm4VDNXEvqdlln6cWiyWTplnWkiUbs%2F2XMIva3q2rHDFP4toeKrLOGeS5mqhJcdd3yVsWXjHaALwCJIis2D4l5soDvz%2BKa%2FvTqJdFWQzqsIl0BqEpr1tLLy8JFMGN7MY5nY3nr%2FciSN8%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T11:41:05.236Z", - "updated_at": "2022-02-17T11:45:29.269Z", + "created_at": "2022-09-15T13:36:27.838Z", + "updated_at": "2022-09-16T10:03:25.057Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", - "data": [ - { - "id": "asgm_tDN7MJNayjrf1wyn", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", - "related_object_type": "voucher", - "created_at": "2022-02-17T11:41:05.210Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 + "data": [], + "total": 0 }, "redemption": { - "quantity": 10, - "redeemed_quantity": 0, + "quantity": null, + "redeemed_quantity": 5, "object": "list", - "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" + "url": "/v1/vouchers/UnitDiscountUsingFormula/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" + "url": "/v1/vouchers/UnitDiscountUsingFormula/publications?page=1&limit=10" }, "object": "voucher" } }, - "Fixed Discount": { + "Multiple Unit Discount": { "value": { - "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", - "code": "wou4w1Og", - "campaign": "Fixed", - "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", - "category": "Existing Customers", + "id": "v_5Xgi5ht4sw432LQ7bwmyjKnUAYtOrJAh", + "code": "UnitDiscountUsingFormulaForMultipleProductVariants", + "campaign": null, + "campaign_id": null, + "category": null, + "category_id": null, "type": "DISCOUNT_VOUCHER", "discount": { - "type": "FIXED", - "effect": "APPLY_TO_ITEMS", - "fixed_amount": 2000 + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 3, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "unit_type": "sku_0b661e41fc8d35a8f7", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 4, + "unit_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\") + 2;CUSTOMER_METADATA(\"age\") - -2)", + "unit_type": "sku_0b661e41fc8d35a8f6", + "effect": "ADD_NEW_ITEMS" + } + ] }, "gift": null, "loyalty_card": null, - "start_date": "2021-01-01T00:00:00.000Z", + "start_date": null, "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, @@ -41677,17 +41621,17 @@ "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" + "id": "U2FsdGVkX1+qkwm+Yu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy+D3yav5GmF2UrY6PD6fS9Y+yu+7yTVQu+agFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux+4Lp8aVdalItCVCEH25DxWD+HUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bqkwm%2BYu29uhfotQxirJftPuWjA1P9WGxHqqmOHsU9esf6R5Ln7AeiqX8l9iIpy%2BD3yav5GmF2UrY6PD6fS9Y%2Byu%2B7yTVQu%2BagFZqdN1jvWw4DBOCHKPgynaMiNS29Cv4EIOFCY9Ux%2B4Lp8aVdalItCVCEH25DxWD%2BHUKq1lE31Y0DfWssg95oO2m73ZeGa8je7zd09eW7cg%3D%3D" }, - "barcode": { - "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" + "barcode": { + "id": "U2FsdGVkX1+poCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV/QLqc387xUUckr0fvmhTBCarpsB+dWPOwlaNuVivTVB+Yyh/1FcbGbjvbj1Sm12wVNom2KZ3m1K/lJ6vBoGkXqq0jutytA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BpoCeZMw207p8HWtpoeokpaPfUQQoRIxpGXmqi5ic2ZPhQwKrUnujPDW4Sw1ODgHV6nLWQQQ9g7j3S4793YfzHDi1H8L3kZroH0TwWFNBgzQkV%2FQLqc387xUUckr0fvmhTBCarpsB%2BdWPOwlaNuVivTVB%2BYyh%2F1FcbGbjvbj1Sm12wVNom2KZ3m1K%2FlJ6vBoGkXqq0jutytA%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T11:54:37.766Z", - "updated_at": "2022-02-17T12:04:53.346Z", + "created_at": "2022-09-16T05:44:50.722Z", + "updated_at": "2022-09-19T09:25:17.303Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", @@ -41695,77 +41639,56 @@ "total": 0 }, "redemption": { - "quantity": 1, - "redeemed_quantity": 0, + "quantity": null, + "redeemed_quantity": 3, "object": "list", - "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" + "url": "/v1/vouchers/UnitDiscountUsingFormulaForMultipleProductVariants/publications?page=1&limit=10" }, "object": "voucher" } }, - "Unit Discount": { + "Free Shipping": { "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", + "id": "v_gO13ON60WqVmP1DASWuJRF83Xt5KrVNL", + "code": "FreeShipping", "campaign": null, "campaign_id": null, - "category": "New Customers", + "category": null, + "category_id": null, "type": "DISCOUNT_VOUCHER", "discount": { "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 2, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] + "unit_off": 1, + "unit_type": "prod_5h1pp1ng", + "effect": "ADD_MISSING_ITEMS" }, "gift": null, "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": { - "test": true, - "locale": "de-en" - }, + "start_date": null, + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, + "active": true, + "additional_info": null, + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + "id": "U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq+S3gexrVR8PxHgEz/jR1Hh2YfM5h0k5CYPD24I/pXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A=", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19R0AaZSL8eog8GYSGvRcADkJ24Hhr52Awb2KNF11CE7oyTHVBq%2BS3gexrVR8PxHgEz%2FjR1Hh2YfM5h0k5CYPD24I%2FpXJYQVTa1CpXFBrrxVET9QyK48z5hxu2nsHHBsV7g0zK1nIVibsw06db8x1F1zaR7Un9oq6A%3D" }, "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + "id": "U2FsdGVkX19XHGrCUHCfcSz/VLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU+McRx9iEB/DqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0=", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19XHGrCUHCfcSz%2FVLWmN1UU13QmDsH9ezEYtzHAUAeaLvN12Yv5eBJ7h7R2Og2pNm7mdHxfMR8gBJWEgHuBkodwXch1llhO6hNy9KXebNU%2BMcRx9iEB%2FDqSzagjaxCiUNB1xitLgXDlUH5cH9naOCOtCHGMrEQW4h0%3D" } }, "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", - "updated_at": "2022-02-18T06:31:08.630Z", + "created_at": "2022-09-16T07:19:53.945Z", + "updated_at": "2022-09-16T07:26:35.361Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", @@ -41773,15 +41696,15 @@ "total": 0 }, "redemption": { - "quantity": 5, - "redeemed_quantity": 0, + "quantity": null, + "redeemed_quantity": 2, "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + "url": "/v1/vouchers/FreeShipping/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + "url": "/v1/vouchers/FreeShipping/publications?page=1&limit=10" }, "object": "voucher" } @@ -41790,72 +41713,22 @@ } } }, - "400": { - "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/e_error_no_translation" - }, - "examples": { - "Invalid Voucher": { - "value": { - "code": 400, - "key": "invalid_voucher", - "message": "Invalid Voucher", - "details": "It is not possible to change Voucher discount type", - "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "delete-voucher", - "tags": [ - "VOUCHERS API" - ], - "summary": "Delete Voucher", - "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", - "parameters": [ - { - "schema": { - "type": "string" - }, - "in": "query", - "name": "force", - "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." - } - ], - "security": [ - { - "X-App-Id-1": [], - "X-App-Token-1": [] - } - ], - "responses": { - "204": { - "description": "Returns no content if deletion is successful." - }, "404": { - "description": "Returns an error indicating that the voucher with given ID was not found.", + "description": "Returns an error when requesting the code of a voucher that has been deleted or does not exist.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/e_404_not_found" }, "examples": { - "Voucher Not Found": { + "Not Found": { "value": { "code": 404, "key": "not_found", "message": "Resource not found", - "details": "Cannot find voucher with id 10OFF", - "request_id": "v-0ae28d3cec96bb1b7e", - "resource_id": "10OFF", + "details": "Cannot find voucher with id v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", + "request_id": "v-0bb3403b9a158c87b2", + "resource_id": "v_OBVfpTVf24DBz0HZmKVZa5UEl1DUg2b", "resource_type": "voucher" } } @@ -41865,13 +41738,13 @@ } } }, - "post": { - "operationId": "create-voucher", + "put": { + "operationId": "update-voucher", "tags": [ "VOUCHERS API" ], - "summary": "Create Voucher", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", + "summary": "Update Voucher", + "description": "Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.\n\nFields other than the ones listed in the request body won't be modified. Even if provided, they will be silently skipped.", "parameters": [], "security": [ { @@ -41880,142 +41753,112 @@ } ], "requestBody": { - "description": "Specify the details of the voucher that you would like to create.", + "required": true, + "description": "Specify the parameters to be updated.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/1_req_vouchers_code_POST" + "$ref": "#/components/schemas/1_req_vouchers_code_PUT" }, "examples": { - "Percentage Discount": { + "Percent Discount": { "value": { - "category": "New Customers", + "category": "Second", "type": "DISCOUNT_VOUCHER", "discount": { - "percent_off": 10, "type": "PERCENT", + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", + "amount_limit": 1800, "effect": "APPLY_TO_ORDER" }, - "start_date": "2022-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", + "start_date": "2020-02-01T00:00:00Z", + "expiration_date": "2023-12-31T23:59:59Z", "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" + "duration": "PT2H", + "interval": "P3D" }, "validity_day_of_week": [ + 0, 1, - 2, - 3, - 4, - 5 + 2 ], "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "redemption": { - "quantity": 10 - }, + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", "metadata": { - "test": true, - "locale": "de-en" - }, - "validation_rules": [ - "val_4j7DCRm2IS59" - ] + "Season": "Winter" + } } }, "Gift Card": { "value": { - "category": "New Customers", - "type": "GIFT_VOUCHER", + "category": "Existing Customers", "gift": { - "amount": 10000, - "effect": "APPLY_TO_ORDER" + "amount": 20000, + "effect": "APPLY_TO_ITEMS" }, - "start_date": "2022-01-01T00:00:00Z", - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", + "start_date": "2021-01-01T00:00:00Z", + "active": false, + "additional_info": "This gift card is disabled.", "metadata": { - "test": true, - "locale": "de-en" + "test": false, + "locale": "de-en-pl" } } }, "Loyalty Card": { "value": { - "category": "New Customers", - "campaign": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "type": "LOYALTY_CARD", + "category": "Existing Customers", "loyalty_card": { - "points": 10000 + "points": 20000 }, - "additional_info": "This loyalty card is enabled immediately upon creation.", + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", "metadata": { - "test": true, - "locale": "de-en" + "test": false, + "locale": "de-en-pl" } } }, - "Amount Discount with Formula": { + "Amount Discount": { "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", + "category": "Existing Customers", "discount": { + "amount_off": 2000, "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 100 - }, - "metadata": { - "Season": "Spring" - } + "effect": "APPLY_TO_ITEMS" + }, + "start_date": "2021-01-01T00:00:00Z" } }, - "Percent Discount with Formula": { + "Fixed Discount": { "value": { - "category": "First", - "type": "DISCOUNT_VOUCHER", + "category": "Existing Customers", "discount": { - "type": "PERCENT", - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "amount_limit": 1700, - "effect": "APPLY_TO_ORDER" - }, - "start_date": "2020-01-01T00:00:00Z", - "expiration_date": "2022-12-31T23:59:59Z", - "validity_timeframe": { - "duration": "PT1H", - "interval": "P2D" - }, - "validity_day_of_week": [ - 0, - 1 - ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", - "redemption": { - "quantity": 101 + "type": "FIXED", + "fixed_amount": 2000, + "effect": "APPLY_TO_ITEMS" }, - "metadata": { - "Season": "Fall" + "start_date": "2021-01-01T00:00:00Z" + } + }, + "Unit Discount": { + "value": { + "discount": { + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] } } } @@ -42025,85 +41868,85 @@ }, "responses": { "200": { - "description": "Returns a voucher object if the call succeeded.", + "description": "Returns the voucher object if the update succeeded.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/1_obj_voucher_object" }, "examples": { - "Percentage Discount": { + "Percent Discount": { "value": { - "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "code": "welcome", + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", "campaign": null, "campaign_id": null, - "category": "New Customers", + "category": "Second", + "category_id": "cat_0bb81a481615a37b5e", + "categories": [ + { + "id": "cat_0bb81a481615a37b5e", + "name": "Second", + "hierarchy": 2, + "created_at": "2022-09-20T05:58:01.561Z", + "object": "category" + } + ], "type": "DISCOUNT_VOUCHER", "discount": { "type": "PERCENT", - "percent_off": 10, + "amount_limit": 1800, + "percent_off": 45, + "percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)", "effect": "APPLY_TO_ORDER" }, "gift": null, "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", + "start_date": "2020-02-01T00:00:00.000Z", + "expiration_date": "2023-12-31T23:59:59.000Z", "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" + "interval": "P3D", + "duration": "PT2H" }, "validity_day_of_week": [ + 0, 1, - 2, - 3, - 4, - 5 + 2 ], "active": false, - "additional_info": "This voucher will remain inactive until enabled.", + "additional_info": "This voucher can be used with other coupons. Please feel free to do so.", "metadata": { - "test": true, - "locale": "de-en" + "Season": "Winter" }, "assets": { "qr": { - "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" }, "barcode": { - "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T09:05:34.668Z", - "updated_at": null, + "created_at": "2022-09-19T14:41:30.976Z", + "updated_at": "2022-09-20T06:00:50.202Z", "validation_rules_assignments": { "object": "list", "data_ref": "data", - "data": [ - { - "id": "asgm_74F7QZoYbUoljwQO", - "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", - "related_object_type": "voucher", - "created_at": "2022-02-17T09:05:34.642Z", - "object": "validation_rules_assignment" - } - ], - "total": 1 + "data": [], + "total": 0 }, "redemption": { - "quantity": 10, + "quantity": 101, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/welcome/publications?page=1&limit=10" + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" }, "object": "voucher" } @@ -42114,24 +41957,24 @@ "code": "welcomegiftcard", "campaign": null, "campaign_id": null, - "category": "New Customers", + "category": "Existing Customers", "type": "GIFT_VOUCHER", "discount": null, "gift": { - "amount": 10000, - "balance": 10000, - "effect": "APPLY_TO_ORDER" + "amount": 20000, + "balance": 20000, + "effect": "APPLY_TO_ITEMS" }, "loyalty_card": null, - "start_date": "2022-01-01T00:00:00.000Z", + "start_date": "2021-01-01T00:00:00.000Z", "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, - "active": true, - "additional_info": "This gift card is enabled immediately upon creation.", + "active": false, + "additional_info": "This gift card is disabled.", "metadata": { - "test": true, - "locale": "de-en" + "test": false, + "locale": "de-en-pl" }, "assets": { "qr": { @@ -42145,7 +41988,13 @@ }, "is_referral_code": false, "created_at": "2022-02-17T09:09:49.665Z", - "updated_at": null, + "updated_at": "2022-02-17T11:11:48.071Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, "redemption": { "quantity": null, "redeemed_quantity": 0, @@ -42167,23 +42016,23 @@ "code": "welcomeloyalty", "campaign": "Loyalty Campaign", "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", - "category": "New Customers", + "category": "Existing Customers", "type": "LOYALTY_CARD", "discount": null, "gift": null, "loyalty_card": { - "points": 10000, - "balance": 10000 + "points": 20000, + "balance": 20000 }, "start_date": null, "expiration_date": null, "validity_timeframe": null, "validity_day_of_week": null, - "active": true, - "additional_info": "This loyalty card is enabled immediately upon creation.", + "active": false, + "additional_info": "This loyalty card is being deactivated and points updated.", "metadata": { - "test": true, - "locale": "de-en" + "test": false, + "locale": "de-en-pl" }, "assets": { "qr": { @@ -42197,7 +42046,13 @@ }, "is_referral_code": false, "created_at": "2022-02-17T09:12:01.428Z", - "updated_at": null, + "updated_at": "2022-02-17T11:20:12.447Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, "redemption": { "quantity": null, "redeemed_quantity": 0, @@ -42213,101 +42068,160 @@ "object": "voucher" } }, - "Amount Discount with Formula": { + "Amount Discount": { "value": { - "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", - "code": "amount1", + "id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "code": "WelcomeDiscountAmount", "campaign": null, "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } + "category": "Existing Customers", + "type": "DISCOUNT_VOUCHER", + "discount": { + "type": "AMOUNT", + "amount_off": 2000, + "effect": "APPLY_TO_ITEMS" + }, + "gift": null, + "loyalty_card": null, + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": "2022-12-31T23:59:59.000Z", + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 ], + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", + "metadata": { + "test": true, + "locale": "de-en" + }, + "assets": { + "qr": { + "id": "U2FsdGVkX1+TcEE9sZP6aMfAW3NZv9GWlCnUNn+SiK4FIbMRWWjN5hzTR7Yc/73yfldUb6SMgIvUNL551Nz/nPjrMY2iauia1MSWX21MItsSPfy8qccrC+WAlvpGK/1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BTcEE9sZP6aMfAW3NZv9GWlCnUNn%2BSiK4FIbMRWWjN5hzTR7Yc%2F73yfldUb6SMgIvUNL551Nz%2FnPjrMY2iauia1MSWX21MItsSPfy8qccrC%2BWAlvpGK%2F1ZklnxYaeKqxTqwSXl7ppSlgcuEejbFiaqEDajvYUZsF4%3D" + }, + "barcode": { + "id": "U2FsdGVkX1/AhpZMq/h+Phi8JZF9m4qL8/U/Z5AST82jaAOnnhdHdbaGjB1+/0VFIdGBA8w2+3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG/fLZTsaNn8tjewd/W4qn/2Cc5NgTdv7fqui4=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAhpZMq%2Fh%2BPhi8JZF9m4qL8%2FU%2FZ5AST82jaAOnnhdHdbaGjB1%2B%2F0VFIdGBA8w2%2B3JX5qd61Dfk6yfiLCraVw7lYjQddCHF5SKtJs4hqsLHZevQTCzpZkeIHC3ThsG%2FfLZTsaNn8tjewd%2FW4qn%2F2Cc5NgTdv7fqui4%3D" + } + }, + "is_referral_code": false, + "created_at": "2022-02-17T11:41:05.236Z", + "updated_at": "2022-02-17T11:45:29.269Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [ + { + "id": "asgm_tDN7MJNayjrf1wyn", + "rule_id": "val_4j7DCRm2IS59", + "related_object_id": "v_jMIjKfG2oJ7vCwIPhsLsbXYGTdPLlbJd", + "related_object_type": "voucher", + "created_at": "2022-02-17T11:41:05.210Z", + "object": "validation_rules_assignment" + } + ], + "total": 1 + }, + "redemption": { + "quantity": 10, + "redeemed_quantity": 0, + "object": "list", + "url": "/v1/vouchers/WelcomeDiscountAmount/redemptions?page=1&limit=10" + }, + "publish": { + "object": "list", + "count": 0, + "url": "/v1/vouchers/WelcomeDiscountAmount/publications?page=1&limit=10" + }, + "object": "voucher" + } + }, + "Fixed Discount": { + "value": { + "id": "v_B1Pe7QPTjXCHm8IcDkJAQs4g6Zc08UlK", + "code": "wou4w1Og", + "campaign": "Fixed", + "campaign_id": "camp_2jVA6EKGSAe6scyc3i1q9ROD", + "category": "Existing Customers", "type": "DISCOUNT_VOUCHER", "discount": { - "type": "AMOUNT", - "amount_off": 100, - "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" + "type": "FIXED", + "effect": "APPLY_TO_ITEMS", + "fixed_amount": 2000 }, "gift": null, "loyalty_card": null, - "start_date": "2020-01-01T00:00:00.000Z", - "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": { - "interval": "P2D", - "duration": "PT1H" - }, - "validity_day_of_week": [ - 1, - 2, - 3, - 4, - 5 - ], + "start_date": "2021-01-01T00:00:00.000Z", + "expiration_date": null, + "validity_timeframe": null, + "validity_day_of_week": null, "active": true, - "additional_info": "This voucher can be used with other coupons.", - "metadata": { - "Season": "Spring" - }, + "additional_info": null, + "metadata": {}, "assets": { "qr": { - "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" + "id": "U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW/82oGOW24bFMA06kahjkZKVA/1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc/dPwqE+xEKuDg==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX18zxYPpRIYeGHCoCAp3ZAPEUM0qacHQIIW%2F82oGOW24bFMA06kahjkZKVA%2F1mqqJsqh83C29Jhdz82KrRsM2zl9nzplu5hrmn7m0twnf5NQaTTcovEvnBV8Kej9tGhzc%2FdPwqE%2BxEKuDg%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" + "id": "U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo/9bm/HNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3+Sw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX18tsK1tz0X2IQWbFHCY4wZBDjoysFt1fBlWo%2F9bm%2FHNTci1Q3bSFuIzqIQqlU2TkSacFBgOWGuVG08XboZsqNSXXsAgST9tyoxpaOJ22B2EwWspdvuwJqvZh4PpEyh3BBDS7eOWsr3%2BSw%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-09-19T14:22:50.552Z", - "updated_at": null, + "created_at": "2022-02-17T11:54:37.766Z", + "updated_at": "2022-02-17T12:04:53.346Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, "redemption": { - "quantity": 100, + "quantity": 1, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" + "url": "/v1/vouchers/wou4w1Og/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/amount1/publications?page=1&limit=10" + "url": "/v1/vouchers/wou4w1Og/publications?page=1&limit=10" }, "object": "voucher" } }, - "Percent Discount with Formula": { + "Unit Discount": { "value": { - "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", - "code": "percent1", + "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", + "code": "MultipleUnitTypesUnitDiscount", "campaign": null, "campaign_id": null, - "category": "First", - "category_id": "cat_0bb343dee3cdb5ec0c", - "categories": [ - { - "id": "cat_0bb343dee3cdb5ec0c", - "name": "First", - "hierarchy": 1, - "created_at": "2022-09-16T11:47:19.568Z", - "object": "category" - } - ], + "category": "New Customers", "type": "DISCOUNT_VOUCHER", "discount": { - "type": "PERCENT", - "amount_limit": 1700, - "percent_off": 40, - "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", - "effect": "APPLY_TO_ORDER" + "type": "UNIT", + "effect": "ADD_MANY_ITEMS", + "units": [ + { + "unit_off": 2, + "unit_type": "prod_0a9f9ab4ab019a42d5", + "effect": "ADD_MISSING_ITEMS" + }, + { + "unit_off": 1, + "unit_type": "prod_0a9f9aeddb019a42db", + "effect": "ADD_MISSING_ITEMS" + } + ] }, "gift": null, "loyalty_card": null, @@ -42318,37 +42232,47 @@ "duration": "PT1H" }, "validity_day_of_week": [ - 0, - 1 + 1, + 2, + 3, + 4, + 5 ], - "active": true, - "additional_info": "This voucher can be used with other coupons.", + "active": false, + "additional_info": "This voucher will remain inactive until enabled.", "metadata": { - "Season": "Fall" + "test": true, + "locale": "de-en" }, "assets": { "qr": { - "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", - "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" + "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" }, "barcode": { - "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", - "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" + "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" } }, "is_referral_code": false, - "created_at": "2022-09-19T14:41:30.976Z", - "updated_at": null, + "created_at": "2022-02-18T06:27:45.619Z", + "updated_at": "2022-02-18T06:31:08.630Z", + "validation_rules_assignments": { + "object": "list", + "data_ref": "data", + "data": [], + "total": 0 + }, "redemption": { - "quantity": 101, + "quantity": 5, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/percent1/publications?page=1&limit=10" + "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" }, "object": "voucher" } @@ -42357,22 +42281,72 @@ } } }, - "409": { - "description": "Returns an error if a voucher code already exists.", + "400": { + "description": "Returns an error if, for example, the AMOUNT type discount doesn't have the `type` attribute defined.", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/e_409_duplicate_found" + "$ref": "#/components/schemas/e_error_no_translation" }, "examples": { - "Duplicate Code": { + "Invalid Voucher": { "value": { - "code": 409, - "key": "duplicate_found", - "message": "Duplicated resource found", - "details": "Duplicated voucher exists with id CODE", - "request_id": "v-0ae786a8f786b73dfa", - "resource_id": "CODE", + "code": 400, + "key": "invalid_voucher", + "message": "Invalid Voucher", + "details": "It is not possible to change Voucher discount type", + "request_id": "b7f5149d-83e5-46ef-93ad-ef191a87b185" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "delete-voucher", + "tags": [ + "VOUCHERS API" + ], + "summary": "Delete Voucher", + "description": "Deletes a voucher. This operation cannot be undone. Additionally, this operation removes any redemptions on the voucher.", + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "force", + "description": "If this flag is set to `true`, the voucher will be removed permanently. Going forward, the user will be able to create another voucher with exactly the same code." + } + ], + "security": [ + { + "X-App-Id-1": [], + "X-App-Token-1": [] + } + ], + "responses": { + "204": { + "description": "Returns no content if deletion is successful." + }, + "404": { + "description": "Returns an error indicating that the voucher with given ID was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_404_not_found" + }, + "examples": { + "Voucher Not Found": { + "value": { + "code": 404, + "key": "not_found", + "message": "Resource not found", + "details": "Cannot find voucher with id 10OFF", + "request_id": "v-0ae28d3cec96bb1b7e", + "resource_id": "10OFF", "resource_type": "voucher" } } @@ -42381,16 +42355,14 @@ } } } - } - }, - "/v1/vouchers/": { + }, "post": { - "operationId": "generate-random-code", + "operationId": "create-voucher", "tags": [ "VOUCHERS API" ], - "summary": "Generate Random Code", - "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.\n\nYou can optionally use the `code` parameter to define a specific code or the `code_config` parameter to design rules for Voucherify API to create a random code. If neither of the two parameters are passed, then a random code is generated by the Voucherify API.\n\nThis method will return an error when trying to create a voucher that already exists.", + "summary": "Create Voucher", + "description": "Create a standalone voucher. You can choose to create a `GIFT_VOUCHER`, a `DISCOUNT_VOUCHER`, or a `LOYALTY_CARD`. The code path parameter can use all letters of the English alphabet, Arabic numerals and special characters. \n\nWhen you create a new voucher, you can specify a type to create it.\nCreating a new voucher will create a new stand alone voucher if no `campaign` name or `campaign_id` is provided. In case of the loyalty card, a campaign name is required.", "parameters": [], "security": [ { @@ -42403,21 +42375,19 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/1_req_vouchers__POST" + "$ref": "#/components/schemas/1_req_vouchers_code_POST" }, "examples": { "Percentage Discount": { "value": { "category": "New Customers", - "code": "NEW-WELCOME-COUPON", "type": "DISCOUNT_VOUCHER", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", "discount": { "percent_off": 10, "type": "PERCENT", "effect": "APPLY_TO_ORDER" }, - "start_date": "2016-01-01T00:00:00Z", + "start_date": "2022-01-01T00:00:00Z", "expiration_date": "2022-12-31T23:59:59Z", "validity_timeframe": { "duration": "PT1H", @@ -42458,12 +42428,6 @@ "metadata": { "test": true, "locale": "de-en" - }, - "code_config": { - "pattern": "GIFT-CARD-##########", - "prefix": "New-", - "postfix": "0", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" } } }, @@ -42479,35 +42443,18 @@ "metadata": { "test": true, "locale": "de-en" - }, - "code_config": { - "pattern": "LOYALTY-CARD-##", - "prefix": "New-", - "postfix": "1", - "charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" } } }, - "Unit Discount Multiple Items": { + "Amount Discount with Formula": { "value": { - "category": "New Customers", - "code": "MultipleUnitTypesUnitDiscount", + "category": "First", "type": "DISCOUNT_VOUCHER", - "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] + "discount": { + "type": "AMOUNT", + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, "start_date": "2020-01-01T00:00:00Z", "expiration_date": "2022-12-31T23:59:59Z", @@ -42522,34 +42469,44 @@ 4, 5 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", + "active": true, + "additional_info": "This voucher can be used with other coupons.", "redemption": { - "quantity": 5 + "quantity": 100 }, "metadata": { - "test": true, - "locale": "de-en" + "Season": "Spring" } } }, - "Unit Discount Single Item": { + "Percent Discount with Formula": { "value": { - "category": "New Customers", - "code": "AddMissingItemDiscount", + "category": "First", "type": "DISCOUNT_VOUCHER", "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" + "type": "PERCENT", + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "amount_limit": 1700, + "effect": "APPLY_TO_ORDER" }, "start_date": "2020-01-01T00:00:00Z", "expiration_date": "2022-12-31T23:59:59Z", - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P2D" + }, + "validity_day_of_week": [ + 0, + 1 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", "redemption": { - "quantity": 3 + "quantity": 101 + }, + "metadata": { + "Season": "Fall" } } } @@ -42568,10 +42525,10 @@ "examples": { "Percentage Discount": { "value": { - "id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", - "code": "NEW-WELCOME-COUPON", - "campaign": "Bug fix", - "campaign_id": "camp_Y6dLsYIZloGqP8izufXY6SSJ", + "id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", + "code": "welcome", + "campaign": null, + "campaign_id": null, "category": "New Customers", "type": "DISCOUNT_VOUCHER", "discount": { @@ -42581,7 +42538,7 @@ }, "gift": null, "loyalty_card": null, - "start_date": "2016-01-01T00:00:00.000Z", + "start_date": "2022-01-01T00:00:00.000Z", "expiration_date": "2022-12-31T23:59:59.000Z", "validity_timeframe": { "interval": "P2D", @@ -42602,27 +42559,27 @@ }, "assets": { "qr": { - "id": "U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM/d78Wm/zru1ybT4+AQ2X0JnEy86N7TZ/aoezZORjcBRUfyVM/scUUF/vmD4Ezn+Elp2+V9AFcAXN/WthaRMl9e7xvEeIEQ5nao=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX180g6GhUA0kT47tHGvZ5thjCgY5nbsPtiecixkkEznFVg2v3SDG9dpCbXR6BSUdM%2Fd78Wm%2Fzru1ybT4%2BAQ2X0JnEy86N7TZ%2FaoezZORjcBRUfyVM%2FscUUF%2FvmD4Ezn%2BElp2%2BV9AFcAXN%2FWthaRMl9e7xvEeIEQ5nao%3D" + "id": "U2FsdGVkX1+by33CNzWu6xXjCrLKRr1+H9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC+4/hCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bby33CNzWu6xXjCrLKRr1%2BH9K3I9wOSa7idiHrMYJe0HlrWiy7INhaJf1BnaKJjLKcUC%2B4%2FhCbILtJ9lHXZWhewG5q5rmx29gK0IH2eRauw1qCZKIlXfqeGTG2T5ftPsEl1D4xf8W2MA%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1/AynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos/XWBg8zu0Kta0pA/yvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr+TGlI=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FAynivxYCEIxfTnf3A1lO0xsNihOlbUMo6Y6873LQ2qpmkk90aUFnaFKd7pVumcirRweblzGVSxy24Phhd174VSPaLxxmSKp0FPv0dRos%2FXWBg8zu0Kta0pA%2FyvFK3WWGlNoPPPnvEhVWKKzOr09Gj94SMrr%2BTGlI%3D" + "id": "U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz/ZTnXUFeHeehtK4L6RTvNgVeSR+McTZR4DYNLEGydZ+Fo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO/OEAjvVoiEuaHA==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX19wOdFeXYXZ4Xu22L0Ummk03Urz%2FZTnXUFeHeehtK4L6RTvNgVeSR%2BMcTZR4DYNLEGydZ%2BFo2xEqqM1UWyl8Bx22Pi1CxghADOcy3bAvSca7EEPpvKrCY403UWUDvaO%2FOEAjvVoiEuaHA%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T07:14:40.096Z", + "created_at": "2022-02-17T09:05:34.668Z", "updated_at": null, "validation_rules_assignments": { "object": "list", "data_ref": "data", "data": [ { - "id": "asgm_COu5PJAsWmAwuCqR", + "id": "asgm_74F7QZoYbUoljwQO", "rule_id": "val_4j7DCRm2IS59", - "related_object_id": "v_YJYfeKoR0XAGIvaM7k51wTbDjU4WIpC5", + "related_object_id": "v_MBOEmHelKwvykVZ8JcT4TE5Kla5IMJyc", "related_object_type": "voucher", - "created_at": "2022-02-17T07:14:40.280Z", + "created_at": "2022-02-17T09:05:34.642Z", "object": "validation_rules_assignment" } ], @@ -42632,20 +42589,20 @@ "quantity": 10, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/NEW-WELCOME-COUPON/redemptions?page=1&limit=10" + "url": "/v1/vouchers/welcome/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/NEW-WELCOME-COUPON/publications?page=1&limit=10" + "url": "/v1/vouchers/welcome/publications?page=1&limit=10" }, "object": "voucher" } }, - "Gift Voucher": { + "Gift Card": { "value": { - "id": "v_yAZyBimXtF9yQ2C5BEF9WMhNzOMJNfz6", - "code": "New-GIFT-CARD-8tqB6FcyhE0", + "id": "v_7xaObxyK5LG62Rp0Xqpez7lqiBFL62pL", + "code": "welcomegiftcard", "campaign": null, "campaign_id": null, "category": "New Customers", @@ -42669,36 +42626,36 @@ }, "assets": { "qr": { - "id": "U2FsdGVkX1+pm0q3U4i/KrjResuZpwDigEa5WcDOlwYS/bj3rsesZXDpJF5MNHMUsKqy0+wn5tY3QbjPGv0dwbqRn/OjrIRgNlP99azD0n0n9C/chiTABp8BxlJmMKKFo5AggBbQu4+Mw8Cv8V3+0Ga7ETzeehS+Yrj6c+3ioxg=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2Bpm0q3U4i%2FKrjResuZpwDigEa5WcDOlwYS%2Fbj3rsesZXDpJF5MNHMUsKqy0%2Bwn5tY3QbjPGv0dwbqRn%2FOjrIRgNlP99azD0n0n9C%2FchiTABp8BxlJmMKKFo5AggBbQu4%2BMw8Cv8V3%2B0Ga7ETzeehS%2BYrj6c%2B3ioxg%3D" + "id": "U2FsdGVkX1+mTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M/OBPJm4PV8bTtBgR+oXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj+63mS9QdHvvILEAulBuZZQ+hZ0HmFXjDl4Quz/kUqGwffKGTziQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BmTbI2MdzBdMJ7AsOPKvGGgRB7O4oHZv5qq8I3M%2FOBPJm4PV8bTtBgR%2BoXOU4Jv1ucbIV7yg1mzC86LVFKjO7Ptnj%2B63mS9QdHvvILEAulBuZZQ%2BhZ0HmFXjDl4Quz%2FkUqGwffKGTziQ%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1/UaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj+Kvjmbhb22/SVZd/xzQlUBJcv7XboJYU0=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FUaGX0zV8oXbpYah2G76V1ljYSy6hDSnWAZhpz5v10vRibGaOJUahyLcClMyxAsUhU9WXWi4BUGWIEEu510AxzxyGHOTDTjavJH0Q79PI0ciLHdujNFOgLOXWe9Ffwzj%2BKvjmbhb22%2FSVZd%2FxzQlUBJcv7XboJYU0%3D" + "id": "U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN+8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg+6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO/71RdMw==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX184KgQ11OfpqB4WkJuH9ushSwZb0YrcN%2B8OaGPHxBQMiBr2axwnvQlZYv6YhqWtnc5iHByHrkg%2B6qYHxOLBPRMWCysIhcuUEB57IDhgYUHRPyM2bWjQadVHngGfVGCQ0CUy4PO%2F71RdMw%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T07:49:10.834Z", + "created_at": "2022-02-17T09:09:49.665Z", "updated_at": null, "redemption": { "quantity": null, "redeemed_quantity": 0, "redeemed_amount": 0, "object": "list", - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/redemptions?page=1&limit=10" + "url": "/v1/vouchers/welcomegiftcard/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/New-GIFT-CARD-8tqB6FcyhE0/publications?page=1&limit=10" + "url": "/v1/vouchers/welcomegiftcard/publications?page=1&limit=10" }, "object": "voucher" } }, "Loyalty Card": { "value": { - "id": "v_tVkcOhjHCz9W7q8QnuJnTGPBR2hdaYrC", - "code": "New-LOYALTY-CARD-UC1", + "id": "v_l84t3fy3keMUiOeaHbN1cbTdW8O5eUlm", + "code": "welcomeloyalty", "campaign": "Loyalty Campaign", "campaign_id": "camp_E87CubZLZ8eoQt3c4kAEZsx0", "category": "New Customers", @@ -42721,55 +42678,55 @@ }, "assets": { "qr": { - "id": "U2FsdGVkX1+6lGBFlqtS9OoY2wbAsoSupV43qa+g5sGu+R0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw/vRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ/2el72nZ6Hpr2NkWtk19JTpNwB8tk=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2B6lGBFlqtS9OoY2wbAsoSupV43qa%2Bg5sGu%2BR0IDTq2k85LIfbKfV9sDSYv80pP9ucsazJ6qGI9ineqQyhv9VVHdsJ2qGRiuZzpw%2FvRkSA0a7J9N1MpANgzqpIULZHLjYtrCQ%2F2el72nZ6Hpr2NkWtk19JTpNwB8tk%3D" + "id": "U2FsdGVkX186PCWooyrNsjfI+nb+Y9ziUZ1k7xe+nJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX186PCWooyrNsjfI%2Bnb%2BY9ziUZ1k7xe%2BnJQ53Ms1ynNJOX6JXC6SwxS1WDhYwAKX5FxaDoKyuPf5MkQrkeB6u5bSx333ldAyLypNnqwBD2N17S64WFnTqV7eXUk3hS30wDYcz0cQAJFDcQ%3D%3D" }, "barcode": { - "id": "U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur+ZhM+Mbmnva/fgYUcUbOttsFXPY/PMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k+0V0Wp7JUkudIKeRw2fDnQ3/0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX180bvJVsyZvpAqwYXTnm4MvvH4Rur%2BZhM%2BMbmnva%2FfgYUcUbOttsFXPY%2FPMZ9Xi8pomVp26a7amIPguNimD8w4PMZLMavMtH7EtJ4k%2B0V0Wp7JUkudIKeRw2fDnQ3%2F0cgqvK6PMReUwFWb5nUT3ABpZDAdaOVoMDhE%3D" + "id": "U2FsdGVkX1/FWUg0RbOU7R7Zqg7/8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo/1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A==", + "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FFWUg0RbOU7R7Zqg7%2F8Ba6oYuXrmIl7EdXGgaPMPfpePNGRzxBu4LP2dNEUO9h1Sh37MR1PxOoaemPwlgTDo%2F1G8dX1JjSppNoaTHhkzk2w4yutNhP7o8cq3ZBbT3TNMTKb2H3fUMc7A%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-17T08:06:41.091Z", + "created_at": "2022-02-17T09:12:01.428Z", "updated_at": null, "redemption": { "quantity": null, "redeemed_quantity": 0, "redeemed_points": 0, "object": "list", - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/redemptions?page=1&limit=10" + "url": "/v1/vouchers/welcomeloyalty/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/New-LOYALTY-CARD-UC1/publications?page=1&limit=10" + "url": "/v1/vouchers/welcomeloyalty/publications?page=1&limit=10" }, "object": "voucher" } }, - "Unit Discount Multiple Items": { + "Amount Discount with Formula": { "value": { - "id": "v_cu8nyozvTDA413H17bH5BLha0cjxt7s8", - "code": "MultipleUnitTypesUnitDiscount", + "id": "v_pmjVYKEDFzMqwNroHTlFcI1yKLqUcVVS", + "code": "amount1", "campaign": null, "campaign_id": null, - "category": "New Customers", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], "type": "DISCOUNT_VOUCHER", "discount": { - "type": "UNIT", - "effect": "ADD_MANY_ITEMS", - "units": [ - { - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_NEW_ITEMS" - }, - { - "unit_off": 1, - "unit_type": "prod_0a9f9aeddb019a42db", - "effect": "ADD_MISSING_ITEMS" - } - ] + "type": "AMOUNT", + "amount_off": 100, + "amount_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, "gift": null, "loyalty_card": null, @@ -42786,85 +42743,103 @@ 4, 5 ], - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", + "active": true, + "additional_info": "This voucher can be used with other coupons.", "metadata": { - "test": true, - "locale": "de-en" + "Season": "Spring" }, "assets": { "qr": { - "id": "U2FsdGVkX1+ocJBtZ9NqT97gZ/QTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2/DkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q+3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE/be+o=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BocJBtZ9NqT97gZ%2FQTfOz54TAoRoKO3tnCYBtHZWMghEHT0b2aFrPSL1lqMyf6fYy6DH2%2FDkH5p5Vd8dOozW1LV6wPVatWpa1lZMeMIB0OcARCW3q%2B3QydoW2KdliLKyksFwumH9C7Fsnj6HTaEbUjSttTZE%2Fbe%2Bo%3D" + "id": "U2FsdGVkX1+aMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue+JlUrQsbh+dmp2gJigaVixgvyC7/zUxQjf8tnVT4R79G4LmUkltHMqHsaf++fsP1G07nDl9/2WHh/QVb6z4KP/DX5Dw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX1%2BaMFY2yoGxlWkhulvTPR8RlMZtfOaWXnL6PCnegsV73aCTsue%2BJlUrQsbh%2Bdmp2gJigaVixgvyC7%2FzUxQjf8tnVT4R79G4LmUkltHMqHsaf%2B%2BfsP1G07nDl9%2F2WHh%2FQVb6z4KP%2FDX5Dw%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1+Sly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3+ZMldwBGaTp/fIN9SGBW/NVUtfDOI2sIDLZCBBrdK7WVvtCQQ+1Y+6qClYg/QurJExCFRkDeKpKjDug=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BSly3IYj3EbZFHGGNxV6Ns4j76O8d0kRQe3WriJz5qY6s4GBIwlsdy13AciaQuiVt232HlOlZ4TzGaSSk3%2BZMldwBGaTp%2FfIN9SGBW%2FNVUtfDOI2sIDLZCBBrdK7WVvtCQQ%2B1Y%2B6qClYg%2FQurJExCFRkDeKpKjDug%3D" + "id": "U2FsdGVkX1+X2OimwSCEmGvGrZXXK+b4OrStQELVsHRup8Su+uISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6/GK/4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8/hdaq2FCQeWA==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BX2OimwSCEmGvGrZXXK%2Bb4OrStQELVsHRup8Su%2BuISCOBz7xWdbpoLVJlSFepcRxSNUUdjcbpgKH7YNfaclrta8Ig6%2FGK%2F4YFlh0cPKCGOG5WWyXWzxxmVgVqRdI7KR8%2Fhdaq2FCQeWA%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-18T06:27:45.619Z", + "created_at": "2022-09-19T14:22:50.552Z", "updated_at": null, "redemption": { - "quantity": 5, + "quantity": 100, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/redemptions?page=1&limit=10" + "url": "/v1/vouchers/amount1/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/MultipleUnitTypesUnitDiscount/publications?page=1&limit=10" + "url": "/v1/vouchers/amount1/publications?page=1&limit=10" }, "object": "voucher" } }, - "Unit Discount Single Item": { + "Percent Discount with Formula": { "value": { - "id": "v_NQdraO4fXWYvMMWYL9OY22hRernr553n", - "code": "AddMissingItemDiscount", + "id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m", + "code": "percent1", "campaign": null, "campaign_id": null, - "category": "New Customers", + "category": "First", + "category_id": "cat_0bb343dee3cdb5ec0c", + "categories": [ + { + "id": "cat_0bb343dee3cdb5ec0c", + "name": "First", + "hierarchy": 1, + "created_at": "2022-09-16T11:47:19.568Z", + "object": "category" + } + ], "type": "DISCOUNT_VOUCHER", "discount": { - "type": "UNIT", - "unit_off": 1, - "unit_type": "prod_0a9f9ab4ab019a42d5", - "effect": "ADD_MISSING_ITEMS" + "type": "PERCENT", + "amount_limit": 1700, + "percent_off": 40, + "percent_off_formula": "IF(CUSTOMER_METADATA(\"favorite_brands\") contains \"Nike\";20;CUSTOMER_METADATA(\"age\"))", + "effect": "APPLY_TO_ORDER" }, "gift": null, "loyalty_card": null, "start_date": "2020-01-01T00:00:00.000Z", "expiration_date": "2022-12-31T23:59:59.000Z", - "validity_timeframe": null, - "validity_day_of_week": null, - "active": false, - "additional_info": "This voucher will remain inactive until enabled.", - "metadata": {}, + "validity_timeframe": { + "interval": "P2D", + "duration": "PT1H" + }, + "validity_day_of_week": [ + 0, + 1 + ], + "active": true, + "additional_info": "This voucher can be used with other coupons.", + "metadata": { + "Season": "Fall" + }, "assets": { "qr": { - "id": "U2FsdGVkX19Yh7LTNyOVKSXQ+ceTr023saElWAUeucwOgjTH50x1SoSF/PP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La/4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE//kfWFhs=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19Yh7LTNyOVKSXQ%2BceTr023saElWAUeucwOgjTH50x1SoSF%2FPP1aoGBr6sSxHZNZOvBGumWNHjsF85y7cPY7La%2F4a0d1kWqnAiBWeWnGOgDFeQFqthGswypFOK1jdAzUPqLSbxW3O6q936N6Bsmoz4QHYE%2F%2FkfWFhs%3D" + "id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==", + "url": "https://dl.voucherify.io/api/v1/assets/qr/U2FsdGVkX19MPtNCPjoG%2FpKloolK%2BBZH%2FOCIpjYqj%2BB6IVJJmTYKeBINcB0JioL%2FtSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG%2FRCFsVky4olBJ%2BGZFb9pLpN5gC%2Frn0pqYw%3D%3D" }, "barcode": { - "id": "U2FsdGVkX1+RqzgyYsIJzAEBxmQt1OZLu4+PSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc+K6X1fjg0ggDsCdXP2ZxpyGPD8/1ReggJZ/tq823ji7A5pzhG1TljA6+vmISuHvs2wkcum0djN9AWuAlB0F/vbXexo=", - "url": "https://dev.dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2BRqzgyYsIJzAEBxmQt1OZLu4%2BPSUDQBldDKK1o5XsEoBSQEMPWHis1wJSg4ZNqJ9ZdJ0Ukc%2BK6X1fjg0ggDsCdXP2ZxpyGPD8%2F1ReggJZ%2Ftq823ji7A5pzhG1TljA6%2BvmISuHvs2wkcum0djN9AWuAlB0F%2FvbXexo%3D" + "id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==", + "url": "https://dl.voucherify.io/api/v1/assets/barcode/U2FsdGVkX1%2FJ73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q%2B5RDlh%2FCXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg%2FheHcshw22Q%3D%3D" } }, "is_referral_code": false, - "created_at": "2022-02-18T06:46:44.536Z", + "created_at": "2022-09-19T14:41:30.976Z", "updated_at": null, "redemption": { - "quantity": 3, + "quantity": 101, "redeemed_quantity": 0, "object": "list", - "url": "/v1/vouchers/AddMissingItemDiscount/redemptions?page=1&limit=10" + "url": "/v1/vouchers/percent1/redemptions?page=1&limit=10" }, "publish": { "object": "list", "count": 0, - "url": "/v1/vouchers/AddMissingItemDiscount/publications?page=1&limit=10" + "url": "/v1/vouchers/percent1/publications?page=1&limit=10" }, "object": "voucher" } @@ -42872,6 +42847,29 @@ } } } + }, + "409": { + "description": "Returns an error if a voucher code already exists.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/e_409_duplicate_found" + }, + "examples": { + "Duplicate Code": { + "value": { + "code": 409, + "key": "duplicate_found", + "message": "Duplicated resource found", + "details": "Duplicated voucher exists with id CODE", + "request_id": "v-0ae786a8f786b73dfa", + "resource_id": "CODE", + "resource_type": "voucher" + } + } + } + } + } } } } 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 069/108] 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 b961dec9ee1cb7e7e74f31ced97ffda34da6a2a8 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:45:50 +0200 Subject: [PATCH 070/108] Update OpenAPI.json --- reference/OpenAPI.json | 55 ++++-------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 39433b3c3..8b6d22263 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -39481,19 +39481,6 @@ "async_action_id" ] }, - "error": { - "title": "error", - "type": "object", - "properties": {}, - "discriminator": { - "propertyName": "key", - "mapping": { - "not_enough_codes": "not_enough_codes" - } - }, - "description": "Short error response", - "examples": [] - }, "e_error": { "title": "Error Object", "type": "object", @@ -39659,38 +39646,6 @@ } } }, - "e_400_not_enough_source_ids": { - "description": "Error: Bad Request → Missing Parameters", - "type": "object", - "title": "Not Enough Source ID's", - "properties": { - "code": { - "type": "integer", - "default": 400, - "description": "Error's HTTP status code." - }, - "key": { - "type": "string", - "default": "not_enought_source_ids", - "description": "Short string describing the kind of error which occurred." - }, - "message": { - "type": "string", - "default": "Not enough source_ids", - "description": "A human-readable message providing a short description about the error." - }, - "details": { - "type": "string", - "example": "Specify at least 1 source_id", - "description": "A human-readable message providing more details about the error." - }, - "request_id": { - "type": "string", - "example": "v-0a96c19b1a41c03999", - "description": "This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team." - } - } - }, "e_400_invalid_payload": { "title": "Invalid Payload", "type": "object", @@ -70492,7 +70447,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/LoyaltyTier" + "$ref": "#/components/schemas/LoyaltiesGetTierResponseBody" }, "examples": { "Example": { @@ -79200,7 +79155,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_req_create_export_POST" + "$ref": "#/components/schemas/ExportsCreateRequestBody" } } } @@ -79211,7 +79166,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + "$ref": "#/components/schemas/ExportsCreateResponseBody" } } } @@ -79296,7 +79251,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_res_list_exports" + "$ref": "#/components/schemas/ExportsListResponseBody" }, "examples": { "List Exports": { @@ -79421,7 +79376,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/16_obj_export_object" + "$ref": "#/components/schemas/ExportsGetResponseBody" }, "examples": { "Get Export": { From 1fe2cb70e17022aa1b7fc81be3fd0100f05b8d12 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:01:00 +0200 Subject: [PATCH 071/108] Update OpenAPI.json --- reference/OpenAPI.json | 385 ++--------------------------------------- 1 file changed, 17 insertions(+), 368 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 8b6d22263..663959ee6 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -21126,67 +21126,6 @@ } } }, - "8_res_get_loyalty_card_transactions": { - "title": "Get Loyalty Card Transactions Response Body", - "type": "object", - "description": "List of loyalty card transactions", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "The type of object represented by JSON." - }, - "data_ref": { - "type": "string", - "default": "data", - "description": "Identifies the name of the attribute that contains the array of transaction objects." - }, - "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/1_obj_loyalty_card_transaction_object" - } - }, - "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." - } - } - }, - "1_obj_loyalty_card_transaction_object": { - "title": "Loyalty Card Transaction Object", - "description": "Loyalty card transaction object", - "anyOf": [ - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_redemption" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_accrual_custom_event" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_refund" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_addition" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_removal" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_expiration" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_out" - }, - { - "$ref": "#/components/schemas/1_obj_loyalty_card_transaction_object_transfer_in" - } - ] - }, "1_obj_loyalty_card_transaction_object_redemption": { "title": "Redemption", "description": "When loyalty points are used to pay for an order.", @@ -22465,116 +22404,6 @@ } } }, - "8_req_create_loyalty_card_transactions_export": { - "type": "object", - "title": "Create Loyalty Card Transactions Export Request Body", - "description": "Request body schema for **POST** `/loyalties/members/{memberId}/transactions/export`.", - "properties": { - "parameters": { - "$ref": "#/components/schemas/8_obj_export_loyalty_card_transactions", - "description": "Contains the parameters that define the data to be exported." - } - } - }, - "8_obj_export_loyalty_card_transactions": { - "description": "List of available fields and filters that can be exported with a loyalty card transactions export along with the sorting order of the returned data.", - "title": "Export Transactions", - "type": "object", - "properties": { - "order": { - "type": "string", - "description": "How the export is filtered, where the dash `-` preceding a sorting option means sorting in a descending order.", - "enum": [ - "-created_at", - "created_at" - ] - }, - "fields": { - "type": "array", - "enum": [ - [ - "id", - "type", - "source_id", - "reason", - "balance", - "amount", - "created_at", - "voucher_id", - "campaign_id", - "source", - "details", - "related_transaction_id" - ] - ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_TRANSFER_OUT`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_REFUND`
                                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                                  - `voucherify-web-ui`
                                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", - "items": { - "type": "string" - } - } - } - }, - "8_obj_export_transactions_object": { - "title": "Export Object", - "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [loyalty card transactions](ref:list-loyalty-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", - "properties": { - "id": { - "type": "string", - "description": "Unique export ID.", - "example": "exp_FFfp9o7daWuJqJCKp5xqqli4" - }, - "object": { - "type": "string", - "default": "export", - "description": "The type of object being represented. This object stores information about the `export`." - }, - "created_at": { - "type": "string", - "example": "2022-04-28T11:23:20.922Z", - "description": "Timestamp representing the date and time when the export was scheduled in ISO 8601 format.", - "format": "date-time" - }, - "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", - "IN_PROGRESS", - "DONE", - "ERROR" - ] - }, - "channel": { - "type": "string", - "description": "The channel through which the export was triggered.", - "default": "API" - }, - "exported_object": { - "type": "string", - "description": "The type of exported object.", - "default": "voucher_transactions" - }, - "parameters": { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - }, - "result": { - "type": "object", - "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](ref:download-export) method." - } - } - }, - "user_id": { - "type": "string", - "description": "Identifies the specific user who initiated the export through the Voucherify Dashboard; returned when the `channel` value is `WEBSITE`.", - "example": "user_g24UoRO3Caxu7FCT4n5tpYEa3zUG0FrH" - } - } - }, "8_obj_loyalty_tier_object": { "type": "object", "title": "Loyalty Tier Object", @@ -25249,113 +25078,6 @@ } } }, - "8_req_add_remove_points_balance": { - "title": "Add or Remove Points Balance Request Body", - "type": "object", - "description": "Request schema for adding or removing points from a loyalty card.", - "properties": { - "points": { - "type": "integer", - "description": "Incremental balance to be added to/subtracted from the loyalty card. \n\nTo add points: `100` \nTo subtract points, add a minus: `-100`" - }, - "expiration_type": { - "type": "string", - "default": "PROGRAM_RULES", - "enum": [ - "PROGRAM_RULES", - "NON_EXPIRING", - "CUSTOM_DATE" - ], - "description": "Set the type of expiration for added points. \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", - "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`.", - "example": "2020-05-30" - }, - "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." - } - } - }, - "8_res_add_remove_points_balance": { - "description": "Response schema for adding or removing points from a loyalty card.", - "type": "object", - "title": "Add or Remove Loyalty Card Balance Response Body", - "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", - "description": "The balance after adding/removing points." - }, - "type": { - "type": "string", - "description": "The type of voucher being modified.", - "default": "loyalty_card" - }, - "object": { - "type": "string", - "description": "The type of object represented by JSON. Default is `balance`.", - "default": "balance" - }, - "related_object": { - "type": "object", - "description": "Defines the object that is being modified with the values that are returned in the balance object.", - "properties": { - "type": { - "type": "string", - "description": "The object being modified.", - "default": "voucher" - }, - "id": { - "type": "string", - "description": "Identifies the loyalty card that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - } - } - } - } - }, - "8_req_transfer_loyalty_points": { - "description": "Request body schema for transferring points from a loyalty card.", - "type": "array", - "title": "Transfer Loyalty Points Request Body", - "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "Unique loyalty card code from which the user wants to transfer loyalty points (source).", - "example": "L-CARD-02hgnq4" - }, - "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).", - "example": 2 - }, - "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." - } - } - } - }, "8_req_redeem_reward": { "description": "Request body schema for redeeming a reward.", "type": "object", @@ -30972,83 +30694,6 @@ } } }, - "16_res_list_exports": { - "description": "Response schema for listing exports.", - "type": "object", - "title": "List Exports Response Body", - "properties": { - "object": { - "type": "string", - "description": "The type of object represented by JSON. This object stores information about exports.", - "default": "list" - }, - "data_ref": { - "type": "string", - "description": "Identifies the name of the attribute that contains the array of exports.", - "default": "exports" - }, - "exports": { - "type": "array", - "uniqueItems": true, - "description": "An array of export objects.", - "items": { - "$ref": "#/components/schemas/16_obj_export_object" - } - }, - "total": { - "type": "integer", - "description": "Total number of exports." - } - } - }, - "16_req_create_export_POST": { - "description": "Request schema for creating an export.", - "type": "object", - "title": "Create Export Request Body", - "properties": { - "exported_object": { - "type": "string", - "description": "The type of object to be exported.", - "enum": [ - "order", - "voucher", - "publication", - "redemption", - "customer", - "points_expiration", - "voucher_transactions" - ] - }, - "parameters": { - "anyOf": [ - { - "$ref": "#/components/schemas/16_obj_export_order" - }, - { - "$ref": "#/components/schemas/16_obj_export_voucher" - }, - { - "$ref": "#/components/schemas/16_obj_export_publication" - }, - { - "$ref": "#/components/schemas/16_obj_export_redemption" - }, - { - "$ref": "#/components/schemas/16_obj_export_customer" - }, - { - "$ref": "#/components/schemas/16_obj_export_points_expiration" - }, - { - "$ref": "#/components/schemas/16_obj_export_gift_card_transactions" - }, - { - "$ref": "#/components/schemas/16_obj_export_loyalty_card_transactions" - } - ] - } - } - }, "16_obj_export_order": { "description": "List of available fields and filters that can be exported with an order along with the sorting order of the returned data.", "title": "order", @@ -35111,6 +34756,7 @@ ] }, "LoyaltiesGetEarningRuleResponseBody": { + "title": "Loyalties Get Earning Rule Response Body", "$ref": "#/components/schemas/EarningRule" }, "LoyaltiesEnableEarningRulesResponseBody": { @@ -36637,7 +36283,7 @@ "$ref": "#/components/schemas/RewardTypeCoin" }, { - "$ref": "#/components/schemas/RewardTypeCoin" + "$ref": "#/components/schemas/RewardTypeMaterial" } ] }, @@ -39005,9 +38651,11 @@ } }, "LoyaltiesGetRewardAssignmentResponseBody": { + "title": "Loyalties Get Reward Assignment Response Body", "$ref": "#/components/schemas/RewardAssignment" }, "LoyaltiesGetRewardDetailsResponseBody": { + "title": "Loyalties Get Reward Details Response Body", "$ref": "#/components/schemas/Reward" }, "LoyaltiesListTiersRequestQuery": { @@ -39095,6 +38743,7 @@ } }, "LoyaltiesGetTierResponseBody": { + "title": "Loyalties Get Tier Response Body", "$ref": "#/components/schemas/LoyaltyTier" }, "LoyaltiesListTiersResponseBody": { @@ -63277,7 +62926,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" }, "examples": { "Add points": { @@ -63302,7 +62951,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" }, "examples": { "Add balance": { @@ -63391,7 +63040,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceRequestBody" }, "examples": { "Subtract points": { @@ -63416,7 +63065,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_add_remove_points_balance" + "$ref": "#/components/schemas/LoyaltiesAddOrRemoveCardBalanceResponseBody" }, "examples": { "Subtract Points": { @@ -63500,7 +63149,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_transfer_loyalty_points" + "$ref": "#/components/schemas/LoyaltiesTransferPointsRequestBody" }, "examples": { "Example": { @@ -63525,7 +63174,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_loyalty_card_object_non_expanded_categories" + "$ref": "#/components/schemas/LoyaltiesTransferPointsResponseBody" }, "examples": { "Example": { @@ -63637,7 +63286,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" }, "examples": { "Example": { @@ -63978,7 +63627,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_res_get_loyalty_card_transactions" + "$ref": "#/components/schemas/LoyaltiesListCardTransactionsResponseBody" }, "examples": { "Example": { @@ -64311,7 +63960,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" }, "examples": { "Example": { @@ -64344,7 +63993,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" }, "examples": { "Example": { @@ -64477,7 +64126,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_req_create_loyalty_card_transactions_export" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsRequestBody" }, "examples": { "Example": { @@ -64510,7 +64159,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/8_obj_export_transactions_object" + "$ref": "#/components/schemas/LoyaltiesExportCardTransactionsResponseBody" }, "examples": { "Example": { From 0e790340b04569a703913b36a09966d45c6434cf Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:13:21 +0200 Subject: [PATCH 072/108] removing unused schemas --- reference/OpenAPI.json | 1278 ---------------------------------------- 1 file changed, 1278 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 663959ee6..3f3d3e387 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -21126,1284 +21126,6 @@ } } }, - "1_obj_loyalty_card_transaction_object_redemption": { - "title": "Redemption", - "description": "When loyalty points are used to pay for an order.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a redemption, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "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`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a redemption, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REDEMPTION", - "enum": [ - "POINTS_REDEMPTION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points prior to the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_accrual": { - "title": "Accrual", - "description": "When points are earned on the card through an earning rule.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "event": { - "type": "object", - "description": "Contains information about the event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.order.paid" - } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_accrual_custom_event": { - "title": "Accrual for Custom Event", - "description": "When points are earned on the card through an earning rule based on a custom event.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points accrual, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points accrual, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ACCRUAL", - "enum": [ - "POINTS_ACCRUAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "event": { - "type": "object", - "description": "Contains information about the customer event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "evcus_0c9c21def34e3c05bf" - }, - "type": { - "type": "string", - "description": "Type of event.", - "example": "customer.custom_event" - } - } - }, - "earning_rule": { - "type": "object", - "description": "Contains information about the earning rule.", - "properties": { - "id": { - "type": "string", - "description": "Unique earning rule ID.", - "example": "ern_2WsCIBEx6Lzf5IAV5IOR7a23" - }, - "source": { - "type": "object", - "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." - } - } - } - } - }, - "custom_event": { - "type": "object", - "description": "Contains information about the custom event that triggers the point accrual.", - "properties": { - "id": { - "type": "string", - "description": "Unique event ID.", - "example": "event_0cc916d8374bfe8bc2" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" - } - } - }, - "event_schema": { - "type": "object", - "description": "Contains information about the custom event metadata schema.", - "properties": { - "id": { - "type": "string", - "description": "Unique metadata schema ID.", - "example": "ms_qpRZ3EmRQyszNH6Z52Gkq8au" - }, - "type": { - "type": "string", - "description": "Type of custom event.", - "example": "user_subscribed" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_refund": { - "title": "Refund", - "description": "When points are credited back to a card through a redemption rollback.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points refund, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard. In case of a points refund, this value is `null`." - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points refund, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REFUND", - "enum": [ - "POINTS_REFUND" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "order": { - "type": "object", - "description": "Contains information about the original order.", - "properties": { - "id": { - "type": "string", - "description": "Unique order ID.", - "example": "ord_jj5EzDxDOd2xFPsAJJ18IaZK" - }, - "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." - } - } - }, - "redemption": { - "type": "object", - "description": "Contains information about the original redemption.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption ID.", - "example": "r_0c94ed583fcafc31c1" - } - } - }, - "rollback": { - "type": "object", - "description": "Contains information about the redemption rollback.", - "properties": { - "id": { - "type": "string", - "description": "Unique redemption rollback ID.", - "example": "rr_0c9b0967244a862a33" - } - } - }, - "reward": { - "type": "object", - "description": "Contains information about the pay with points reward.", - "properties": { - "id": { - "type": "string", - "description": "Unique reward ID.", - "example": "rew_INt3fGH3n7xIr3ZQcq4kkUZ1" - }, - "name": { - "type": "string", - "description": "Reward name.", - "example": "100 = $20" - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_addition": { - "title": "Addition", - "description": "When points are added to a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_ADDITION", - "enum": [ - "POINTS_ADDITION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_removal": { - "title": "Removal", - "description": "When points are removed from a card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "voucherify-web-ui", - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_REMOVAL", - "enum": [ - "POINTS_REMOVAL" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_expiration": { - "title": "Expiration", - "description": "When points expire.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a points expiration, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place, whether through the API or the the Dashboard.", - "enum": [ - "Automation" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred. In case of a points expiration, this value is `null`." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_EXPIRATION", - "enum": [ - "POINTS_EXPIRATION" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points removed during 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "This field is `null` in the case of this type of transaction." - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_transfer_out": { - "title": "Transfer Out", - "description": "When points are transferred from one loyalty card to another.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_OUT", - "enum": [ - "POINTS_TRANSFER_OUT" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being subtracted 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", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "destination_voucher": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the destination voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the destination voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the receiving loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. This does not mean that the transferred points were added to this bucket. It only shows the next set of points due to expire. The transferred points are added to the last expiring bucket, i.e. to the bucket of points that are to expire the furthest in the future.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the next expiration date." - } - } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the receiving card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, - "1_obj_loyalty_card_transaction_object_transfer_in": { - "title": "Transfer In", - "description": "When points are transferred in from another loyalty card.", - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique transaction ID.", - "example": "vtx_0c9dccc4d5813e71bd" - }, - "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. In case of a ponits transfer, this value is `null`." - }, - "voucher_id": { - "type": "string", - "description": "Unique voucher ID.", - "example": "v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign if it is part of campaign that generates bulk codes.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "source": { - "type": "string", - "description": "The channel through which the transaction took place.", - "enum": [ - "API" - ] - }, - "reason": { - "type": "string", - "description": "Reason why the transaction occurred." - }, - "type": { - "type": "string", - "description": "Type of transaction.", - "default": "POINTS_TRANSFER_IN", - "enum": [ - "POINTS_TRANSFER_IN" - ] - }, - "details": { - "type": "object", - "description": "Contains the detailed information about the transaction.", - "properties": { - "balance": { - "type": "object", - "description": "Contains information on how the balance was affected by the transaction.", - "properties": { - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "loyalty_card" - }, - "total": { - "type": "integer", - "description": "The available points after the transaction." - }, - "object": { - "type": "string", - "description": "The type of object represented by the JSON.", - "default": "balance" - }, - "points": { - "type": "integer", - "description": "The amount of points being added in the transaction." - }, - "balance": { - "type": "integer", - "description": "The points balance on the loyalty card after the points in the transaction are added to the loyalty card." - }, - "related_object": { - "type": "object", - "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.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "type": { - "type": "string", - "description": "The object being modified, i.e. `voucher`.", - "default": "voucher" - } - } - } - } - }, - "source_voucher": { - "type": "object", - "description": "Contains information on how the balance on the donor loyalty card was affected by the transaction.", - "properties": { - "id": { - "type": "string", - "description": "Identifies the source voucher that is being modified, this is the ID that was assigned by the Voucherify API.", - "example": "v_4Bd3aX7eXjHbe7Ef7on8YsLWBynsT4jq" - }, - "code": { - "type": "string", - "description": "Unique code of the source voucher.", - "example": "LOYALTY-CARD-A8XVurg" - }, - "type": { - "type": "string", - "description": "The type of voucher whose balance is being adjusted due to the transaction.", - "default": "LOYALTY_CARD" - }, - "campaign": { - "type": "string", - "description": "Unqiue campaign name of the voucher's parent campaign." - }, - "holder_id": { - "type": "string", - "description": "Unqiue customer ID of the loyalty card holder, this is the ID that was assigned by the Voucherify API.", - "example": "cust_xqA7DGj5eYPHg6PHVKwYRWiA" - }, - "campaign_id": { - "type": "string", - "description": "Unqiue campaign ID of the voucher's parent campaign.", - "example": "camp_FNYR4jhqZBM9xTptxDGgeNBV" - }, - "loyalty_card": { - "type": "object", - "description": "Contains information on how the balance on the source loyalty card was affected by the transaction.", - "properties": { - "points": { - "type": "integer", - "description": "The total amount of points after 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." - }, - "next_expiration_date": { - "type": "string", - "description": "The date when the next set of points are due to expire, i.e. `YYYY-MM-DD`. The points from the source loyalty card are taken from the expiration bucket(s) that are the first coming up to expire, starting from the first expiration bucket to expire in time. This parameter shows the next expiration date after the points were taken out of the loyalty card.", - "example": "2023-12-31" - }, - "next_expiration_points": { - "type": "integer", - "description": "The number of points due to expire on the expiration date." - } - } - }, - "is_referral_code": { - "type": "integer", - "description": "Flag indicating whether this voucher is a referral code." - } - } - } - } - }, - "related_transaction_id": { - "type": "string", - "description": "The related transaction ID on the source card.", - "example": "vtx_0c9afe802593b34b81" - }, - "created_at": { - "type": "string", - "format": "date-time", - "example": "2022-02-25T13:32:08.734Z", - "description": "Timestamp representing the date and time when the transaction was created in ISO 8601 format." - } - } - }, "8_obj_loyalty_tier_object": { "type": "object", "title": "Loyalty Tier Object", From b302c9c5d883a36a96868457969ae84d4ebca1ce Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:57:04 +0200 Subject: [PATCH 073/108] fix --- reference/OpenAPI.json | 170 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 169 insertions(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 3f3d3e387..44871bafe 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -30675,6 +30675,174 @@ } } }, + "8_obj_earning_rule_object_entered_segment": { + "description": "This is an object representing an earning rule for entering a customer segment.", + "type": "object", + "title": "Earning Rule Object for Entered Segment", + "examples": [ + { + "id": "ern_3HlFKLMNIfBme9lcHwnMwXON", + "created_at": "2022-02-04T13:02:52.937Z", + "updated_at": "2022-02-07T08:19:43.291Z", + "validation_rule_id": null, + "loyalty": { + "points": 1000, + "type": "FIXED" + }, + "segment": { + "id": "seg_WJv55MbzQwnr56ttJ2xUrSgt" + }, + "event": "customer.segment.entered", + "source": { + "banner": "Entered segment 100 points.", + "object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "object_type": "campaign" + }, + "active": true, + "start_date": "2022-02-02T13:00:00.000Z", + "expiration_date": "2022-03-03T14:30:00.000Z", + "validity_timeframe": { + "duration": "PT1H", + "interval": "P1D" + }, + "validity_day_of_week": [ + 1, + 2, + 3, + 4, + 5 + ], + "object": "earning_rule", + "automation_id": "auto_39wqQSScJJbvpzAF611jnrh9" + } + ], + "properties": { + "id": { + "type": "string", + "example": "ern_P6MWOFGsv63sbTaTZBp0IHGK", + "description": "Assigned by the Voucherify API, identifies the earning rule object." + }, + "created_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was created in ISO 8601 format.", + "example": "2022-02-02T13:18:32.557Z", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "description": "Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.", + "example": "2022-02-03T13:09:27.206Z", + "format": "date-time" + }, + "validation_rule_id": { + "type": "string", + "example": "val_248vs7tUjlIE", + "description": "A unique validation rule identifier assigned by the Voucherify API. The validation rule is verified before points are added to the balance." + }, + "loyalty": { + "description": "An object that defines the number of points that will be added to a loyalty card and how the points will be added.\n\n- `FIXED` adds a fixed number of `points`\n- `PROPORTIONAL` adds points proportionally based on a pre-defined ratio", + "oneOf": [ + { + "$ref": "#/components/schemas/8_obj_fixed_points" + }, + { + "$ref": "#/components/schemas/8_obj_calculate_points_proportionally_customer_metadata" + } + ] + }, + "segment": { + "type": "object", + "description": "Contains the id of a customer segment. **Required** for the `customer.segment.entered` option in `event`.", + "properties": { + "id": { + "type": "string", + "description": "Contains a unique identifier of a customer segment. Assigned by the Voucherify API." + } + } + }, + "event": { + "type": "string", + "enum": [ + "customer.segment.entered" + ], + "description": "Defines the event which triggers the earning rule to add points to a loyalty card. \n\n- `customer.segment.entered` an event defined by the Voucherify API corresponding to a customer entering a pre-defined customer segment." + }, + "source": { + "type": "object", + "description": "Contains the custom earning rule name and parent campaign.", + "properties": { + "banner": { + "type": "string", + "example": "Order Paid - You will get 100 points", + "description": "Name of the earning rule. This is displayed as a header for the earning rule in the Dashboard." + }, + "object_id": { + "type": "string", + "example": "camp_Pfja7X91b1GoyH5wnpzCwlP3", + "description": "A unique campaign identifier assigned by the Voucherify API." + }, + "object_type": { + "type": "string", + "default": "campaign", + "description": "Defines the object associated with the earning rule. Defaults to `campaign`." + } + } + }, + "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" + }, + "start_date": { + "type": "string", + "example": "2022-02-02T13:00:00.000Z", + "format": "date-time", + "description": "Start date defines when the earning rule starts to be active. Activation timestamp in ISO 8601 format. Earning rule is *inactive before* this date. If you don't define the start date for an earning rule, it'll inherit the campaign start date by default. " + }, + "expiration_date": { + "type": "string", + "format": "date-time", + "example": "2022-03-03T14:30:00.000Z", + "description": "Expiration date defines when the earning rule expires. Expiration timestamp in ISO 8601 format. Earning rule is *inactive after* this date.If you don't define the expiration date for an earning rule, it'll inherit the campaign expiration date by default." + }, + "validity_timeframe": { + "type": "object", + "description": "Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.", + "properties": { + "duration": { + "type": "string", + "description": "Defines the amount of time an earning rule will be active in ISO 8601 format. For example, an earning rule with a `duration` of `PT1H` will be valid for a duration of one hour.", + "example": "PT1H" + }, + "interval": { + "type": "string", + "description": "Defines the intervening time between two time points in ISO 8601 format, expressed as a duration. For example, an earning rule with an `interval` of `P2D` will be valid every other day.", + "example": "P2D" + } + } + }, + "validity_day_of_week": { + "type": "array", + "description": "Integer array corresponding to the particular days of the week in which the earning rule 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" + } + }, + "object": { + "type": "string", + "default": "earning_rule", + "description": "The type of object represented by JSON. Default is `earning_rule`." + }, + "automation_id": { + "type": "string", + "description": "For internal use by Voucherify.", + "example": "auto_4jH1yq9WJS0oJ8suagCrltyb" + }, + "metadata": { + "type": "object", + "description": "The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format." + } + } + }, "17_res_obj_get_async_action_result_campaign_vouchers_update": { "title": "CAMPAIGN.VOUCHERS_UPDATE", "type": "object", @@ -79766,4 +79934,4 @@ } } } -} \ No newline at end of file +} From 6e3a7d703be7b04f7ba0c54ab3a72793efdd05e4 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Wed, 18 Oct 2023 22:00:12 +0200 Subject: [PATCH 074/108] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dbbb3119e..f06df65b9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ scripts/output/*.md .env .DS_Store .idea/* +/reference/.stoplight/ From cbf96001b94ff4ffc4b75e77617de0ac196f3d6d Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 19 Oct 2023 08:52:57 +0200 Subject: [PATCH 075/108] Update manage-project.ts --- scripts/manage-project.ts | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 0a89ea43f..447afeb6d 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -106,17 +106,19 @@ const runCliProcess = async ({ stdoutIncludes, stderrIncludes, resolveErrorAsFalse = false, + ignoreStdout = false, }: { command: string; stdoutIncludes?: string; stderrIncludes?: string; resolveErrorAsFalse?: boolean; + ignoreStdout?: boolean; }) => { return await new Promise((resolve) => { exec(command, (error, stdout, stderr) => { if ( (stdoutIncludes && stdout?.includes(stdoutIncludes)) || - (!stdoutIncludes && stdout) || + (!ignoreStdout && !stdoutIncludes && stdout) || (stderrIncludes && stderr.includes(stderrIncludes)) ) { return resolve(true); @@ -164,31 +166,11 @@ const uploadOpenApiFile = async (version) => { await runCliProcess({ command: `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, stderrIncludes: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.`, + ignoreStdout: true, }); console.log(colors.green("OPEN API FILE WAS UPLOADED")); }; -const updateReferenceDocs = async (version) => { - return await new Promise((resolve, reject) => { - exec( - `rdme docs ./docs/reference-docs --version=${version}`, - (error, stdout, stderr) => { - if ( - stderr?.includes( - `We couldn't save this doc (Unable to find a category with the slug 'voucherify-api')` - ) - ) { - return resolve(false); - } - if (stdout?.includes("successfully created")) { - return resolve(true); - } - return resolve(false); - } - ); - }); -}; - const createNewVersion = async (version) => { //create fork try { From b4d2b55e3060841ad0d6a867f2a1981a60738a14 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Thu, 19 Oct 2023 09:07:56 +0200 Subject: [PATCH 076/108] Update manage-project.ts --- scripts/manage-project.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 447afeb6d..4002e5099 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -106,19 +106,18 @@ const runCliProcess = async ({ stdoutIncludes, stderrIncludes, resolveErrorAsFalse = false, - ignoreStdout = false, }: { command: string; stdoutIncludes?: string; stderrIncludes?: string; resolveErrorAsFalse?: boolean; - ignoreStdout?: boolean; }) => { return await new Promise((resolve) => { exec(command, (error, stdout, stderr) => { + const stdoutClean = stdout.replace(/.*voucherify/, "").trim(); if ( - (stdoutIncludes && stdout?.includes(stdoutIncludes)) || - (!ignoreStdout && !stdoutIncludes && stdout) || + (stdoutIncludes && stdoutClean?.includes(stdoutIncludes)) || + (!stdoutIncludes && stdoutClean) || (stderrIncludes && stderr.includes(stderrIncludes)) ) { return resolve(true); @@ -166,7 +165,6 @@ const uploadOpenApiFile = async (version) => { await runCliProcess({ command: `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, stderrIncludes: `We're sorry, your upload request timed out. Please try again or split your file up into smaller chunks.`, - ignoreStdout: true, }); console.log(colors.green("OPEN API FILE WAS UPLOADED")); }; 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 077/108] 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 078/108] 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 9b85e6866fb42206f6e475b0d699c46558d8d3e9 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:29:55 +0200 Subject: [PATCH 079/108] update changelog --- Changelog.md | 42 +++++++++++++++++++++++++++++++++++++++++- reference/OpenAPI.json | 4 ++-- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/Changelog.md b/Changelog.md index 198087fb4..cbfd27d67 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,10 +1,50 @@ # Changelog -# 20231017 +# 20231019 - Vouchers - List Gift Card Transactions (**GET** `/vouchers/{code}/transactions`) renamed to List Voucher Transactions - Vouchers - Export Gift Card Transactions (**GET** `/vouchers/{code}/transactions/export`) renamed to Export Voucher Transactions +**New models** +- vouchers_list_vouchers_transactions_response_body (old `1_res_vouchers_code_transactions`) +- voucher_transaction (old `1_obj_gift_card_transaction_object`) +- gift_card_transaction +- gift_card_transaction_identity +- gift_card_transaction_base +- gift_card_transaction_created +- gift_card_transaction_details +- gift_card_transaction_redemption_details (old `1_obj_gift_card_transaction_object_redemption`) +- gift_card_transaction_refund_details (old `1_obj_gift_card_transaction_object_refund`) +- gift_card_transaction_addition_details (old `1_obj_gift_card_transaction_object_addition`) +- gift_card_transaction_removal_details (old `1_obj_gift_card_transaction_object_removal`) + +- vouchers_export_transactions_request_body (old `1_req_create_gift_card_transactions_export` +- voucher_transactions_export (old `1_obj_export_transactions_object`) +- voucher_transactions_export_parameters (old `1_obj_export_gift_card_transactions`) +- voucher_transactions_filters (old `16_obj_export_gift_card_transactions`) +- voucher_transactions_export_filter_conditions (old `16_obj_filter_gift_card_transactions_voucher_id`) + +- validation_rules_list_rules_assignments_response_body (old `13_res_validation-rules_validationRuleId_assignments`) +- validation_rule_assignment (old `13_obj_validation_rule_assignment_object`) + +**Removed models** +- `8_obj_export_loyalty_card_transactions` - used only in one place, replaced with: `voucher_transactions_export_parameters` in `8_req_create_loyalty_card_transactions_export` schema + +**Endpoint changes** + +GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query)) +POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body)) +GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId)) + +- Added missing method for endpoint: GET `/vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))` + - Response body schema: `vouchers_list_vouchers_transactions_response_body` + +- Added missing method for endpoint: POST `/vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body))` + - Request body schema: `vouchers_export_transactions_request_body` + +- Added missing method for endpoint: GET `/validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId))` + - Request body schema: `validation_rules_list_rules_assignments_response_body` + ## 20231012 - Product Collections **New models** diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index e626c3ae6..1a2a5921d 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3944,7 +3944,7 @@ "$ref": "#/components/schemas/gift_card_transaction_base" }, { - "$ref": "#/components/schemas/gift_card_transaction_response_data" + "$ref": "#/components/schemas/gift_card_transaction_created" }, { "$ref": "#/components/schemas/gift_card_transaction_details" @@ -4012,7 +4012,7 @@ "related_transaction_id" ] }, - "gift_card_transaction_response_data": { + "gift_card_transaction_created": { "type": "object", "title": "Gift Card Transaction Response Data", "properties": { From f5e044572366f22edb2ce5e1f925a81ebcfb4cea Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:31:00 +0200 Subject: [PATCH 080/108] Update Changelog.md --- Changelog.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Changelog.md b/Changelog.md index cbfd27d67..66fe5d037 100644 --- a/Changelog.md +++ b/Changelog.md @@ -32,10 +32,6 @@ **Endpoint changes** -GET /vouchers/{code}/transactions (client.vouchers.listTransactions(code, query)) -POST /vouchers/{code}/transactions/export (client.vouchers.exportTransactions(code, body)) -GET /validation-rules-assignments (client.client.validationRules.listRulesAssignments(validationRuleId)) - - Added missing method for endpoint: GET `/vouchers/{code}/transactions (client.vouchers.listTransactions(code, query))` - Response body schema: `vouchers_list_vouchers_transactions_response_body` From ad6f4cfcbe3024d5b6db96a1919e9c5ea0c5b343 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:02:17 +0200 Subject: [PATCH 081/108] fix typo --- reference/OpenAPI.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 1a2a5921d..517a367a7 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -81828,7 +81828,7 @@ "VALIDATION RULES API" ], "summary": "List Validation Rules' Assignment(s)", - "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validaiton rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", + "description": "List all validation rules' assignments or filter the results using the related object ID or the validation rule ID query parameters. \n\n## How to retrieve specific validation rule assignments(s)\n\n### Related object ID\n\nTo find an assignment for a particular resource, you can use the ID of the object to which the validation rule was assigned. This could be, for example, an ID of a: voucher, campaign, distribution, reward assignment, earning rule, promotion tier. \n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?related_object_id=promo_kJliy076IuJYtuYWSHE9fSuT\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_tZaqxeO8gP4q91jG\",\n \"rule_id\": \"val_WB6ETAiFztw5\",\n \"related_object_id\": \"promo_kJliy076IuJYtuYWSHE9fSuT\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-08-10T10:30:39.986Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 1\n}\n```\n\n### Validation rule ID\n\nYou can use the validation rule ID to find assignment(s) for a specific validation rule.\n\n\n\n```curl\ncurl -X GET \\\n -H \"X-App-Id: c70a6f00-cf91-4756-9df5-47628850002b\" \\\n -H \"X-App-Token: 3266b9f8-e246-4f79-bdf0-833929b1380c\" \\\n -H \"Content-Type: application/json\" \\\n https://api.voucherify.io/v1/validation-rules-assignments?rule=val_ZEZmA9oit8aU\n```\n\n```json\n{\n \"object\": \"list\",\n \"data_ref\": \"data\",\n \"data\": [\n {\n \"id\": \"asgm_vef0G6d9Al0rABxq\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"camp_rRsfatlwN7unSeUIJDCYedal\",\n \"related_object_type\": \"campaign\",\n \"created_at\": \"2022-06-29T11:43:52.953Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_sFV4wEFvldwIvgfb\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"distr_9QKI02wqgjWyvZXeQkFEPmkkYe\",\n \"related_object_type\": \"distribution\",\n \"created_at\": \"2022-06-29T11:41:07.680Z\",\n \"object\": \"validation_rules_assignment\"\n },\n {\n \"id\": \"asgm_69Qifyv6UZynFIIQ\",\n \"rule_id\": \"val_ZEZmA9oit8aU\",\n \"related_object_id\": \"promo_g83qUzYZpfX0OMAFOVoQuOYG\",\n \"related_object_type\": \"promotion_tier\",\n \"created_at\": \"2022-06-29T11:29:41.906Z\",\n \"object\": \"validation_rules_assignment\"\n }\n ],\n \"total\": 3\n}\n```\n", "parameters": [ { "schema": { From 7f3112caff20bfc3eca0b2ca3694af43e9878ada Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:34:29 +0200 Subject: [PATCH 082/108] update scripts --- 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 97c6ce8c8c7f7110d319e93e550d6a0866599ab0 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:34:42 +0200 Subject: [PATCH 083/108] fix operationId --- reference/OpenAPI.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 517a367a7..e5be0bdc3 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -47735,7 +47735,7 @@ } ], "get": { - "operationId": "list-gift-card-transactions", + "operationId": "list-voucher-transactions", "tags": [ "VOUCHERS API" ], 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 084/108] 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 085/108] 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 086/108] 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 dc3f2106a1969df858b896a817ad609d66b77a34 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Thu, 19 Oct 2023 17:13:59 +0200 Subject: [PATCH 087/108] update descriptions --- reference/OpenAPI.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index e5be0bdc3..fd25b7729 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -4573,7 +4573,7 @@ "enum": [ "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id" ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_CANCELLATION`
                                  - `POINTS_REDEMPTION`
                                  - `POINTS_REFUND`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_EXPIRATION`
                                  - `POINTS_TRANSFER_IN`
                                  - `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "items": { "type": "string" } @@ -4583,7 +4583,7 @@ "voucher_transactions_export": { "title": "Export", "type": "object", - "description": "This is an object representing an export. \n\n Using this endpoint, you can export [gift card transactions](ref:list-gift-card-transactions) as a CSV file. This functionality works asynchronously and comes down to the following steps: \n* create an export object and return its `id` so you can track its `status`\n* trigger a CSV file generation, change the status to `SCHEDULED`\n* when the generation is over, store the file in S3 and change the `status` to `DONE`\n* now you can (ref:download-export) it\n\nWith `parameters` you can select which `fields` will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", + "description": "This is an object representing an export. \n\n Using this endpoint, you can export voucher transactions as a CSV file. This functionality works asynchronously and comes down to the following steps: create an export object and return its id so you can track its status, trigger a CSV file generation, change the status to SCHEDULED when the generation is over, store the file in S3 and change the status to DONE. Now you can download it.\n\nWith parameters you can select which fields will be exported. An export request will almost always result in a single file being generated by the system. However, when your volume of data is large, the system may split the results into multiple chunks.", "properties": { "id": { "type": "string", @@ -34763,7 +34763,7 @@ "validation_rule_assignment": { "title": "Validation Rule Assignment", "type": "object", - "description": "This is an object representing a validation rule assignment. \n\nThis object stores an assignment of a: \n- [voucher](ref:get-voucher)\n- [campaign](ref:get-campaign)\n- [earning rule](ref:get-earning-rule)\n- [reward assignment](ref:get-reward-assignment)\n- [promotion tier](ref:list-promotion-tiers)\n- [publication](ref:list-publications)", + "description": "This is an object representing a validation rule assignment.", "x-tags": [ "VALIDATION RULES API" ], @@ -35767,7 +35767,7 @@ "enum": [ "id,type,source_id,reason,balance,amount,created_at,voucher_id,campaign_id,source,details,related_transaction_id" ], - "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "description": "Array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_CANCELLATION`
                                  - `POINTS_REDEMPTION`
                                  - `POINTS_REFUND`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_EXPIRATION`
                                  - `POINTS_TRANSFER_IN`
                                  - `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "items": { "type": "string" } @@ -48045,7 +48045,7 @@ } ], "summary": "Export Voucher Transactions", - "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", + "description": "Export transactions that are associated with credit movements on a gift card or loyalty card.\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_CANCELLATION`
                                  - `POINTS_REDEMPTION`
                                  - `POINTS_REFUND`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_EXPIRATION`
                                  - `POINTS_TRANSFER_IN`
                                  - `POINTS_TRANSFER_OUT` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |", "requestBody": { "description": "Specify the parameters for the transaction export.", "content": { @@ -83675,7 +83675,7 @@ "EXPORTS API" ], "summary": "Create Export", - "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                                  `GIFT_VOUCHER`: amount left to spend
                                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card balance after the transaction. | |\n| amount | The amount of gift card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_TRANSFER_OUT`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_REFUND`
                                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                                  - `voucherify-web-ui`
                                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", + "description": "Create export object. The export can be any of the following types: `voucher`, `redemption`, `publication`, `customer`, `order`, `points_expiration`, or `voucher_transactions`. \n\n## Defaults\n\nIf you only specify the object type in the request body without specifying the fields, the API will return the following fields per export object:\n\n| **Export Object** | **Default fields returned** |\n|:---|:---|\n| order | `id`, `source_id`, `status` |\n| voucher | `code`, `voucher_type`, `value`, `discount_type` |\n| publication | `code`, `customer_id`, `date`, `channel` |\n| redemption | `id`, `object`, `voucher_code`, `customer_id`, `date`, `result` |\n| customer | `name`, `source_id` |\n| points_expiration | `id`, `campaign_id`, `voucher_id`, `status`, `expires_at`, `points` |\n| voucher_transactions | `id`, `type`, `source_id`, `status`, `reason`, `source`, `balance`, `amount`, `created_at` |\n\n\n## Fetching particular data sets\n\nUsing the `parameters` body parameter, you can narrow down which fields to export and how to filter the results. The fields are an array of strings containing the data that you would like to export. These fields define the headers in the CSV file. The array can be a combintation of any of the following available fields:\n\n## Orders \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique order ID. | ord_A69RIxEdRsPuC6i8gFGVHUft |\n| source_id | Unique order source ID. | 8638 |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the order was created. | 2022-03-09T09:16:32.521Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the order was last updated. | 2022-03-09T09:16:33.331Z |\n| status | Order status. | `PAID`, `CREATED`, `FULFILLED`, `CANCELED` |\n| amount | Total amount of order items. | 7700 |\n| discount_amount | Represents total amount of the discount applied to whole cart. | 500 |\n| items_discount_amount | Represents total amount of the discount applied to order line items. | 100 |\n| total_discount_amount | All discounts applied to the order including discounts applied to particular order line items and discounts applied to the whole cart. | 600 |\n| total_amount | Total order amount after applying all discounts. | 7100 |\n| customer_id | Customer unique ID. | cust_2G4fUQdCXUqp35nXNleav7bO |\n| referrer_id | Referrer unique ID. | cust_IkrTR674vvQvr9a4rDMiqglY |\n| metadata | Order metadata; expressed as metadata.X, where X is the name of the custom metadata property. | 1 |\n\n## Vouchers \n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique voucher ID. | v_HSnGD2vNIHYighTQxwcB4dtVAv8VOmZD |\n| code | Unique voucher code. | WELCOME100 |\n| voucher_type | Type of voucher. | `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD` |\n| value | Value of voucher. | `DISCOUNT_VOUCHER` : amount, percent, unit
                                  `GIFT_VOUCHER`: amount left to spend
                                  `LOYALTY_CARD`: available usable points |\n| discount_type | The type of discount for a `DISCOUNT_VOUCHER`. | `AMOUNT`, `PERCENT`, `UNIT`, `FIXED` |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| category | Tag defining the category that this voucher belongs to. | |\n| start_date | Start date defines when the code starts to be active. Activation timestamp in ISO 8601 format. Voucher is _inactive_ before this date. | 2020-12-10T23:00:00.000Z |\n| expiration_date | Expiration date defines when the code expires. Expiration timestamp in ISO 8601 format. Voucher is _inactive_ after this date. | 2023-12-31T23:00:00.000Z |\n| gift_balance | Amount left to spend. | 1000 |\n| loyalty_balance | Available usable points. | 2000 |\n| redemption_quantity | Maximum number of times a voucher can be redeemed. | 2 |\n| redemption_count | Total redemptions. | 59 |\n| active | Boolean indicating whether the voucher is available for use. | `true`, `false` |\n| qr_code | URL to QR representation of encrypted code. | |\n| bar_code | URL to barcode representation of encrypted code. | |\n| metadata | Custom voucher metadata. | |\n| is_referral_code | Boolean indicating whether the voucher is a referral code. | `true`, `false` |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the voucher was created. | 2022-04-14T09:55:46.814Z |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the voucher was last updated. | 2022-04-14T10:02:18.036Z |\n| validity_timeframe_interval | 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. | P2D |\n| validity_timeframe_duration | 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. | PT1H |\n| validity_day_of_week | Array corresponding to the particular days of the week in which the voucher is valid. | \"1,2,3,4,5\" |\n| discount_amount_limit | For `PERCENT` discount type, this is the maximum threshold allowed to be deducted. | 50 |\n| campaign_id | Parent campaign ID. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| additional_info | An optional field to keep any extra textual information about the code such as a code description and details. | |\n| customer_id | Unique customer ID of the assigned owner to whom the voucher was published. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| discount_unit_type | For `UNIT` discount type, either a shipping or product ID for a `UNIT` discount with one product. | prod_5h1pp1ng, prod_0a9f9aeddb019a42db |\n| discount_unit_effect | `UNIT` discount effect. | `ADD_MANY_ITEMS`, `ADD_MISSING_ITEMS`,`ADD_NEW_ITEMS` |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n\n\n## Publications\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| voucher_code | Unique voucher code. | WELCOME100 |\n| customer_id | Customer unique ID. | cust_7iUa6ICKyU6gH40dBU25kQU1 |\n| customer_source_id | Unique customer source id of the assigned owner to whom the voucher was published. | name.lastname@email.com |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was published. | 2022-04-28T10:19:30.792Z |\n| channel | Publication channel. | voucherify-website |\n| campaign | Unique campaign name. | Summer Discounts 20% off |\n| is_winner | | |\n| metadata | Custom publication metadata. | |\n\n## Redemptions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique redemption ID. | r_0acf3a6dae00e679c8, rf_0acf3a495740e679b8 |\n| object | Object being exported; by default `redemption`. | redemption |\n| date | Timestamp in ISO 8601 format representing the date and time when the voucher was redeemed. | 2022-03-23T08:52:24.867Z |\n| voucher_code | Unique voucher code redeemed. | WELCOME100 |\n| campaign | Parent campaign name of voucher if applicable. | Summer Discounts 20% off |\n| promotion_tier_id | | promo_Mwy9XpA0TLctSGriM5kum0qp |\n| customer_id | Unique customer ID of redeeming customer. | cust_nk0N1uNQ1YnupAoJGOgvsODC |\n| customer_source_id | Unique source ID of redeeming customer. | name.lastname@email.com |\n| customer_name | Customer name. | John Smith |\n| tracking_id | | track_Pw6r3ejnml43kIwNS4Zj09KZ67xOfLUy |\n| order_amount | Total order amount before applying all discounts. | 1000 |\n| gift_amount | Gift credits used for redemption. | 10 |\n| loyalty_points | | 12 |\n| result | Tells you whether the redemption succeeded. | `SUCCESS`, `FAILURE` |\n| failure_code | Internal Voucherify code for reason why redemption failed. | invalid_customer |\n| failure_message | A human-readable message providing a short description explaining why the redemption failed. | Customer must be a holder of a loyalty card. |\n| metadata | Custom redemption metadata. | |\n\n## Customers\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| name | Customer name. | John Smith |\n| id | Unique customer ID. | cust_J1CDUdbqn5Exva8ASWk1Fq0j |\n| description | An arbitrary string that you can attach to a customer object. | Customer requesting to be added to VIP tier. |\n| email | Customer's email. | name.lastname@email.com |\n| source_id | Unique custom customer identifier. | name.lastname@email.com |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the customer was created. | 2022-02-03T13:10:11.928Z |\n| address_city | City | Houston |\n| address_state | State | TX |\n| address_line_1 | First line of customer's address. | 72738 Main St |\n| address_line_2 | Second line of customer's address. | Bld 2, Apt 4 |\n| address_country | Country | United States of America |\n| address_postal_code | Postal code (ZIP code) | 77042-4143 |\n| redemptions_total_redeemed | Total customer redemptions. | 5 |\n| redemptions_total_failed | Total customer failed redemptions. | 2 |\n| redemptions_total_succeeded | Total customer succeeded redemptions. | 3 |\n| redemptions_total_rolled_back | Total customer redemptions that were rolled back. | 3 |\n| redemptions_total_rollback_failed | Total customer redemptions that were unsuccessfully rolled back. | 2 |\n| redemptions_total_rollback_succeeded | Total customer redemptions that were successfully rolled back. | 1 |\n| orders_total_amount | Total sum of order amounts over customer lifetime. Value is multiplied by 100 to precisely represent 2 decimal places. | 10000 (represents $100) |\n| orders_total_count | Total number of customer orders. | 2 |\n| orders_average_amount | Average amount spent on orders. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_amount | How much did the customer spend on their last order. Value is multiplied by 100 to precisely represent 2 decimal places. | 5000 (represents $50) |\n| orders_last_order_date | When was the last customer order; timestamp in ISO 8601 format representing the date and time. | 2022-02-03T13:17:30.630Z |\n| loyalty_points | Sum of customer's loyalty points to go across all loyalty cards. | 2000 |\n| loyalty_referred_customers | How many customers were referred by this customer. | 3 |\n| updated_at | Timestamp in ISO 8601 format representing the date and time when the customer was updated. | 2022-02-14T14:10:14.305Z |\n| phone | Customer's phone number. | +1 (294) 752-1846 |\n| birthday | Customer's birthday. | 2022-01-01 |\n| metadata | Customer metadata. | All metadata fields defined in Metadata Schema for the Customer object. |\n| birthdate | Customer's birthdate. | 2022-01-01 |\n\n## Points Expirations\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Loyalty points bucket ID. | lopb_Wl1o3EjJIHSNjvO5BDLy4z1n |\n| campaign_id | Campaign ID of the parent loyalty campaign. | camp_7s3uXI44aKfIk5IhmeOPr6ic |\n| voucher_id | Voucher ID of the parent loyalty card. | v_YLn0WVWXSXbUfDvxgrgUbtfJ3SQIY655 |\n| status | Status of the loyalty points bucket. | `ACTIVE` or `INACTIVE` |\n| expires_at | Timestamp in ISO 8601 format representing the date when the points expire. | 2022-06-30 |\n| points | Number of points. | 1000 |\n\n ## Gift Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `CREDITS_REMOVAL`
                                  - `CREDITS_ADDITION`
                                  - `CREDITS_REFUND`
                                  - `CREDITS_REDEMPTION` |\n| source_id | Unique transaction source ID. | 8638 |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The gift card or loyalty card balance after the transaction. | |\n| amount | The amount of gift card or loyalty card credits being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | API |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n\n ## Loyalty Card Transactions\n\n| **Field** | **Definition** | **Example Export** |\n|:---|:---|:---|\n| id | Unique transaction ID assigned by Voucherify. | vtx_0cb7811f1c07765800 |\n| type | Transaction type. | - `POINTS_EXPIRATION`
                                  - `POINTS_ADDITION`
                                  - `POINTS_REMOVAL`
                                  - `POINTS_TRANSFER_OUT`
                                  - `POINTS_ACCRUAL`
                                  - `POINTS_REFUND`
                                  - `POINTS_REDEMPTION` |\n| source_id | Custom source ID of the transaction if one was included originally. | source_id_custom |\n| reason | Contains the reason for the transaction if one was included originally. | |\n| balance | The loyalty card balance after the transaction. | |\n| amount | The amount of loyalty points being allocated during the transaction. This value can either be negative or positive depending on the nature of the transaction. | |\n| created_at | Timestamp in ISO 8601 format representing the date and time when the transaction was created. | 2022-03-09T09:16:32.521Z |\n| voucher_id | Unique Voucher ID. | v_dky7ksKfPX50Wb2Bxvcoeb1xT20b6tcp |\n| campaign_id | Parent campaign ID. | camp_FNYR4jhqZBM9xTptxDGgeNBV |\n| source| Channel through which the transaction was initiated. | - `API`
                                  - `voucherify-web-ui`
                                  - `Automation` |\n| details | More detailed information stored in the form of a JSON. | Provides more details related to the transaction in the form of an object. |\n| related_transaction_id | Unique transaction ID related to a receiver/donor card in the case of a points transfer from/to another card. | vtx_0c9afe802593b34b80 |", "parameters": [], "security": [ { From c916ae2c2a92603dcd8b8379be0fac1e30aa545f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:12:56 +0200 Subject: [PATCH 088/108] fix wrong request body for export --- reference/OpenAPI.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index fd25b7729..8fda84970 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -4550,7 +4550,7 @@ "description": "Request body schema for **POST** `/vouchers/transactions/export`.", "properties": { "parameters": { - "$ref": "#/components/schemas/voucher_transactions_export", + "$ref": "#/components/schemas/voucher_transactions_export_parameters", "description": "Contains the parameters that define the data to be exported." } } From c9334d65c2cc1ae257d524873a13c5964afced42 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:16:31 +0200 Subject: [PATCH 089/108] fix typos --- reference/OpenAPI.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 8fda84970..5b48d9776 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -36042,7 +36042,7 @@ } }, "16_obj_filter_points_expiration_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", + "description": "Filter conditions set on the `voucher_id`.", "title": "Filter by voucher ID", "type": "object", "properties": { @@ -36055,7 +36055,7 @@ } }, "voucher_transactions_export_filter_conditions": { - "description": "Filter conditions set on`the `voucher_id`.", + "description": "Filter conditions set on the `voucher_id`.", "title": "Filter by voucher ID", "type": "object", "properties": { @@ -36071,7 +36071,7 @@ ] }, "16_obj_filter_loyalty_card_transactions_voucher_id": { - "description": "Filter conditions set on`the `voucher_id`.", + "description": "Filter conditions set on the `voucher_id`.", "title": "Filter by voucher ID", "type": "object", "properties": { From 996f9b640f4351daf95ed433d7f56238f1c77081 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 09:34:15 +0200 Subject: [PATCH 090/108] add type array to data --- reference/OpenAPI.json | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 5b48d9776..0259e825d 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3906,6 +3906,7 @@ "description": "Identifies the name of the attribute that contains the array of transaction objects." }, "data": { + "type": "array", "$ref": "#/components/schemas/voucher_transaction", "description": "A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object." }, 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 091/108] 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": { From 4c6a443a857653a0707f960a1b8c5c275cdc1b5f Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:22:01 +0200 Subject: [PATCH 092/108] update gift card transactions --- reference/OpenAPI.json | 102 ++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 32 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 0259e825d..3f9d64e16 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -3937,20 +3937,76 @@ "gift_card_transaction": { "title": "Gift Card Transaction", "description": "List of gift card transactions", - "allOf": [ - { - "$ref": "#/components/schemas/gift_card_transaction_identity" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_base" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_created" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_details" - } - ] + "anyOf": [ + { + "title": "Redemption", + "allOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_identity" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_base" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_created" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_redemption_details" + } + ] + }, + { + "title": "Refund", + "allOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_identity" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_base" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_created" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_refund_details" + } + ] + }, + { + "title": "Addition", + "allOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_identity" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_base" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_created" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_addition_details" + } + ] + }, + { + "title": "Removal", + "allOf": [ + { + "$ref": "#/components/schemas/gift_card_transaction_identity" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_base" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_created" + }, + { + "$ref": "#/components/schemas/gift_card_transaction_removal_details" + } + ] + } + ] }, "gift_card_transaction_identity": { "type": "object", @@ -4028,24 +4084,6 @@ "created_at" ] }, - "gift_card_transaction_details": { - "type": "object", - "anyOf": [ - { - "$ref": "#/components/schemas/gift_card_transaction_redemption_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_refund_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_addition_details" - }, - { - "$ref": "#/components/schemas/gift_card_transaction_removal_details" - } - ], - "title": "Gift Card Transaction Details" - }, "gift_card_transaction_redemption_details": { "title": "Redemption", "description": "When credits are used to pay for an order.", From c9e95c563502137b5fe6186b1314b640ebc334b8 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:45:14 +0200 Subject: [PATCH 093/108] update type of object --- reference/OpenAPI.json | 1 + 1 file changed, 1 insertion(+) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 1fb53e633..55e56823e 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -35043,6 +35043,7 @@ "format": "date-time" }, "object": { + "type": "string", "default": "validation_rules_assignment", "description": "The type of object represented by the ID.", "enum": [ From 683f3f16a487030c61bbe40a61489a38246072a8 Mon Sep 17 00:00:00 2001 From: weronika-kurczyna <117282008+weronika-kurczyna@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:46:25 +0200 Subject: [PATCH 094/108] object: type - string update reference-docs --- docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md | 2 +- docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md | 2 +- .../STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md | 2 +- .../VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md index d909455cb..76c0acee2 100644 --- a/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md +++ b/docs/reference-docs/CAMPAIGNS-API-Campaign-Object.md @@ -219,7 +219,7 @@ order: 1 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | +| object
                                  `string` |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md index c60c6e87e..70f2bd04c 100644 --- a/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md +++ b/docs/reference-docs/PROMOTIONS-API-Promotion-Tier-Object.md @@ -109,7 +109,7 @@ order: 1 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | +| object
                                  `string` |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md index 99e03545e..16286956c 100644 --- a/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md +++ b/docs/reference-docs/STACKABLE-DISCOUNTS-API-Stackable-Redemptions-Object.md @@ -419,7 +419,7 @@ One of: | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | +| object
                                  `string` |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { diff --git a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md index 239083436..e1f42bf89 100644 --- a/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md +++ b/docs/reference-docs/VALIDATION-RULES-API-Validation-Rule-Assignment-Object.md @@ -16,7 +16,7 @@ order: 2 | related_object_id
                                  `string` |

                                  The resource ID to which the validation rule was assigned.

                                  **Example:**

                                  v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT

                                  | | related_object_type
                                  `string` |

                                  The type of resource to which the validation rule was assigned.

                                  Available values: `voucher`, `campaign`, `earning_rule`, `reward_assignment`, `promotion_tier`, `distribution` | | created_at
                                  `string` |

                                  Timestamp representing the date and time when the validation rule assignment was created in ISO 8601 format.

                                  **Example:**

                                  2022-02-17T08:18:15.085Z

                                  | -| object |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | +| object
                                  `string` |

                                  The type of object represented by the ID.

                                  Available values: `validation_rules_assignment` | [block:html] { From ddfc34e596cf654a633e0deda41abd7770708e13 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:30:28 +0200 Subject: [PATCH 095/108] Update OpenAPI.json --- reference/OpenAPI.json | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index 96c2613b3..cc71a071f 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -34071,9 +34071,6 @@ }, "PromotionsStacksGetResponseBody": { "$ref": "#/components/schemas/PromotionStack", - "x-stoplight": { - "id": "yo10kdxqlepqn" - }, "title": "Promotions Stacks Get Response Body" }, "PromotionsStacksUpdateRequestBody": { @@ -38336,10 +38333,10 @@ "type": "object", "properties": { "reward": { - "$ref": "#/components/schemas/Reward" + "$ref": "#/components/schemas/reward" }, "assignment": { - "$ref": "#/components/schemas/RewardAssignment" + "$ref": "#/components/schemas/reward_assignment" }, "object": { "type": "string", @@ -47975,7 +47972,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/PromotionsStacksGetResponseBody" + "$ref": "#/components/schemas/PromotionStack" }, "examples": { "Example": { From 625530b03d1e6fc6a974ed6b4282a6a63a547283 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:20:09 +0200 Subject: [PATCH 096/108] tsconfig --- scripts/manage-project.ts | 202 +++++++++++++++++++------------------- tsconfig.json | 5 +- 2 files changed, 105 insertions(+), 102 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 7e0c4739e..9ab2434eb 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -11,7 +11,7 @@ const { create, update } = options; const help = options.help || options.h; const mainVersion = "v2018-08-01"; const version = - versionOption || versionTag ? `${mainVersion}-${versionTag}` : undefined; + versionOption || versionTag ? `${mainVersion}-${versionTag}` : undefined; const listOfGuideCategories = [ "Getting started", @@ -26,11 +26,11 @@ const listOfGuideCategories = [ const listOfReferenceCategories = ["Introduction"]; const main = async ({ - help, - version, - create, - update, - }: { + help, + version, + create, + update, +}: { help?: boolean; version?: string; create?: boolean; @@ -44,9 +44,9 @@ const main = async ({ await createNewVersion(version); } else if (!(await isVersionExists(version))) { console.log( - colors.red( - `Version ${version} does not exist! Create it first. Use parameter --update instead of --create` - ) + colors.red( + `Version ${version} does not exist! Create it first. Use parameter --update instead of --create` + ) ); return; } @@ -57,30 +57,30 @@ const main = async ({ await uploadGuideFiles(version); await uploadReferenceDocsWithMaxNumberOfAttempts(version); console.log( - colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) + colors.green(`\n\nDONE!\nVisit: https://docs.voucherify.io/${version}/`) ); }; const isVersionExists = async (version: string) => { return ( - ( - await fetch( - `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, - { - method: "GET", - headers: { - "x-readme-version": version, - authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), - }, - } - ) - ).status === 200 + ( + await fetch( + `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).status === 200 ); }; const uploadReferenceDocsWithMaxNumberOfAttempts = async ( - version, - maxNumberOfUploadingAttempts = 3 + version, + maxNumberOfUploadingAttempts = 3 ) => { console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { @@ -102,11 +102,11 @@ const uploadReferenceDocsWithMaxNumberOfAttempts = async ( }; const runCliProcess = async ({ - command, - stdoutIncludes, - stderrIncludes, - resolveErrorAsFalse = false, - }: { + command, + stdoutIncludes, + stderrIncludes, + resolveErrorAsFalse = false, +}: { command: string; stdoutIncludes?: string; stderrIncludes?: string; @@ -116,14 +116,14 @@ const runCliProcess = async ({ exec(command, (error, stdout, stderr) => { const stdoutClean = stdout.replace(/.*voucherify/, "").trim(); if ( - (stdoutIncludes && stdoutClean?.includes(stdoutIncludes)) || - (!stdoutIncludes && stdoutClean) || - (stderrIncludes && stderr.includes(stderrIncludes)) + (stdoutIncludes && stdoutClean?.includes(stdoutIncludes)) || + (!stdoutIncludes && stdoutClean) || + (stderrIncludes && stderr.includes(stderrIncludes)) ) { return resolve(true); } if (stderr) { - console.log("Error: \n", stderr) + console.log("Error: \n", stderr); } if (resolveErrorAsFalse) { return resolve(false); @@ -159,9 +159,9 @@ const buildMdTables = async () => { const uploadOpenApiFile = async (version) => { console.log( - colors.green( - "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" - ) + colors.green( + "UPLOADING OPEN API FILE... PLEASE WAIT... THIS MAY TAKE UP TO A MINUTE" + ) ); await runCliProcess({ command: `rdme openapi ./reference/OpenAPI.json --version=${version} --create`, @@ -191,13 +191,13 @@ const createNewVersion = async (version) => { }); if (response.status !== 200) { throw new Error( - `Response status: ${response.status}, maybe this versionTag is already created?` + `Response status: ${response.status}, maybe this versionTag is already created?` ); } console.log(colors.green(`FORK CREATED! VERSION "${version}"`)); } catch (error) { console.log(colors.red(`Error while creating fork from ${mainVersion}!`)), - error; + error; throw new Error(error); } }; @@ -206,8 +206,8 @@ const cleanProject = async (version) => { const categoriesToDelete = await getAllCategories(version); //delete all categories await asyncMap( - categoriesToDelete, - async (category) => await deleteCategory(version, category.slug) + categoriesToDelete, + async (category) => await deleteCategory(version, category.slug) ); console.log(colors.green(`OLD CATEGORIES DELETED!`)); //create categories one by one (creation order is important) @@ -221,17 +221,19 @@ const cleanProject = async (version) => { const allCategories = await getAllCategories(version); //update reference categories types await asyncMap( - listOfReferenceCategories, - async (categoryTitle) => - await updateCategory( - version, - allCategories.find((category) => category.title === categoryTitle).slug, - { type: "reference" } - ) + listOfReferenceCategories, + async (categoryTitle) => + await updateCategory( + version, + allCategories.find((category) => category.title === categoryTitle).slug, + { type: "reference" } + ) ); console.log(colors.green(`REFERENCE CATEGORIES UPDATED!`)); const allApiSpecifications = await getAllApiSpecifications(version); - await asyncMap(allApiSpecifications, (apiSpecification) => deleteSpecification(apiSpecification.id)); + await asyncMap(allApiSpecifications, (apiSpecification) => + deleteSpecification(apiSpecification.id) + ); console.log(colors.green(`API SPECIFICATIONS DELETED!`)); console.log(colors.green(`VERSION "${version}" IS CLEANED UP!`)); return; @@ -251,18 +253,18 @@ const updateCategory = async (version, slug, data = {}) => { }; const getAllCategories = async (version) => - await ( - await fetch( - `https://dash.readme.com/api/v1/categories?perPage=100&page=1`, - { - method: "GET", - headers: { - "x-readme-version": version, - authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), - }, - } - ) - ).json(); + await ( + await fetch( + `https://dash.readme.com/api/v1/categories?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).json(); const deleteCategory = async (version, slug) => { await fetch(`https://dash.readme.com/api/v1/categories/${slug}`, { @@ -289,18 +291,18 @@ const createCategory = async (version, title) => { }; const getAllApiSpecifications = async (version) => - await ( - await fetch( - `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, - { - method: "GET", - headers: { - "x-readme-version": version, - authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), - }, - } - ) - ).json(); + await ( + await fetch( + `https://dash.readme.com/api/v1/api-specification?perPage=100&page=1`, + { + method: "GET", + headers: { + "x-readme-version": version, + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ) + ).json(); const deleteSpecification = async (id) => { await fetch(`https://dash.readme.com/api/v1/api-specification/${id}`, { @@ -317,11 +319,11 @@ const asyncMap = (arr, asyncFn) => { }; const validateOptions = ({ - help, - version, - create, - update, - }: { + help, + version, + create, + update, +}: { help?: boolean; version?: string; create?: boolean; @@ -333,25 +335,25 @@ const validateOptions = ({ } if (!version) { console.log( - colors.red( - "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) + colors.red( + "invalid arguments, missing `version` or `versionTag`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) ); return false; } if (!create && !update) { console.log( - colors.red( - "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) + colors.red( + "invalid arguments, missing `update` or `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) ); return false; } if (create && update) { console.log( - colors.red( - "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" - ) + colors.red( + "invalid arguments, you provided conflicting arguments `update` and `create`, check `help` for more information\nrun 'npm run manage-project -- --help'" + ) ); return false; } @@ -360,20 +362,20 @@ const validateOptions = ({ const printHelp = () => { console.log( - colors.green( - `options:` + - `\n"versionTag" or "vt" for versionTag` + - `\n"version" or "v" for version` + - `\n"create" if you want to create such version` + - `\n"update" if you want to update such version` + - `\n\nversionTag or version is required!` + - `\ncreate or update option is required!` + - `\n\nexamples:` + - `\nnpm run manage-project -- --vt=piotr-123 --create` + - `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --create` + - `\nnpm run manage-project -- --vt=piotr-123 --update` + - `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --update` - ) + colors.green( + `options:` + + `\n"versionTag" or "vt" for versionTag` + + `\n"version" or "v" for version` + + `\n"create" if you want to create such version` + + `\n"update" if you want to update such version` + + `\n\nversionTag or version is required!` + + `\ncreate or update option is required!` + + `\n\nexamples:` + + `\nnpm run manage-project -- --vt=piotr-123 --create` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --create` + + `\nnpm run manage-project -- --vt=piotr-123 --update` + + `\nnpm run manage-project -- --v=v2018-08-01-piotr-123 --update` + ) ); }; diff --git a/tsconfig.json b/tsconfig.json index 8f59f43be..67950e0e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "resolveJsonModule": true, - "esModuleInterop": true + "esModuleInterop": true, + "lib": ["es2017", "dom"] } -} \ No newline at end of file +} From 06cb5351afe610b4cf6084e80b5bdbc455323f15 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:03:25 +0200 Subject: [PATCH 097/108] script fixed? --- docs/guides/building_blocks/Products.md | 7 +- package-lock.json | 91 +++++++++++++++++++++ package.json | 4 +- scripts/readme-upload-missing-images.ts | 104 ++++++++++++++++++++++++ 4 files changed, 202 insertions(+), 4 deletions(-) create mode 100644 scripts/readme-upload-missing-images.ts diff --git a/docs/guides/building_blocks/Products.md b/docs/guides/building_blocks/Products.md index 9628d4e60..3e004dd91 100644 --- a/docs/guides/building_blocks/Products.md +++ b/docs/guides/building_blocks/Products.md @@ -23,7 +23,8 @@ Voucherify allows for launching product-specific promotions. For example, you ca Voucherify supports product → variants relationship by default. This means you can create a parent object (`product`) and attach several variants (`SKUs`). In the [product](ref:get-product) object, you can define `attributes` to distinguish several [SKUs](ref:get-sku). For example: ```json Products - { +[ + { "id": "prod_yKHc4SyG1agSww", "source_id": "internal_erp_id_1477390384", "object": "product", @@ -39,8 +40,7 @@ Voucherify supports product → variants relationship by default. This means you "total": 0, "data": [] } - } - + }, { "id":"sku_0KtP4rvwEECQ2U", "source_id":"internal_erp_sku_id_1477475922", @@ -55,6 +55,7 @@ Voucherify supports product → variants relationship by default. This means you "country": "us" } } +] ``` > 👍 Source_id diff --git a/package-lock.json b/package-lock.json index b987351eb..fde0aac8d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "version": "1.0.0", "dependencies": { + "axios": "^1.5.1", "colors": "^1.4.0", "dotenv": "^16.3.1", "markdown-it": "^13.0.2", @@ -106,6 +107,21 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/axios": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.1.tgz", + "integrity": "sha512-Q28iYCWzNHjAm+yEAot5QaAMxhMghWLFVf7rRdwhUI+c2jix2DUXjAHXVi+s1ibs3mjPO/cCgbA++3BjD0vP/A==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", @@ -114,11 +130,30 @@ "node": ">=0.1.90" } }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -149,6 +184,38 @@ "url": "https://github.com/fb55/entities?sponsor=1" } }, + "node_modules/follow-redirects": { + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", + "integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/linkify-it": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", @@ -182,6 +249,25 @@ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -214,6 +300,11 @@ "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.5.tgz", "integrity": "sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA==" }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/tiny-case": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", diff --git a/package.json b/package.json index 077d58609..713cacc35 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,11 @@ "build-md-tables-from-openapi": "ts-node ./scripts/build-md-tables-from-openapi.ts", "readme-fix-reference-docs": "ts-node ./scripts/readme-fix-reference-docs.ts", "remove-stoplight-tags-from-openapi": "ts-node ./scripts/remove-stoplight-tags-from-openapi.ts", - "manage-project": "ts-node ./scripts/manage-project.ts" + "manage-project": "ts-node ./scripts/manage-project.ts", + "readme-upload-missing-images": "ts-node ./scripts/readme-upload-missing-images.ts" }, "dependencies": { + "axios": "^1.5.1", "colors": "^1.4.0", "dotenv": "^16.3.1", "markdown-it": "^13.0.2", diff --git a/scripts/readme-upload-missing-images.ts b/scripts/readme-upload-missing-images.ts new file mode 100644 index 000000000..17fc77d32 --- /dev/null +++ b/scripts/readme-upload-missing-images.ts @@ -0,0 +1,104 @@ +import * as fsPromises from "fs/promises"; +import * as fs from "fs"; +import path from "path"; +import axios from "axios"; + +const readmeUploadMissingImages = async () => { + if (process.env.README_IO_AUTH?.length < 10) { + console.log("`README_IO_AUTH` was not provided in `.env` file :/"); + return; + } + const basePath = path.join(__dirname, "../docs"); + const pathsToFiles = await getFiles(basePath); + for (const pathToFile of pathsToFiles) { + const fileData = await fsPromises.readFile(pathToFile, { + encoding: "utf8", + }); + const matchIterator: any = fileData.matchAll(/\.\.\/\.\.\/assets.*/g); + let match = matchIterator.next(); + const matches = []; + while (match.value) { + matches.push(match); + match = matchIterator.next(); + } + if (!matches.length) { + continue; + } + let newFileContent = `${fileData}`; + while (matches.length) { + const { value } = matches.pop(); + const matchedString = value[0]; + if (matchedString.includes("-->")) { + continue; + } + const matchedIndex = value.index; + const pathToAsset = matchedString.match(/\.\.\/\.\.\/assets[^" ]+/)?.[0]; + if (!pathToAsset) { + throw `Path to asset not found :/ problem in file: ${pathToFile}`; + } + + const absolutePathToAsset = path.join( + __dirname, + "../docs", + pathToAsset.replaceAll("../", "") + ); + const urlToFile = await uploadImageToReadme(absolutePathToAsset); + console.log(`Image uploaded, doc file: ${pathToFile}`); + const textToReplaceWithMatchedString = matchedString.replace( + pathToAsset, + urlToFile + ); + newFileContent = + newFileContent.slice(0, matchedIndex) + + textToReplaceWithMatchedString + + newFileContent.slice(matchedIndex + matchedString.length); + } + if (newFileContent === fileData) { + continue; + } + await fsPromises.writeFile(pathToFile, newFileContent); + } + console.log("Done!"); +}; + +const FormData = require("form-data"); +const uploadImageToReadme = async (pathToFile) => { + const fileStream = fs.createReadStream(pathToFile); + const form = new FormData(); + // Pass file stream directly to form + form.append("file", fileStream); + const response = await axios.post( + "https://dash.readme.com/api/images/image-upload", + form, + { + headers: { + authorization: "Basic " + btoa(process.env.README_IO_AUTH + ":"), + }, + } + ); + if (response.status !== 200 || !response?.data?.[0]) { + throw response; + } + return response.data[0]; +}; +const getFiles = async (path: string) => { + const pathsToFiles: string[] = []; + const items = await fsPromises.readdir(path, { + withFileTypes: true, + }); + for (const item of items) { + const itemPath = path + `/${item.name}`; + if (item.isDirectory() && !itemPath.endsWith(".bin")) { + (await getFiles(itemPath)).forEach((value) => { + pathsToFiles.push(value); + }); + continue; + } + if (itemPath.endsWith(".md")) { + pathsToFiles.push(itemPath); + } + } + return pathsToFiles; +}; + +readmeUploadMissingImages(); From 4706f30e6c413cb23ae49f34ef4e3ceaa00bf264 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:13:07 +0200 Subject: [PATCH 098/108] Update readme-upload-missing-images.ts --- scripts/readme-upload-missing-images.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/readme-upload-missing-images.ts b/scripts/readme-upload-missing-images.ts index 17fc77d32..4fdf6f18c 100644 --- a/scripts/readme-upload-missing-images.ts +++ b/scripts/readme-upload-missing-images.ts @@ -2,6 +2,7 @@ import * as fsPromises from "fs/promises"; import * as fs from "fs"; import path from "path"; import axios from "axios"; +import FormData from "form-data"; const readmeUploadMissingImages = async () => { if (process.env.README_IO_AUTH?.length < 10) { @@ -61,7 +62,6 @@ const readmeUploadMissingImages = async () => { console.log("Done!"); }; -const FormData = require("form-data"); const uploadImageToReadme = async (pathToFile) => { const fileStream = fs.createReadStream(pathToFile); const form = new FormData(); From 447d9f3494e6485380fc99b5d1f34aeff489e739 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:38:04 +0200 Subject: [PATCH 099/108] fixing and refactoring script --- scripts/manage-project.ts | 50 ++++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 9ab2434eb..34226ff42 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -36,24 +36,24 @@ const main = async ({ create?: boolean; update?: boolean; }) => { - const valid = validateOptions({ help, version, create, update }); + if (process.env.README_IO_AUTH?.length < 10) { + console.log( + colors.red("`README_IO_AUTH` was not provided in `.env` file :/") + ); + return; + } + const valid = await validateOptions({ help, version, create, update }); if (!valid) { return; } if (create) { await createNewVersion(version); - } else if (!(await isVersionExists(version))) { - console.log( - colors.red( - `Version ${version} does not exist! Create it first. Use parameter --update instead of --create` - ) - ); - return; } await cleanProject(version); await uploadOpenApiFile(version); await buildMdTables(); await updateMdTablesInDocs(); + await uploadImagesUsedInMdFiles(); await uploadGuideFiles(version); await uploadReferenceDocsWithMaxNumberOfAttempts(version); console.log( @@ -61,6 +61,18 @@ const main = async ({ ); }; +const uploadImagesUsedInMdFiles = async () => { + console.log( + colors.green( + "LOOKING FOR NOT UPLOADED IMAGES IN MD FILES, UPLOADING IF NEEDED..." + ) + ); + await runCliProcess({ + command: `npm run readme-upload-missing-images`, + }); + console.log(colors.green("OPERATION WAS COMPLETED SUCCESSFULLY!")); +}; + const isVersionExists = async (version: string) => { return ( ( @@ -171,7 +183,7 @@ const uploadOpenApiFile = async (version) => { }; const createNewVersion = async (version) => { - //create fork + console.log(colors.green("CREATING NEW VERSION")); try { const response = await fetch(`https://dash.readme.com/api/v1/version`, { method: "POST", @@ -189,7 +201,7 @@ const createNewVersion = async (version) => { version, }), }); - if (response.status !== 200) { + if (response.status !== 200 && !(await isVersionExists(version))) { throw new Error( `Response status: ${response.status}, maybe this versionTag is already created?` ); @@ -318,7 +330,7 @@ const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; -const validateOptions = ({ +const validateOptions = async ({ help, version, create, @@ -357,6 +369,22 @@ const validateOptions = ({ ); return false; } + if (update && !(await isVersionExists(version))) { + console.log( + colors.red( + `Version ${version} does not exist! Create it first. Use parameter --create instead of --update` + ) + ); + return false; + } + if (create && (await isVersionExists(version))) { + console.log( + colors.red( + `Version ${version} already exist! Update it instead. Use parameter --update instead of --create` + ) + ); + return false; + } return true; }; From 94eed6319e5feef1ac4adfc2f62814fca357b3f8 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:39:18 +0200 Subject: [PATCH 100/108] Update manage-project.ts --- scripts/manage-project.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index 34226ff42..f1f28e835 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -36,14 +36,7 @@ const main = async ({ create?: boolean; update?: boolean; }) => { - if (process.env.README_IO_AUTH?.length < 10) { - console.log( - colors.red("`README_IO_AUTH` was not provided in `.env` file :/") - ); - return; - } - const valid = await validateOptions({ help, version, create, update }); - if (!valid) { + if (!(await validate({ help, version, create, update }))) { return; } if (create) { @@ -330,7 +323,7 @@ const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; -const validateOptions = async ({ +const validate = async ({ help, version, create, @@ -341,6 +334,12 @@ const validateOptions = async ({ create?: boolean; update?: boolean; }) => { + if (process.env.README_IO_AUTH?.length < 10) { + console.log( + colors.red("`README_IO_AUTH` was not provided in `.env` file :/") + ); + return; + } if (help || (!version && !create && !update)) { printHelp(); return false; From c7d32bcbad580c3d668d39e0c3ca55f63a396d7c Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:46:29 +0200 Subject: [PATCH 101/108] Update manage-project.ts --- scripts/manage-project.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/manage-project.ts b/scripts/manage-project.ts index f1f28e835..a245f18cc 100644 --- a/scripts/manage-project.ts +++ b/scripts/manage-project.ts @@ -90,7 +90,7 @@ const uploadReferenceDocsWithMaxNumberOfAttempts = async ( console.log(colors.green("UPLOADING REFERENCE DOC FILES...")); for (let i = 1; i <= maxNumberOfUploadingAttempts; i++) { await new Promise((r) => setTimeout(r, 10000)); - const success = await runCliProcess({ + const { success, error } = await runCliProcess({ command: `rdme docs ./docs/reference-docs --version=${version}`, stdoutIncludes: "successfully created", resolveErrorAsFalse: true, @@ -100,6 +100,7 @@ const uploadReferenceDocsWithMaxNumberOfAttempts = async ( break; } if (i === maxNumberOfUploadingAttempts) { + console.log(error); throw new Error("REFERENCE DOC FILES WERE NOT UPLOADED!"); } } @@ -116,7 +117,7 @@ const runCliProcess = async ({ stdoutIncludes?: string; stderrIncludes?: string; resolveErrorAsFalse?: boolean; -}) => { +}): Promise<{ success: boolean; error?: string }> => { return await new Promise((resolve) => { exec(command, (error, stdout, stderr) => { const stdoutClean = stdout.replace(/.*voucherify/, "").trim(); @@ -125,13 +126,13 @@ const runCliProcess = async ({ (!stdoutIncludes && stdoutClean) || (stderrIncludes && stderr.includes(stderrIncludes)) ) { - return resolve(true); - } - if (stderr) { - console.log("Error: \n", stderr); + return resolve({ success: true }); } if (resolveErrorAsFalse) { - return resolve(false); + return resolve({ success: false, error: `Error: \n${stderr}` }); + } + if (stderr) { + console.log(`Error: \n${stderr}`); } throw error; }); From cf8fc6efbc854b36e8f1526a1dbf1fcf7681e6cd Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 20 Oct 2023 16:54:14 +0200 Subject: [PATCH 102/108] Update CONTRIBUTING.md --- CONTRIBUTING.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f5c0b131..0104121e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -105,6 +105,14 @@ Good practices: - Authenticate `rdme` tool by running: `rdme login` command; you can check if it works using the command `rdme whoami`; what should result: `You are currently logged in as xxx@voucherify.io to the voucherify project.` - Copy `.env.example` to `.env` and add to this file your personal API Key created in readme.io: `dashboard` > `configuration` > `API Keys` +### Images in .md files + +- There are 2 ways to add images to .md files: + - with `[block:image]` component, [see example in Quickstart.md](docs/guides/getting_started/Quickstart.md) + - with link declaration, for example `![Welcome Diagram](https://files.readme.io/6070078-welcome-diagram.png "Welcome Diagram")` +- At first always point to assets img folder, for example: `![Recent Changes](../../assets/img/guides_getting_started_quickstart_recent_changes_4.png "Recent Changes")` +- This path declaration will be automatically updated to url link while during `npm run manage-project` command. + ### Development process - For each change / pull request, create your copy of the current documentation, where you will test changes. - Create your own branch from `master`, From 6dd3881a8fb949d2626a5d7cc7b3ddcf8a13d778 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 23 Oct 2023 11:49:31 +0200 Subject: [PATCH 103/108] Update readme-upload-missing-images.ts --- scripts/readme-upload-missing-images.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/readme-upload-missing-images.ts b/scripts/readme-upload-missing-images.ts index 4fdf6f18c..c867fa4bc 100644 --- a/scripts/readme-upload-missing-images.ts +++ b/scripts/readme-upload-missing-images.ts @@ -19,25 +19,29 @@ const readmeUploadMissingImages = async () => { let match = matchIterator.next(); const matches = []; while (match.value) { + // found asset matches.push(match); match = matchIterator.next(); } if (!matches.length) { + // not found any assets continue; } let newFileContent = `${fileData}`; while (matches.length) { + // looping through matches, start from the last one - `pop` is required! const { value } = matches.pop(); const matchedString = value[0]; if (matchedString.includes("-->")) { + // skip if match found in comment continue; } const matchedIndex = value.index; const pathToAsset = matchedString.match(/\.\.\/\.\.\/assets[^" ]+/)?.[0]; if (!pathToAsset) { + // this should be impossible throw `Path to asset not found :/ problem in file: ${pathToFile}`; } - const absolutePathToAsset = path.join( __dirname, "../docs", @@ -45,6 +49,7 @@ const readmeUploadMissingImages = async () => { ); const urlToFile = await uploadImageToReadme(absolutePathToAsset); console.log(`Image uploaded, doc file: ${pathToFile}`); + // texts const textToReplaceWithMatchedString = matchedString.replace( pathToAsset, urlToFile From 317ddad0b0bbdfb714333371c8997cd854022997 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:03:51 +0200 Subject: [PATCH 104/108] refactoring --- scripts/helpers/getFiles.ts | 24 ++++++++++++ scripts/readme-fix-reference-docs.ts | 52 ++++++++----------------- scripts/readme-upload-missing-images.ts | 24 ++---------- 3 files changed, 45 insertions(+), 55 deletions(-) create mode 100644 scripts/helpers/getFiles.ts diff --git a/scripts/helpers/getFiles.ts b/scripts/helpers/getFiles.ts new file mode 100644 index 000000000..82a16fde1 --- /dev/null +++ b/scripts/helpers/getFiles.ts @@ -0,0 +1,24 @@ +import fsPromises from "fs/promises"; + +export const getFiles = async ( + path: string, + skipDirectoryNames: string[] = [] +) => { + const pathsToFiles: string[] = []; + const items = await fsPromises.readdir(path, { + withFileTypes: true, + }); + for (const item of items) { + const itemPath = path + `/${item.name}`; + if (item.isDirectory() && !skipDirectoryNames.includes(item.name)) { + (await getFiles(itemPath, skipDirectoryNames)).forEach((value) => { + pathsToFiles.push(value); + }); + continue; + } + if (!item.isDirectory()) { + pathsToFiles.push(itemPath); + } + } + return pathsToFiles; +}; diff --git a/scripts/readme-fix-reference-docs.ts b/scripts/readme-fix-reference-docs.ts index ef6c0a1a8..aa949b2d4 100644 --- a/scripts/readme-fix-reference-docs.ts +++ b/scripts/readme-fix-reference-docs.ts @@ -1,7 +1,8 @@ -import * as fsPromises from 'fs/promises' -import path from 'path'; -import dotenv from 'dotenv' -import minimist from 'minimist'; +import * as fsPromises from "fs/promises"; +import path from "path"; +import dotenv from "dotenv"; +import minimist from "minimist"; +import { getFiles } from "./helpers/getFiles"; dotenv.config(); const { version } = minimist(process.argv.slice(2)); @@ -9,7 +10,7 @@ const { version } = minimist(process.argv.slice(2)); const readmeFixReferenceDocs = async () => { if (!version) { console.log( - "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" + "`version` argument was not provided :/, next time try add `-- --version=************` at the end of file execution command" ); return; } @@ -18,15 +19,16 @@ const readmeFixReferenceDocs = async () => { return; } const basePath = path.join(__dirname, "../docs"); - const pathsToFiles = await getFiles(basePath); - + const pathsToFiles = (await getFiles(basePath, [".bin"])).filter((filePath) => + filePath.endsWith(".md") + ); const dataToProcess = []; for (const pathToFile of pathsToFiles) { const data = await fsPromises.readFile(pathToFile, { encoding: "utf8" }); const slug = data.match(/slug: .*/)?.[0]?.split?.("slug: ")?.[1]; const type = data.match(/type: .*/)?.[0]?.split?.("type: ")?.[1]; const order = parseInt( - data.match(/order: .*/)?.[0]?.split?.("order: ")?.[1] + data.match(/order: .*/)?.[0]?.split?.("order: ")?.[1] ); if (!slug || isNaN(order)) { throw new Error("Invalid slug or order in " + pathToFile); @@ -51,7 +53,7 @@ const updateDoc = async ({ slug, order, type, pathToFile }) => { body: JSON.stringify({ order, type }), }; - try{ + try { const response = await fetch( `https://dash.readme.com/api/v1/docs/${slug}`, options @@ -60,7 +62,9 @@ const updateDoc = async ({ slug, order, type, pathToFile }) => { const responseJSON = await response.json(); if (responseJSON.error) { - console.log(`Error in json response from readme for ${slug}`, { responseJSON }); + console.log(`Error in json response from readme for ${slug}`, { + responseJSON, + }); throw new Error(responseJSON.error); } @@ -71,9 +75,9 @@ const updateDoc = async ({ slug, order, type, pathToFile }) => { } return responseJSON; - }catch(error){ + } catch (error) { console.log(`Error when reqesting readme for ${slug}`, error); - throw new Error(error) + throw new Error(error); } }; @@ -82,30 +86,8 @@ const chunkArray = (list, chunkSize) => list.splice(0, chunkSize) ); -const getFiles = async (path: string) => { - const pathsToFiles: string[] = []; - const items = await fsPromises.readdir(path, { - withFileTypes: true, - }); - for (const item of items) { - const itemPath = path + `/${item.name}`; - if (item.isDirectory() && !itemPath.endsWith(".bin")) { - (await getFiles(itemPath)).forEach((value) => { - pathsToFiles.push(value); - }); - continue; - } - if (itemPath.endsWith(".md")) { - pathsToFiles.push(itemPath); - } - } - return pathsToFiles; -}; - const asyncMap = (arr, asyncFn) => { return Promise.all(arr.map(asyncFn)); }; - - -readmeFixReferenceDocs() +readmeFixReferenceDocs(); diff --git a/scripts/readme-upload-missing-images.ts b/scripts/readme-upload-missing-images.ts index c867fa4bc..586eb3c9c 100644 --- a/scripts/readme-upload-missing-images.ts +++ b/scripts/readme-upload-missing-images.ts @@ -3,6 +3,7 @@ import * as fs from "fs"; import path from "path"; import axios from "axios"; import FormData from "form-data"; +import { getFiles } from "./helpers/getFiles"; const readmeUploadMissingImages = async () => { if (process.env.README_IO_AUTH?.length < 10) { @@ -10,7 +11,9 @@ const readmeUploadMissingImages = async () => { return; } const basePath = path.join(__dirname, "../docs"); - const pathsToFiles = await getFiles(basePath); + const pathsToFiles = (await getFiles(basePath, [".bin"])).filter((filePath) => + filePath.endsWith(".md") + ); for (const pathToFile of pathsToFiles) { const fileData = await fsPromises.readFile(pathToFile, { encoding: "utf8", @@ -86,24 +89,5 @@ const uploadImageToReadme = async (pathToFile) => { } return response.data[0]; }; -const getFiles = async (path: string) => { - const pathsToFiles: string[] = []; - const items = await fsPromises.readdir(path, { - withFileTypes: true, - }); - for (const item of items) { - const itemPath = path + `/${item.name}`; - if (item.isDirectory() && !itemPath.endsWith(".bin")) { - (await getFiles(itemPath)).forEach((value) => { - pathsToFiles.push(value); - }); - continue; - } - if (itemPath.endsWith(".md")) { - pathsToFiles.push(itemPath); - } - } - return pathsToFiles; -}; readmeUploadMissingImages(); From 08f4bda359d9f73ca452acb0795b0d603b5e49ce Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:48:35 +0200 Subject: [PATCH 105/108] Update OpenAPI.json --- reference/OpenAPI.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/reference/OpenAPI.json b/reference/OpenAPI.json index cbf2a6696..0f726a183 100644 --- a/reference/OpenAPI.json +++ b/reference/OpenAPI.json @@ -33956,15 +33956,6 @@ "title": "Logical Operator Between Filters", "$ref": "#/components/schemas/Junction" }, - "Junction": { - "enum": [ - "AND", - "OR", - "and", - "or" - ], - "type": "string" - }, "23_obj_qualification_redeemables": { "title": "Redeemables", "type": "object", From 9813aec337288e6fa466c4e2384ec588a6853605 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:57:29 +0200 Subject: [PATCH 106/108] Update Quickstart.md --- docs/guides/getting_started/Quickstart.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index c3c7fedff..e80afa9de 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -25,14 +25,14 @@ After you create your account, you get access to the Sandbox dashboard. Sandbox Type **BLCKFRDY** in the search bar and Voucherify will **redirect** you to the voucher page, which displays the basic information about the discount it carries. Let’s redeem the code with the API. -![Voucherify Dashboard](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/5b1f45e537c0832f2f125424d0eb13a5ea1b1e49/docs/assets/img/guides_getting_started_Quickstart_join_the_dashboard.png) +![Voucherify Dashboard](../../assets/img/guides_getting_started_Quickstart_join_the_dashboard.png) ## Get your API keys The Sandbox Project Dashboard is already showing your default API keys for the Sandbox project. You can also navigate to Project Settings to find the Authentication section. -![Application Keys](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_API_keys.png) +![Application Keys](../../assets/img/guides_getting_started_Quickstart_API_keys.png) ## Make a test API request @@ -255,7 +255,7 @@ Every redemption can be [listed](ref:list-redemptions) with the API or in the da "images": [ { "image": [ - ["https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_review_logs.png], + "../../assets/img/guides_getting_started_Quickstart_review_logs.png", 1004 ], "sizing": "80" @@ -267,7 +267,7 @@ Every redemption can be [listed](ref:list-redemptions) with the API or in the da To monitor and filter the list of all API calls for your project, you can go to the [Audit log](https://app.voucherify.io/#/app/core/logs): -![Audit Log](https://raw.githubusercontent.com/voucherifyio/voucherify-openapi/mk/updating-quickstart-article/docs/assets/img/guides_getting_started_Quickstart_audit_log.png) +![Audit Log](../../assets/img/guides_getting_started_Quickstart_audit_log.png) ## Test promo scenarios with "Hot Beans" demo store From bca0550175ef6ee78383f74dc87c7ff632944fe7 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 24 Oct 2023 10:58:25 +0200 Subject: [PATCH 107/108] script fix and links --- docs/guides/getting_started/Quickstart.md | 8 ++++---- scripts/readme-upload-missing-images.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/guides/getting_started/Quickstart.md b/docs/guides/getting_started/Quickstart.md index e80afa9de..8b0f5e415 100644 --- a/docs/guides/getting_started/Quickstart.md +++ b/docs/guides/getting_started/Quickstart.md @@ -25,14 +25,14 @@ After you create your account, you get access to the Sandbox dashboard. Sandbox Type **BLCKFRDY** in the search bar and Voucherify will **redirect** you to the voucher page, which displays the basic information about the discount it carries. Let’s redeem the code with the API. -![Voucherify Dashboard](../../assets/img/guides_getting_started_Quickstart_join_the_dashboard.png) +![Voucherify Dashboard](https://files.readme.io/d7297c6-guides_getting_started_Quickstart_join_the_dashboard.png) ## Get your API keys The Sandbox Project Dashboard is already showing your default API keys for the Sandbox project. You can also navigate to Project Settings to find the Authentication section. -![Application Keys](../../assets/img/guides_getting_started_Quickstart_API_keys.png) +![Application Keys](https://files.readme.io/994df01-guides_getting_started_Quickstart_API_keys.png) ## Make a test API request @@ -255,7 +255,7 @@ Every redemption can be [listed](ref:list-redemptions) with the API or in the da "images": [ { "image": [ - "../../assets/img/guides_getting_started_Quickstart_review_logs.png", + "https://files.readme.io/95e3dba-guides_getting_started_Quickstart_review_logs.png", 1004 ], "sizing": "80" @@ -267,7 +267,7 @@ Every redemption can be [listed](ref:list-redemptions) with the API or in the da To monitor and filter the list of all API calls for your project, you can go to the [Audit log](https://app.voucherify.io/#/app/core/logs): -![Audit Log](../../assets/img/guides_getting_started_Quickstart_audit_log.png) +![Audit Log](https://files.readme.io/207c12c-guides_getting_started_Quickstart_audit_log.png) ## Test promo scenarios with "Hot Beans" demo store diff --git a/scripts/readme-upload-missing-images.ts b/scripts/readme-upload-missing-images.ts index 586eb3c9c..f0600b8c2 100644 --- a/scripts/readme-upload-missing-images.ts +++ b/scripts/readme-upload-missing-images.ts @@ -40,7 +40,7 @@ const readmeUploadMissingImages = async () => { continue; } const matchedIndex = value.index; - const pathToAsset = matchedString.match(/\.\.\/\.\.\/assets[^" ]+/)?.[0]; + const pathToAsset = matchedString.match(/\.\.\/\.\.\/assets[^" )]+/)?.[0]; if (!pathToAsset) { // this should be impossible throw `Path to asset not found :/ problem in file: ${pathToFile}`; From e7d1c308cb53aff75a2e3a0c33089284ef1adf01 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:04:03 +0200 Subject: [PATCH 108/108] Update Changelog.md --- Changelog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Changelog.md b/Changelog.md index 06a636810..dbc7ce1a7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,10 @@ # Changelog +## 20230924 + +- Updated `docs/guides/getting_started/Quickstart.md` + + ## 20230923 - Endpoint bugfixes and improvements - Described customer object in Track custom event endpoint
\\n\\n
\\n \\n
\\n\\n
\\n\\n
\\n\\n\\n
\\n\\n\\n\\n\\n\\n
\\n\\n
\\n